This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Graham Wagg

+ Follow
since Apr 30, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Graham Wagg

OK, sorted it.
Or rather, got round it, using the XJC Ant Task's nested argument �-npa� to suppress the creation of the package level annotations.

So, instead of the (bizarrely) problematic :

@javax.xml.bind.annotation.XmlSchema(namespace = "namespace", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

package thepackage;
@XmlRootElement(name = "Generated-class")

public class GeneratedClass {

Instead, we have no, and every generated class has the namespace inside as an annotation :

@XmlRootElement(name = "Generated-Class", namespace = "namespace")

public class GeneratedClass{

Cheers to anyone that looked, and hope that helps anyone.

PS. I still don't know WHY this happens, so if anyone can offer up a solution, that'd be grand.
Hi. I'm using JAXB 2.1.7 for the first time, and am managing to generate the required files, but I seem to get a compile error in the generated Seems to me the package annotations are in ideas? Thanks in advance.

The (generated)

@javax.xml.bind.annotation.XmlSchema(namespace = "http://yaddayadda_v_0_7", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package thepackage;

The error :

Compiling 1602 source files to rarara\services\target\classes
[javac] thepackage/ package annotations should be in file
[javac] @javax.xml.bind.annotation.XmlSchema(namespace = "http://yaddayadda_v_0_7", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

Obviously you can - or at least you can get the Clob locator - a schoolboy error from me, missing the "}" from the stored procedure call prevented progress (and some correcting of the signature call). Whoopsie.

Cheers to anyone that looked.

I'm trying to use a Clob as an attribute of a structured type, but I'm having trouble retrieving the Clob from Oracle, resorting to explicitly retrieving it in a seperate query on a database column. Is there a way of retrieving it as part of a Java VO? I haven't found it explicitly printed where it's not possible, but I have a nagging idea that it isn't. Any ideas?

I'm using Java 1.4 (soon to be Java 1.5), and Oracle 10.1.2.

Any help, greatly appreciated.

The code :

My VO (CharacterDataVO) contains 2 attributes - an id (BigDecimal), and data (the Clob). I'm calling a stored procedure, and it bombs out when I hit callable.execute(), and reports a StringIndexOutOfBoundsException:33. (I'm going to convert it to text once it's back - hence the String returned. Not an issue.)

The Clob is only ~10chars long at the moment(for test purposes, will get much bigger).

public String getClobVO(BigDecimal id) {
Connection con = null;
CallableStatement callable = null;
CharacterDataVO charData = new CharacterDataVO();

String clobString = null;
try {

con = getConnection();

Map map;
map = con.getTypeMap();
map.put(SQLObjectTypeNames.OT_CHARACTER_DATA_VO, CharacterDataVO.class);


//set call
callable = con.prepareCall("{? = call " + LARGE_DATA_PACKAGE + ".GET(?)");

//set parameters
callable.setBigDecimal(2, id);

callable.registerOutParameter(1, OracleTypes.STRUCT, SQLObjectTypeNames.OT_CHARACTER_DATA_VO);

charData = (CharacterDataVO)callable.getObject(1);

} catch (final SQLException e) {
} catch (final Exception e) {
} finally {
if (con != null) {
try {
if (callable != null) {
} catch (final SQLException e) {

return clobString;

The exception : java.lang.StringIndexOutOfBoundsException: String index out of range: 33
at java.lang.String.charAt(Unknown Source)
at oracle.jdbc.driver.OracleSql.handleODBC(
at oracle.jdbc.driver.OracleSql.parse(
at oracle.jdbc.driver.OracleSql.getSql(
at oracle.jdbc.driver.OracleSql.getSqlBytes(
at oracle.jdbc.driver.T4CCallableStatement.doOall8(
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(
at oracle.jdbc.driver.OraclePreparedStatement.execute(
at oracle.jdbc.driver.OracleCallableStatement.execute(