You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by "Adrian G. Klingel" <Ad...@exaweb.com> on 2004/08/03 21:05:56 UTC

Build failed - Use the schemaBindings?

I'm attempting to generate the classes off of a relatively complex schema
(using Ant).  I'm getting the following error:

BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29:
org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At
file:/C:/dev/eclipse/workspace/myproduct/schema/MYSCHEMA.xsd, line 9, column
36: Unable to derive package name from an empty namespace URI. Use the
schemaBindings to specify a package name.

I'm not finding much information on what "the schemaBindings" are.  I would
appreciate any help for certain.

I'm running Ant inside of Eclipse 3.0 on a Windows XP laptop.

My buildfile looks like this:

<?xml version="1.0"?>
<project name="MyCompany MyProduct Schema Class Generator Build"
default="myproduct" basedir=".">
<target name="myproduct">
<!--
Set up the classpath for the generation task.
Include all the standard jaxme jars.
-->
<path id="generate.class.path">
<pathelement location="jaxme2.jar"/>
<pathelement location="jaxmejs.jar"/>
<pathelement location="jaxmexs.jar"/>
<pathelement location="jaxmeapi.jar"/>
</path>
<!--
Defines the generation task using that classpath.
-->
<taskdef name="xjc" classname="org.apache.ws.jaxme.generator.XJCTask"/>
<!--
Generate source code.
The 'schema' attribute gives the path to the schema the sources
will be generated from.
The 'target' attribute specifies the base directory that the source
will be generated into. Sources will be created in subdirectories
corresponding to the package structure.
-->
<xjc schema="schema/MYSCHEMA.xsd" target="src">
<!--
The source files to be created. The implictly identifies the package
to which the sources will belong.
-->
<produces includes="com/mycompany/ie/myschema/*.java"/>
</xjc>
</target>
</project>

 

 


Re: Build failed - Use the schemaBindings?

Posted by "John E. Conlon" <jc...@verticon.com>.
Adrian,

Produces Element -
You don't need the produces element to generate the src. Try it without
it.

Schema problems -
Robert may be right about the schema though, check it, but I have seen
some legal schemas causing problems. (Ok - I should have reported a
bug...) If your schema is legal you may want to try a simpler schema
just to get JAXME to generate something to make sure your build script
is set up ok.


John
On Tue, 2004-08-03 at 16:53, robert burrell donkin wrote:
> On 3 Aug 2004, at 22:30, Adrian G. Klingel wrote:
> 
> > Robert and John,
> >
> > Thanks very much for your prompt replies.  This looks like a very 
> > friendly
> > and helpful community.  I hope to be able to learn enough to give back 
> > soon.
> > I've got quite a bit of XML experience, but I'm new to JAXME.
> 
> that sounds great :)
> 
> > That fix got me past that error.  Now that portion of my build file 
> > looks
> > like this:
> >
> >       <xjc
> >         schema="schema/MYSCHEMA.xsd" target="src"
> > package="com.mycompany.myproduct.myschema">
> >             <!--
> >             The source files to be created. The implictly identifies 
> > the
> > package
> >             to which the sources will belong.
> >             -->
> >             <produces includes="*.java"/>
> >       </xjc>
> >
> > I must confess that I don't know the meaning of the <produces> 
> > element.  So
> > I may still have that wrong.  The way I understand it is that files 
> > will be
> > generated in the directory specified by the "package" attribute.  And 
> > if
> > that is so then what does the <produces> element do?
> 
> (it'd probably good if Ias or jochen jumped in here)
> 
> i'd hazard a guess that the produces is used mainly to allow (and 
> customize) an up-to-date check. it allows classes to be regenerated 
> only when needed.
> 
> > Finally, I now get this error:
> >
> > BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29:
> > java.lang.IllegalStateException: This particle doesn't have the element
> > type.
> 
> (again, this is probably a bit beyond my knowledge but...)
> 
> this seems like a problem with your schema (or a bug in jaxme's schema 
> parser). please check that your schema is valid and (if so) consider 
> donating a test case.
> 
> - robert
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: jaxme-dev-help@ws.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Build failed - Use the schemaBindings?

Posted by robert burrell donkin <rd...@apache.org>.
On 3 Aug 2004, at 22:30, Adrian G. Klingel wrote:

> Robert and John,
>
> Thanks very much for your prompt replies.  This looks like a very 
> friendly
> and helpful community.  I hope to be able to learn enough to give back 
> soon.
> I've got quite a bit of XML experience, but I'm new to JAXME.

that sounds great :)

> That fix got me past that error.  Now that portion of my build file 
> looks
> like this:
>
>       <xjc
>         schema="schema/MYSCHEMA.xsd" target="src"
> package="com.mycompany.myproduct.myschema">
>             <!--
>             The source files to be created. The implictly identifies 
> the
> package
>             to which the sources will belong.
>             -->
>             <produces includes="*.java"/>
>       </xjc>
>
> I must confess that I don't know the meaning of the <produces> 
> element.  So
> I may still have that wrong.  The way I understand it is that files 
> will be
> generated in the directory specified by the "package" attribute.  And 
> if
> that is so then what does the <produces> element do?

(it'd probably good if Ias or jochen jumped in here)

i'd hazard a guess that the produces is used mainly to allow (and 
customize) an up-to-date check. it allows classes to be regenerated 
only when needed.

> Finally, I now get this error:
>
> BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29:
> java.lang.IllegalStateException: This particle doesn't have the element
> type.

(again, this is probably a bit beyond my knowledge but...)

this seems like a problem with your schema (or a bug in jaxme's schema 
parser). please check that your schema is valid and (if so) consider 
donating a test case.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Build failed - Use the schemaBindings?

Posted by Jochen Wiedmann <jo...@freenet.de>.
Hi, Adrian,

Adrian G. Klingel wrote:

>I must confess that I don't know the meaning of the <produces> element.  So
>I may still have that wrong.  The way I understand it is that files will be
>generated in the directory specified by the "package" attribute.  And if
>that is so then what does the <produces> element do?
>  
>

See

    http://ws.apache.org/jaxme/manual/ch02.html#N102BF


>BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29:
>java.lang.IllegalStateException: This particle doesn't have the element
>type.
>  
>
That's an asserts clause failing. In other words, it indicates a bug. If 
you can provide a schema, that reproduces the problem, please be so kind 
and file a bug report in Jira:

    http://nagoya.apache.org/jira/browse/JAXME


Jochen



---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


RE: Build failed - Use the schemaBindings?

Posted by "Adrian G. Klingel" <Ad...@exaweb.com>.
Robert and John,

Thanks very much for your prompt replies.  This looks like a very friendly
and helpful community.  I hope to be able to learn enough to give back soon.
I've got quite a bit of XML experience, but I'm new to JAXME.

That fix got me past that error.  Now that portion of my build file looks
like this:

      <xjc 
        schema="schema/MYSCHEMA.xsd" target="src"
package="com.mycompany.myproduct.myschema">
            <!--
            The source files to be created. The implictly identifies the
package
            to which the sources will belong.
            -->
            <produces includes="*.java"/>
      </xjc>

I must confess that I don't know the meaning of the <produces> element.  So
I may still have that wrong.  The way I understand it is that files will be
generated in the directory specified by the "package" attribute.  And if
that is so then what does the <produces> element do?

Finally, I now get this error:

BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29:
java.lang.IllegalStateException: This particle doesn't have the element
type.

Thanks very much again.

Sincerely,
Adrian Klingel


-----Original Message-----
From: John E. Conlon [mailto:jconlon@verticon.com] 
Sent: Tuesday, August 03, 2004 3:37 PM
To: Adrian G. Klingel
Cc: jaxme mail list
Subject: Re: Build failed - Use the schemaBindings?


Also see JAXME Bug #18 which Jochen has fixed and closed:

http://issues.apache.org/jira/browse/JAXME-18

John

On Tue, 2004-08-03 at 14:28, robert burrell donkin wrote:
> hi adrian
> 
> i've added my answer to this one to the FAQ:
> 
> http://wiki.apache.org/ws/JaxMe/FrequentlyAskedQuestions
> 
> (hopefully jochen will correct me if i've made a mistake.)
> 
> - robert
> 
> On 3 Aug 2004, at 20:05, Adrian G. Klingel wrote:
> 
> > I'm attempting to generate the classes off of a relatively complex
> > schema (using Ant).  I'm getting the following error:
> >
> > BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29:
> > org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At 
> > file:/C:/dev/eclipse/workspace/myproduct/schema/MYSCHEMA.xsd, line 9, 
> > column 36: Unable to derive package name from an empty namespace URI. 
> > Use the schemaBindings to specify a package name.
> >
> > I'm not finding much information on what "the schemaBindings" are.  
> > I
> > would appreciate any help for certain.
> >
> > I'm running Ant inside of Eclipse 3.0 on a Windows XP laptop.
> >
> > My buildfile looks like this:
> >
> >
> > <?xml version="1.0"?>
> > <project name="MyCompany MyProduct Schema Class Generator Build"
> > default="myproduct" basedir=".">
> > <target name="myproduct">
> > <!--
> > Set up the classpath for the generation task.
> > Include all the standard jaxme jars.
> > -->
> > <path id="generate.class.path">
> > <pathelement location="jaxme2.jar"/>
> > <pathelement location="jaxmejs.jar"/>
> > <pathelement location="jaxmexs.jar"/>
> > <pathelement location="jaxmeapi.jar"/>
> > </path>
> > <!--
> > Defines the generation task using that classpath.
> > -->
> > <taskdef name="xjc" 
> > classname="org.apache.ws.jaxme.generator.XJCTask"/>
> > <!--
> > Generate source code.
> > The 'schema' attribute gives the path to the schema the sources
> > will be generated from.
> > The 'target' attribute specifies the base directory that the source
> > will be generated into. Sources will be created in subdirectories
> > corresponding to the package structure.
> > -->
> > <xjc schema="schema/MYSCHEMA.xsd" target="src">
> > <!--
> > The source files to be created. The implictly identifies the package 
> > to which the sources will belong.
> > -->
> > <produces includes="com/mycompany/ie/myschema/*.java"/>
> > </xjc>
> > </target>
> > </project>
> >
> >  
> >
> >  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: jaxme-dev-help@ws.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Build failed - Use the schemaBindings?

Posted by "John E. Conlon" <jc...@verticon.com>.
Also see JAXME Bug #18 which Jochen has fixed and closed:

http://issues.apache.org/jira/browse/JAXME-18

John

On Tue, 2004-08-03 at 14:28, robert burrell donkin wrote:
> hi adrian
> 
> i've added my answer to this one to the FAQ:
> 
> http://wiki.apache.org/ws/JaxMe/FrequentlyAskedQuestions
> 
> (hopefully jochen will correct me if i've made a mistake.)
> 
> - robert
> 
> On 3 Aug 2004, at 20:05, Adrian G. Klingel wrote:
> 
> > I'm attempting to generate the classes off of a relatively complex 
> > schema (using Ant).  I'm getting the following error:
> >
> > BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29: 
> > org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At 
> > file:/C:/dev/eclipse/workspace/myproduct/schema/MYSCHEMA.xsd, line 9, 
> > column 36: Unable to derive package name from an empty namespace URI. 
> > Use the schemaBindings to specify a package name.
> >
> > I'm not finding much information on what "the schemaBindings" are.  I 
> > would appreciate any help for certain.
> >
> > I'm running Ant inside of Eclipse 3.0 on a Windows XP laptop.
> >
> > My buildfile looks like this:
> >
> >
> > <?xml version="1.0"?>
> > <project name="MyCompany MyProduct Schema Class Generator Build" 
> > default="myproduct" basedir=".">
> > <target name="myproduct">
> > <!--
> > Set up the classpath for the generation task.
> > Include all the standard jaxme jars.
> > -->
> > <path id="generate.class.path">
> > <pathelement location="jaxme2.jar"/>
> > <pathelement location="jaxmejs.jar"/>
> > <pathelement location="jaxmexs.jar"/>
> > <pathelement location="jaxmeapi.jar"/>
> > </path>
> > <!--
> > Defines the generation task using that classpath.
> > -->
> > <taskdef name="xjc" classname="org.apache.ws.jaxme.generator.XJCTask"/>
> > <!--
> > Generate source code.
> > The 'schema' attribute gives the path to the schema the sources
> > will be generated from.
> > The 'target' attribute specifies the base directory that the source
> > will be generated into. Sources will be created in subdirectories
> > corresponding to the package structure.
> > -->
> > <xjc schema="schema/MYSCHEMA.xsd" target="src">
> > <!--
> > The source files to be created. The implictly identifies the package
> > to which the sources will belong.
> > -->
> > <produces includes="com/mycompany/ie/myschema/*.java"/>
> > </xjc>
> > </target>
> > </project>
> >
> >  
> >
> >  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: jaxme-dev-help@ws.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Build failed - Use the schemaBindings?

Posted by Jochen Wiedmann <jo...@freenet.de>.
robert burrell donkin wrote:

> i've added my answer to this one to the FAQ:
>
> http://wiki.apache.org/ws/JaxMe/FrequentlyAskedQuestions
>
> (hopefully jochen will correct me if i've made a mistake.)


Sorry, but I did ... :-)  However, thanks for creating the document, 
that's a good idea.
I also added a pointer to the Wiki to the JaxMe docs.


Jochen


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Build failed - Use the schemaBindings?

Posted by robert burrell donkin <rd...@apache.org>.
hi adrian

i've added my answer to this one to the FAQ:

http://wiki.apache.org/ws/JaxMe/FrequentlyAskedQuestions

(hopefully jochen will correct me if i've made a mistake.)

- robert

On 3 Aug 2004, at 20:05, Adrian G. Klingel wrote:

> I'm attempting to generate the classes off of a relatively complex 
> schema (using Ant).  I'm getting the following error:
>
> BUILD FAILED: C:\dev\eclipse\workspace\myproduct\build.xml:29: 
> org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At 
> file:/C:/dev/eclipse/workspace/myproduct/schema/MYSCHEMA.xsd, line 9, 
> column 36: Unable to derive package name from an empty namespace URI. 
> Use the schemaBindings to specify a package name.
>
> I'm not finding much information on what "the schemaBindings" are.  I 
> would appreciate any help for certain.
>
> I'm running Ant inside of Eclipse 3.0 on a Windows XP laptop.
>
> My buildfile looks like this:
>
>
> <?xml version="1.0"?>
> <project name="MyCompany MyProduct Schema Class Generator Build" 
> default="myproduct" basedir=".">
> <target name="myproduct">
> <!--
> Set up the classpath for the generation task.
> Include all the standard jaxme jars.
> -->
> <path id="generate.class.path">
> <pathelement location="jaxme2.jar"/>
> <pathelement location="jaxmejs.jar"/>
> <pathelement location="jaxmexs.jar"/>
> <pathelement location="jaxmeapi.jar"/>
> </path>
> <!--
> Defines the generation task using that classpath.
> -->
> <taskdef name="xjc" classname="org.apache.ws.jaxme.generator.XJCTask"/>
> <!--
> Generate source code.
> The 'schema' attribute gives the path to the schema the sources
> will be generated from.
> The 'target' attribute specifies the base directory that the source
> will be generated into. Sources will be created in subdirectories
> corresponding to the package structure.
> -->
> <xjc schema="schema/MYSCHEMA.xsd" target="src">
> <!--
> The source files to be created. The implictly identifies the package
> to which the sources will belong.
> -->
> <produces includes="com/mycompany/ie/myschema/*.java"/>
> </xjc>
> </target>
> </project>
>
>  
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org