JAXP,JAXB

can some body please suggest me the websites or link where I can found advanced concepts of JAXP,JAXB.
thanks
kanth.

JAXP can be used to parse into DOM, using SAX, and then output to XML after you've made your changes.

Similar Messages

  • Approach on parsing an XML file (JAXP, JAXB, DOM, SAX, XSLT)

    I have a pretty basic xml file that contains a database table name, fields, and sort order. My job is to read the XML file, construct the query based on the information in the nodes, and then output it in various ways. I know I can use JAXP, JAXB, DOM, SAX, and XSLT for this.
    I have the experience doing this using DOM. I have read up on JAXP, JAXB, and XSLT. I'm having a little bit of a difficult time on chosing the most appropriate way to do this. Again, I've always done it using DOM, but I'm not so sure that is the best way to do it here. Just looking for some recommendations from people whom are more familiar with XML parsing and processing.

    markwagoner wrote:
    I tried several of those but found them rather tedious. Now I just use JDOM for everything, it make life much easier.It doesn't, actually. It kept your learning curve shallow, but that's all. If you were to invest some time in JAXB, you'd find it made life easier for some things. If you invested time in XSLT, it would make life easier. Endlessly working with JDOM is incredibly tiresome after a while. You just don't know it because you never invested enough in learning anything else.
    Don't bother posting any code to "enlighten" me as to how simple JDOM is. I've been using it for years.

  • Java Development Environment

    Hi,
    I have been developing and running into JAXP, JAXB and SOAPMessageFactory issues. I am pretty sure it my environment which I am unable to set up correctly. If i do a re-install and only install that which I require it might work.
    This problem I have googled and discussed without success. I installed Netbeans to temporarily resolve the issue but I still have environment related problems with the client applet SOAP mesage factory response understanding using netbeans 6.1.
    Installed:
    -jdk1.6.0_05
    -jre1.6.0_03
    -jre1.6.0_05
    -WAMP (not related)
    -jwsdp-2.0
    -JavaEE5 + Server
    -Netbeans 6.1
    Not working
    -Metro
    -axis-bin-1_4
    -jaf-1_0_2-upd2
    -Xerces-J-bin.2.9.1
    Environment Variables
    - JWSDP_HOME = C:\Sun\jwsdp-2.0
    - JAVA_HOME = C:\Program Files\Java\jdk1.6.0_05
    - PATH = C:\Sun\jwsdp-2.0\jwsdp-shared\bin;C:\Sun\AppServer\bin;C:\Sun\SDK\bin;C:\Sun\jwsdp-2.0\jaxb\lib;C:\Program Files\SSH Communications Security\SSH Secure Shell
    - TEMP = %USERPROFILE%\AppData\Local\Temp
    - CLASSPATH = C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip;C:\Program Files\Java\mysql-connector-java-5.1.6-bin.jar
    I am kinda sure all these installed and unzipped application and APIs are causing the parsing and messaging errors.
    My objectives are:
    -Application server using JAXB, Sockets, MYSQL DB, SOAP
    -Client using SAAJ, SOAP
    My errors generated Running Netbeans 6.1
    com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (-1null
    Jul 5, 2008 2:10:26 PM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
    SEVERE: SAAJ0008: Bad Response; nullTo complete my objectives with SOAP http communication what APIs would I only require? I know ant is also required to parse the interface using jaxb.
    Any assistance would be appreciated.
    Regards,
    Buglish

    Sun has refactored JAXP, JAXB and SAAJ from Sun web service developer pack to jdk in 1.6 version, so first of all you have to uninstall web services developer pack.
    Moreover, if you are using some libraries like metro contains jars which have higher version than which come with jdk 1.6, so figure out those jars and place them in jdk_home/lib/endorsed directory + jre_home/lib/endorsed directory.
    Regards,
    Amer Sohail
    [My blog for Java Solutions|http://javainnovations.blogspot.com]

  • JWSDP question!

    Hi
    JWSDP includes JAX-RPC,JAXM,JAXR,JAXP,JAXB and SAAJ.
    Are these just the specifications of APIs or they also include the implementation.
    Also which Soap implementations support JAX-RPC and JAXM at the moment
    thanks,
    regards,
    Naresh Agarwal

    There also implementations (some of them are just repackaged and preconfigured opensource tools - like Tomcat 4 that comes with the package). I've just tried (successfully) to remotely call (via jax-rpc) a java server app from a java app - and also from a delphi app.
    I strongly suggest you download the wsdp tutorial, there's a pdf with all the details and tutorials to get you started. I think saw soap 1.2 and 1.1 mentioned in the doc.
    Well I have to conclude that using this technology is much easier than I expected.

  • Install JAXB and JAXP only

    Hi,
    We want to use the funtion of JAXB and JAXP
    but do not want to use the whole java web service
    Can the JAXB and JAXP work separately on JDK1.2/JDK1.3.1
    Jacinle

    The Jaxb directory in jwsdp-1.2 dir has the JAXB implementation.
    The Jaxp directory in jwsdp-1.2 dir has the JAXP implementation.

  • JAXP vs JAXB

    Hi there,
    Since there are so many API's to work with XML, and being these Sun specifications, what are the really differences between them? And when should I use one instead of the other.
    Many Thanks,
    MeTitus

    But in this case, why does Sun have two API to work
    with XML? JAXP and JAXB.It's because they do completely different things. As I'm sure that link that dvohra posted says.

  • JAXP or JAXB?

    Hi all,
    I got an XSD and I want to build an HTML that reflected the XSD.
    For example if I got <xs:complex> tag with few elements I want to make a combobox.
    My questions are:
    1. What technology can help me here, JAXP or JAXB? (Don't forget there're few attributes and other types that should be in the object) .
    2. Is someone knows about new technology or there's something out there that do it? (I know about EMF).
    Thanks in advance,

    you need jaxb if you have to create/manipulate an xml file without knowing of xml technology. So it is not used for transforming.
    If I understood correctly, you are building a simple form, in this case starting from a simple well formed xml (not "valid") not binded to schema will do the job. In this case you can specify all attributes and transform easily with xslt.
    <field type="textarea" col="20".../>But all depends on where the data would go after pressing "submit". In a database ? Back into xml ?
    Also I suppose it is not correct (and not possible I guess) transforming an xsd directly into something else, as you could re-arrange all the data constraint. A schema has to keep its integrity, its only purpose is to validate file.

  • JAXP and JAXB

    When to use JAXB and when to use JAXP?

    Excuse me. Is it a meaningless question?Sort of. It's kind of like asking "when to walk and when to ride the bus." Both get you where you are going but at different speeds and costs. For example, you wouldn't ride the bus to the bed to the bathroom and you probably wouldn't walk 20 miles if you can help it.
    On a side note, JAXP is a extremely painful API for building XML documents. If you can use JDOM or some other simplified API and SAX for when you on;y want to parse.

  • JAXB , JAXP and SAX compare

    Hi,
    I want to convert XML to another XML using XML Schema.
    I have XML Schema for the one I will convert to.
    I also need to modify some of the data.
    But I am confuse which process should I use, JAXB, JAXP or SAX.
    Any suggestions?
    Thanks,

    javax.xml.transform

  • Bug in JAXP or not?

    Hi all,
    I'm using JAXP 1.4 and JDK1.5_12, when I get to the following method I get the following exception:
    transformer.transform(source, result);
    Exception in thread "main" java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.parsers.XML11Configuration.getFeature0(Ljava/lang/String;)Z
         at com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration.getFeature(XIncludeAwareParserConfiguration.java:278)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.reset(AbstractSAXParser.java:2098)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:147)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:391)
         at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:231)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:493)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:663)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
         at com.mycompany.test.jaxb.TestJAXP.main(TestJAXP.java:38)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)Edited by: sasi2103 on Dec 18, 2007 7:53 AM

    Hello
    I have got similar exception when trying to run my web application in linux red hat.
    Jetty + JaxWS
    com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized WSSERVLET11: failed to parse runtime descriptor: java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.parsers.XML11Configuration.getFeature0(Ljava/lang/String;)Z
    java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.parsers.XML11Configuration.getFeature0(Ljava/lang/String;)Z
         at com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration.getFeature(XIncludeAwareParserConfiguration.java:278)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.reset(AbstractSAXParser.java:2098)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:147)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:560)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:642)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:281)
         at com.sun.xml.ws.util.pipe.AbstractSchemaValidationTube.createDOM(AbstractSchemaValidationTube.java:90)
         at com.sun.xml.ws.server.ServerSchemaValidationTube.getSchemaSources(ServerSchemaValidationTube.java:103)
         at com.sun.xml.ws.server.ServerSchemaValidationTube.<init>(ServerSchemaValidationTube.java:58)
         at com.sun.xml.ws.api.pipe.ServerTubeAssemblerContext.createValidationTube(ServerTubeAssemblerContext.java:212)
         at com.sun.xml.ws.util.pipe.StandaloneTubeAssembler.createServer(StandaloneTubeAssembler.java:76)
         at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:152)
         at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:217)
         at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
         at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
         at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
         at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)
         at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:540)
         at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
         at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
         at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
         at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
         at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
         at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
         at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
         at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
         at org.mortbay.jetty.Server.doStart(Server.java:222)
         at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    I have that xercesImpl in classpath, maybe i need a different version for Linux? my app works fine in Windows.
    Whatcould be the problem here?
    thanks a lot
    BR,
    seb

  • JAXB v1.0.2 and Webstart

    Hi,
    I'm trying to use JAXB within an app that is started via JNLP and WebStart.
    If i add all the JAXP jars to the JNLP file the app fails to start when JAXB calls into some xerces code that tries to access java.home.
    java.security.AccessControlException: access denied (java.util.PropertyPermission java.home read)
    /* stack trace */
         at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:95)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.getXMLReader(AbstractUnmarshallerImpl.java:80)
    If i dont put in the JAXP jars then i get the following:
    Caused by: java.lang.RuntimeException: Installation Problem??? Couldn't load messages: Can't find bundle for base name org.apache.xerces.impl.xpath.regex.message, locale en_US
         at com.sun.msv.datatype.xsd.regex.RegexParser.setLocale(RegexParser.java:132)
         at com.sun.msv.datatype.xsd.regex.RegexParser.<init>(RegexParser.java:122)
    If i put the jaxp jars in jre/lib/endorsed, then everything works - except that isnt going to work for a remote client.
    So, question is why does xerces require access to java.home ?

    I am getting essentially the same exception when running my app from command line:
    java.lang.RuntimeException: Installation Problem??? Couldn't load messages: Can't find bundle for base name org.apache.xerces.impl.xpath.rege
    x.message, locale en_US
    at com.sun.msv.datatype.xsd.regex.RegexParser.setLocale(RegexParser.java:132)
    at com.sun.msv.datatype.xsd.regex.RegexParser.<init>(RegexParser.java:122)
    at com.sun.msv.datatype.xsd.regex.ParserForXMLSchema.<init>(ParserForXMLSchema.java:71)
    [ snip ]
    The same code works find when running inside a webapp on Tomcat 5.
    Did you ever find the source of your problem, and indeed a solution?

  • Urgent help on JAXP

    First of all please forgive me as my question may be a newbie question. I am very new to these parsers and really has no clue at all on how they actually work. Now i need some explanations and some help. First, i will like to know where can i download JAXP and which version should i use.
    Next, lets say now i have a XML document, i will like to link it to a servlet in a webserver (i am using Apache Tomcat 4.0) and then to the MIDP (The MIDP i already establised a link to the servlet). Now, i would like to know are my steps correct? And also i would like to know in detail, how do i use the JAXP to link the XML document with my servlet.
    Another question is, when i link my MIDP to the servlet, i found out that it runs with a parser named kxml, what does this kxml do? Since i think it support the SAX, is this a parser that can also use to parse the xml document to the servlet?
    Thanks in advance

    Download JAXP here (in the JWSDP) : http://java.sun.com/webservices/downloads/webservicespack.html
    Tutorial :
    http://java.sun.com/webservices/docs/1.3/tutorial/doc/index.html
    But there is an other solution. You can use JAXB and generate class java for reading the xml without using SAX or DOM or ...
    Bye :)

  • JAXB - XMLGregorianCalendar toString has E notation

    Hi!
    I'm currently working on a project that uses JAXB for handling XML.
    I ran into some problem with reading/writing of DateTime values.
    For example:
    The input xml contains 2006-10-20T00:00:00.0000000+08:00
    In unmarshalling, JAXB doesn't have any issue loading this value.
    The issue comes in marshalling the object, the DateTime value becomes
    2006-10-20T00:00:00E-7+08:00. (with E notation)
    The marshalled value is no longer in a valid DateTime format and will report a schema validation error when unmarshalled+validation.
    This only happens for millisecond value with 6 leading decimal digits that are all 0.
    It looks like that XMLGregorianCalendar.toString() is using the BigDecimal.toString() instead of BigDecimal.toPlainString()
    I'm using jdk1.5.0_07 btw.
    Any idea on how to handle/fix this? I'm not sure if this is a bug or I'm just missing on something.
    Thanks in advance!
    Neil Almodiel

    Already reported this to jaxp issue tracker:
    https://jaxp.dev.java.net/issues/show_bug.cgi?id=12

  • Minimum packaging to deploy JAXB?

    What is the minimum set of jars I should ship to deploy XJC-generated classes?
    I'm trying to decide whether I can use JAXB, and one important factor is deployability. For my project, I can assume that the customer already has Java 1.4, but otherwise the application must be self-contained.
    I cannot ship the entire Web Services Developer Pack: that's far too large and complex for my needs, as I'm not building a web service. All I want is XML <-> Java translation using standardized APIs, and in the case of a known, fixed schema JAXB objects have better programmer convenience and memory efficiency than generic DOM trees.
    Is there an official distribution with a simple "jaxb-runtime.jar" I can use? At the moment, I'm taking individual jars out of the WSDP, trying to find the smallest set that works.
    Here's the minimum set of Jars that seem to work for running XJC generated classes.
    <fileset dir="${jwsdp}/jaxb/lib">
    <include name="jaxb-api.jar"/>
    <include name="jaxb-impl.jar"/>
    <include name="jaxb-libs.jar"/>
    </fileset>
    <fileset dir="${jwsdp}/jwsdp-shared/lib">
    <include name="jax-qname.jar"/>
    <include name="namespace.jar"/>
    <include name="relaxngDatatype.jar"/>
    <include name="xsdlib.jar"/>
    </fileset>
    Notably absent are the jars in jaxp/lib/endorsed. The large "xsdlib.jar" overlaps a lot with xercesImpl, but not enough to use it as a standalone xsd-aware jaxp parser, which I need for other reasons.
    Noteably present is a dependency on Relax NG, which I am not using.
    Unless JAXB packaging improves, I'll be using Xerces-J plus bare DOM. Tell me there's a better way?

    I think we do not have to take the files mentioned in second <fileset/> to the client. At runtime we need:
    jaxb-api.jar, jaxb-ri.jar(jaxb-impl.jar), jaxb-libs.jar, xerces.jar and generated jar for the package. It worked for me.
    Is there an official distribution with a simple
    "jaxb-runtime.jar" I can use? The JAXB system is divided into two main parts that are completely independent.
    1. Generating classes
    2. Creating objects at runtime
    Obviouly first part needs more XML specific jars, but for second part (in which client is interested) we don't need them.
    So there can't be a true "jaxb-runtime.jar".

  • Java 6, JAXB 2 and X3D (version 3.0)

    Hi everyone,
    I'm trying to unmarshall a X3D file using JAXB2 included in Java 6. I successfully generated the classes from the schema (http://www.web3d.org/specifications/x3d-3.0.xsd). I then created a simple X3D file using Blender and the Duke model available at https://duke.dev.java.net/models/Duke.lwo.
    However, when I try to unmarshall the model I get an exception. The X3D-file validates correctly using the validator in IntelliJ IDEA, but JAXB seems to fail somehow.
    The code used for unmarshalling:
    public static X3D loadModel(File input) {
        X3D model = null;
        try {
            JAXBContext context = JAXBContext.newInstance();
            Unmarshaller unmarshaller = context.createUnmarshaller();
            unmarshaller.setSchema(null);
            unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
            model = (X3D) unmarshaller.unmarshal(input);
        } catch (Exception e) {
            e.printStackTrace();  // TODO Fix exception handling.
        return model;
    }The Exception I get is:
    DefaultValidationEventHandler: [FATAL_ERROR]: unexpected element (uri:"", local:"X3D"). Expected elements are (none)
    Location: line 4 of file:/C:/Projects/JFokus/jfokus-demos/jogl-presentation/Duke.x3d
    javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"X3D"). Expected elements are (none)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:523)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:199)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:194)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:71)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:920)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:366)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:347)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:101)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
         at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3084)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:912)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:194)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:167)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:142)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:151)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:169)
         at se.jsolutions.jogl.X3dModel.loadModel(X3dModel.java:27)
         at se.jsolutions.jogl.X3dModel.main(X3dModel.java:37)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Done!
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
    Tried with other X3D-models I found online, with the same result. Any suggestions or help would be greatly appreciated.
    Thanks!
    // Erik

    public static X3D loadModel(File input) {
       X3D model = null;
       try {
          JAXBContext context = JAXBContext.newInstance(model.getPackage().getName());
          Unmarshaller unmarshaller = context.createUnmarshaller();
          model = (X3D) unmarshaller.unmarshal(input);
       } catch (Exception e) {
          e.printStackTrace();  // TODO Fix exception handling.
       return model;
    }

Maybe you are looking for