I think this is becaus you're using maven?  I think there is some issue with the maven plugin, I ran into this the other day.

The stax API is not only for JSE5.  It's bundled with JSE6 though, so you won't need to include this dependency.

Basically, just include this in your pom.xml file...

<dependency>
      <groupId>stax</groupId>
      <artifactId>stax-api</artifactId>
      <version>1.0.1</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.stream</groupId>
      <artifactId>sjsxp</artifactId>
      <version>1.0</version>
    </dependency>


and include the sun repository as well...

<repository>
      <id>java.net</id>
      <url> https://maven-repository.dev.java.net/nonav/repository</url>
      <layout>legacy</layout>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>

That should resolve it.

Per documentation, there is a way to enable it to use stax vs. xpp.  Take a look at http://jibx.sourceforge.net/runtime.html.

Either way, including above dependencies should resolve it.

Actually, also make sure that your'e actually passing unmarshalDocument a not-null InputStream.  It also generates that error when the InputStream is null...  I think the wrong exception is thrown and/or one is never thrown and trickles all the way down to stax before realizing that the InputStream is null.

Ilya



On 9/8/06, Vladimir Olenin <[EMAIL PROTECTED]> wrote:
Hi,
 
I'm getting a weird exception when running JiBX 1.1 compiled code:
 
Caused by: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
 at java.lang.Class.getDeclaredMethods0(Native Method)
 at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
 at java.lang.Class.getMethod0(Class.java:2611)
 at java.lang.Class.getMethod(Class.java:1579)
 at org.jibx.runtime.impl.UnmarshallingContext.createReaderFactory(Unknown Source)
 at org.jibx.runtime.impl.UnmarshallingContext.<clinit>(Unknown Source)
 at com.artilekt.modules.jetmailer.model.JiBX_message_bindingFactory.createUnmarshallingContext()
From what I know, the javax.xml.stream.XMLStreamException is J2EE 5.0 (http://java.sun.com/javaee/5/docs/api/javax/xml/stream/XMLStreamException.html )
 
How did this dependency ended up in the code generated by 1.1 JiBX binder? I thought it doesn't rely on any J2EE packages at all.... Current environment:
 
- binding - jibx-bind-1.1:
[INFO] Running JiBX binding compiler (single-module mode) on 1 binding file(s)
Running binding compiler version jibx_1_1
binding message_binding:
 context (mp#=1) (cv#=0) (fm#=0)
  mapping class com.artilekt.modules.jetmailer.model.Message to element message (#0)
   context (cv#=0) (fm#=0)
   element wrapper message
    object binding for com.artilekt.modules.jetmailer.model.Message create class com.artil
 
- runtime: jibx-run-1.1
 
- environment: Tomcat 5.5.17
 
I'll check if I get the same exception if running outside of the container, but in the meantime if anyone could comment on this issue, it would be really great...
 
Thanks.
 
Vlad
 
PS: if that matters, compilation has been done with maven plugin maven-jibx-plugin-1.1.jar, after all the issues with repository has been fixed as it has been discussed recently on the list, i.e., plugin dependencies changed to use 1.1 version of libraries instead of 1.0-RC1.
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to