Unmarshal - JAXB

I am consuming a .NET webservice. I generated a Java client using Eclipse to consume the Web service.I am returned a XML tree of type MessageElement [] and I am trying to unmarshaller.unmarshal() the XML but I am having problems doing the conversion.
The unmarshal only takes the following input types:
File
InputSource
InputStream
Node
Source
Help me plz. .. . How do I unmarshal this XML???

Your client's runtime environment should take care of the unmarshalling for you so that you just end up dealing with a Java object or normal parameters.
It sounds like you've generated the necessary helper classes from the WSDL, but does your client use these?
There's a good article on getting the various types of Java clients up and running here if you need a hand:
http://www-128.ibm.com/developerworks/webservices/library/ws-javaclient/

Similar Messages

  • Richfaces 4 and weblogic 10.0: error deploying

    When i tried to deploy an example application,
    I have this error:
    Unable to set the activation state to true for the application 'TestJSF'.
    weblogic.application.ModuleException:
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:975)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/C:/XXXXXXX/BEA_weblogic/modules/javax.xml.bind_2.0.jar!/javax/xml/bind/JAXBContext.class to zip:C:/XXXXXXX/BEA_weblogic/user_projects/domains/mare_domain/servers/AdminServer/tmp/_WL_user/TestJSF/96q78q/war/WEB-INF/lib/jaxb-api.jar!/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader.
    at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:96)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:214)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
    at javax.xml.bind.JAXB$Cache.<init>(JAXB.java:87)
    at javax.xml.bind.JAXB.getContext(JAXB.java:114)
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:143)
    at org.richfaces.javascript.ClientServiceConfigParser.parse(ClientServiceConfigParser.java:60)
    at org.richfaces.javascript.ClientServiceConfigParser.parseConfig(ClientServiceConfigParser.java:49)
    at org.richfaces.application.ValidatorModule.createClientScriptService(ValidatorModule.java:68)
    at org.richfaces.application.ValidatorModule.configure(ValidatorModule.java:62)
    at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:28)
    at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:136)
    at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:110)
    at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)
    at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
    at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2129)
    at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2105)
    at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:300)
    at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:603)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:369)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
    at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:168)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1744)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2909)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:973)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    Note that i have create and example application:
    TestJSF:
    lib
    common-annotations.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-logging.jar
    guava-r08.jar
    jaxb-api.jar
    jhighlight-1.0.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    richfaces-components-api-4.0.0.Final.jar
    richfaces-components-ui-4.0.0.Final.jar
    richfaces-core-api-4.0.0.Final.jar
    richfaces-core-impl-4.0.0.Final.jar
    standard.jar
    NOTE: before adding richfaces4 jars, i had jsf-api and jsf-impl of jsf 2 anche into weblogic.xml i specify to prefere application lib so,
    I tested a greeting application so it work fine !!
    The step after, i added richeface4 jars, and the application server gave me that error.
    Please !!
    hellp me!!
    a

    Hello,
    I have not seen this particular error before, but if you can re-build the EJB using Workshop 10.0 I bet it will fix your problem. The old Workshop is running an old version of appc which the 10.0 version of WLS is probably not expecting.
    Kevin

  • Query in Unmarshaling using JAXB

    Hi,
    I have some chinese characters in my xml. When i try to read those string from XML using JAXB Unmarshaling and print the same, it is getting changed to some unicode character.
    Help me in this regard.
    As the chinese characaters are getting changed after preview, if u can contact my thro mail, it will be better ([email protected] is my email id)
    Regards
    Ravishankar

    Please post the error message and the exception stack.
    My guess is that the error is: your VO's SQL statement did not include the primary key attribute (say Empno).
    Thanks.
    Sung

  • JAXB marshaling and unmarshaling

    I used JAXB to generate nine classes (one is simply a type-safe enum) to correspond to my XML DTD. I then wrote the code to instantiate the root and some child elements which are all added to the root content. Then I am able to call validate() and marshal() on the root element and produce the desired XML. Great!
    The trouble is that I'm having difficulty using these classes to unmarshal the XML that they validated and wrote. Has anyone else seen this? In some cases, the call to unmarshal() returns the root element with no content (e.g., "<myRoot/>"). In other cases, I get an InvalidContentException on a nested element that repeats (e.g., "Expected an end tag for a "fooList" element, but found a start tag for a "foo" element").
    Has anyone else seen this? I've been through the bug parade and didn't catch this mentioned there.
    Thanks!
    Mark

    Here's the code for the problem I'm running into. Is anyone able to reproduce the problem and diagnose it? I must be doing something wrong because the Checkbook example works just fine for me. Please help!
    The obvious trouble here is that Test4.java does not correctly unmarshal the XML that it writes to temp.xml. Where have I gone wrong?
    Thanks,
    Mark
    -------- begin cut (xyz.dtd) --------
    <!ELEMENT Id ( #PCDATA ) >
    <!ELEMENT Name ( #PCDATA ) >
    <!ELEMENT Amt ( #PCDATA ) >
    <!ELEMENT Transaction ( Id, Name, Amt ) >
    <!ELEMENT Transactions ( Transaction+ ) >
    <!ATTLIST Transactions count NMTOKEN #IMPLIED >
    --------- end cut (xyz.dtd) ---------
    -------- begin cut (xyz.xjs) --------
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xml-java-binding-schema version="1.0-ea">
    <options package="xyz"/>
    <element name="Transactions" type="class" root="true">
    <attribute name="count" convert="int"/>
    <content>
    <element-ref name="Transaction"/>
    </content>
    </element>
    <element name="Name" type="value"/>
    <element name="Amt" type="value" convert="int"/>
    <element name="Id" type="value" convert="int"/>
    <element name="Transaction" type="class">
    <content>
    <element-ref name="Id"/>
    <element-ref name="Name"/>
    <element-ref name="Amt"/>
    </content>
    </element>
    </xml-java-binding-schema>
    --------- end cut (xyz.xjs) ---------
    -------- begin cut (Test4.java) --------
    import xyz.*;
    import javax.xml.bind.*;
    import javax.xml.marshal.*;
    import java.io.*;
    import java.util.Date;
    import java.util.Random;
    public class Test4 {
    private static Random rand = new Random();
    public static void main(String[] args) {
    // need file to work with...
    try {
    File f = new File( "temp.xml" );
    FileOutputStream fout =
    new FileOutputStream( f );
    // make some transactions
    int TransCt = 1;
    Transactions txns = new Transactions();
    java.util.List transactions = txns.getTransaction();
    for (int i=0; i < TransCt; i++) {
    Transaction t = makeBogus();
    transactions.add( t );
    txns.setCount( TransCt );
    txns.validate();
    txns.marshal( fout );
    fout.flush();
    fout.close();
    FileInputStream fin = new FileInputStream( f );
    Transactions t = new Transactions();
    t.unmarshal( fin );
    t.validate();
    t.marshal( System.out );
    catch (Exception e) {
    e.printStackTrace();
    private static Transaction makeBogus() {
    String[] names =
    { "Bob", "Larry", "Tom", "Ted", "Bill",
    "Gail", "Louise", "Sam", "Erin", "Wilma" };
    Transaction transaction = new Transaction();
    // calculate transaction id...
    int range = Integer.MAX_VALUE / 3 * 2;
    int Id = rand.nextInt(range);
    transaction.setId( Id );
    // pick a name
    transaction.setName( names[rand.nextInt(10)] );
    transaction.setAmt( rand.nextInt( 100 ) );
    return transaction;
    --------- end cut (Test4.java) ---------

  • JAXB: How to unmarshal from xml contains two schemas?

    Hi, all.
    My question is in subject.
    Ex.)
    schema1.xsd:
    (snip)...
    <xsd:element name="xxx">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    ...(snip)
    schema2.xsd:
    (snip)...
    <xsd:element name="yyy">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="zzz" minOccurs="1" maxOccurs="1"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="zzz" type="xsd:string"/>
    if I have a xml like the following, xml validation is correct:
    sample.xml:
    (snip)...
    <ns1:xxx xmlns:ns1="...(schema1.xsd)...">
    <ns2:yyy xmlns:ns2="...(schema2.xsd)...">
    <ns2:zzz>SAMPLE</ns2:zzz>
    </ns2:yyy>
    </ns1:xxx>
    I want to unmarshal from this xml using JAXB, but actually ths xxx didn't have any tag in List class given getAny() method, because xxx doesn't know about yyy, I think.
    These schemas cannot change as requirements of customer.
    How to unmarshal from xml contains two schemas using JAXB?
    tx.

    I solved it myself.
    JAXBContext can be specified many context path at same time.
    Ex.)
    context = JAXBContext.newInstance("package1:package2:package3...");
    So, unmarshaller can know how to choose what be instanced.
    tx.

  • Jaxb unmarshal error due to iso-8859-15 character set

    I am currently attempting to use JAXB to handle XML unmarshaling. Is there a way to set the encoding used to unMarshall a message to iso-8859-15 as the messages coming in do not have an xml header with encoding specified?

    I don't understand. If the XML messages coming in don't specify their own encoding, then their encoding must be UTF-8 or UTF-16. There's no possibility that their encoding can be ISO-8859-15. So why would you want to use ISO-8859-15 to decode them?

  • JAXB unmarshaling: defaultValue not treated correctly

    Hi,
    Our XML schema defines an int element with default:
    <xs:element name="reconnect-interval" type="xs:integer" default="3600" />
    Running JAXB compiler (xjc) on that schema results in an object-tree which
    fails to return the pre-set default value when 'reconnect-interval' is not set, as it should.
    Looking at the JAXB-generated class which contains this element shows the following:
    @XmlElement(name = "reconnect-interval", defaultValue = "3600")
    protected BigInteger reconnectInterval;
    which I take to mean that the defaultValue was indeed detected by the compiler.
    Unmarshaling code is traight forward:
    JAXBContext jc = JAXBContext.newInstance( <pkg name> );
    Unmarshaller u = jc.createUnmarshaller();;
    MyRootElem root = u.unmarshal( new FileInputStream( <xml data file>) );
    BigInteger reconnect_interval = root,getReconnectInterval();
    // reconnect_interval is null
    This is somewhat similr to
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325871
    only that bug is marked solved..
    OS: Win XP
    Ver: JAXB 2.0 (build 2.0-b26-ea3)
    Pls help me figure it out.
    Thanks,
    Gilad

  • How do I unmarshal to only a portion of generated JAXB classes?

    I have an XML schema that is laid out something like this:
    <Information>
    <Header/>
    <Item> (Unbounded)
    <Trailer/>
    </Information>
    I receive files that have thousands of items in them. Because of the size of the files, I must use SAX to parse the file.
    I need to unmarshal each file and store the results in a database after following some conditional logic. It is not practical to unmarshal a 500 MB file.
    What I have been doing is using a SAX DefaultHandler to strip out each <Item> element.
    I had to create a separate schema for just the <Item> element so that I could use JAXB's xjc to generate a set of classes to unmarshal each <Item> element to.
    This works great, but it is a hassle to maintain. You see, I also need to unmarshal the <Header> element. So I have to create a separate schema for that as well. So then I end up with two sets of JAXB classes, with lots of duplication. Plus, if I have any complex types that are referenced in both the <Header> and the <Item>, then I have to include those in each sub schema.
    What I want to know is:
    Is it possible to just generate ONE set of JAXB classes for the main schema, and then unmarshal the stripped out <Item> element to just the corresponding Item in the generated JAXB classes?
    This is a complicated topic, and I hope I've been clear. Basically, I have to create these <Header> and <Item> schemas by hand every time the main schema changes, and I want to get away from that.

    I might be misunderstanding your question, but if you control the single large schema, it would be simple to define the things that you want to treat specially as either individual elements or complexTypes inside the single schema file. Using psuedo-schema, say you have something like this now:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element name='Header'>
              <!-- your definition here -->
          </xs:element>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>You can change that to:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element ref='Header'/>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name='Header'>
      <!-- your definition here -->
    </xs:element>That should produce distinct classes for your Information and Header elements. You similary can break out the Item and Trailer elements.

  • Unmarshaling XML file with JAXB from JAR doesn't work?

    Hi
    I'm pretty new to JAXB... I'm unmarshaling an XML file, and everything works fine in my JUnit test, using XML files. However, the caller of my unmarshalling is a Web Start application using signed JARs.
    When I try to access the XML file, I log the URL and get an exception:
    INFO[slf5s.PRIORITY] javawsApplicationMain[slf5s.THREAD] ch.ige.main.client.menu.MenuBuilder[slf5s.CATEGORY] Creating menu from URL jar:file:C:/Program%20Files/JRE/1.4.2/cache/http/...Main.jar!/res/JippsAdminMenuBaum.xml[slf5s.MESSAGE]
    ERROR[slf5s.PRIORITY] javawsApplicationMain[slf5s.THREAD] ch.ige.main.client.MenuPane[slf5s.CATEGORY] exception caught[slf5s.MESSAGE]
    java.io.IOException: Couldn't unmarshal configuration from java.util.jar.JarVerifier$VerifierStream@15f1f9c: null
         at ch.ige.main.client.menu.MenuBuilder.unmarshalConfiguration(MenuBuilder.java:110)
         at ch.ige.main.client.menu.MenuBuilder.<init>(MenuBuilder.java:86)
         at ch.ige.main.client.MenuPane.createMenuBuilder(MenuPane.java:485)
         at ch.ige.main.client.MenuPane.createTreeLevel(MenuPane.java:460)
         at ch.ige.main.client.MenuPane.jbInit(MenuPane.java:316)
         at ch.ige.main.client.MenuPane.<init>(MenuPane.java:122)
         at ch.ige.jippsadmin.MepJipps.<init>(MepJipps.java:32)
         at ch.ige.jippsadmin.JippsMain.run(JippsMain.java:64)
         at ch.ige.auth.ClientAuthenticator.executePrivilegedCode(ClientAuthenticator.java:166)
         at ch.ige.authz.client.AuthMain.executePrivilegedCode(AuthMain.java:128)
         at ch.ige.authz.client.AuthMain.run(AuthMain.java:213)
         at ch.ige.jippsadmin.JippsMain.main(JippsMain.java:77)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)Btw, does anyone know where to find the runtime JARs that are required for JAXB (from JWSDP 1.5)?
    Thanks & best regards,
    Eric

    Well... once again this was a ClassLoader problem... solved!

  • Toplink-JAXB Unmarshal problem :SAXPlatform  createPlatformDefaultSequence

    Hi All,
    I'm trying to import some classes (generated by JAXB out of an XSD) into Toplink-Relational project and unmarshal the XML contents. But I get the following exception.
    07/01/22 13:13:18 javax.xml.bind.JAXBException: Provider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated: Exception [TOPLINK-7147] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.ValidationException
    Exception [TOPLINK-7147] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.ValidationException
    Exception Description: Platform SAXPlatform cannot create platform default sequence - it doesn't override createPlatformDefaultSequence method
         at oracle.toplink.exceptions.ValidationException.createPlatformDefaultSequenceUndefined(ValidationException.java:1515)
         at oracle.toplink.internal.databaseaccess.DatasourcePlatform.createPlatformDefaultSequence(DatasourcePlatform.java:540)
         at oracle.toplink.internal.databaseaccess.DatasourcePlatform.getDefaultSequence(DatasourcePlatform.java:479)
         at oracle.toplink.internal.sequencing.SequencingManager.getDefaultSequence(SequencingManager.java:917)
         at oracle.toplink.internal.sequencing.SequencingManager.onConnectAllSequences(SequencingManager.java:713)
         at oracle.toplink.internal.sequencing.SequencingManager.onConnect(SequencingManager.java:602)
         at oracle.toplink.publicinterface.DatabaseSession.initializeSequencing(DatabaseSession.java:115)
         at oracle.toplink.publicinterface.DatabaseSession.initializeDescriptors(DatabaseSession.java:341)
         at oracle.toplink.publicinterface.DatabaseSession.initializeDescriptors(DatabaseSession.java:330)
         at oracle.toplink.publicinterface.DatabaseSession.login(DatabaseSession.java:512)
         at oracle.toplink.ox.XMLContext.buildSession(XMLContext.java:120)
         at oracle.toplink.ox.XMLContext.<init>(XMLContext.java:73)
         at oracle.toplink.ox.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:9)
         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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:96)
         at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:229)
         at javax.xml.bind.ContextFinder.find(ContextFinder.java:149)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
         at oracle.epcis.services.queryservice.executor.ScheduledQueryExecutor.parseXML(ScheduledQueryExecutor.java:111)
         at oracle.epcis.services.queryservice.EPCISServicePortTypeImpl.subscribe(EPCISServicePortTypeImpl.java:36)
         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 oracle.j2ee.ws.server.ImplInvocationHandler.invoke(ImplInvocationHandler.java:126)
         at $Proxy1.subscribe(Unknown Source)
         at oracle.epcis.services.queryservice.runtime.EPCISServiceBinding_Tie.invoke_subscribe(EPCISServiceBinding_Tie.java:450)
         at oracle.epcis.services.queryservice.runtime.EPCISServiceBinding_Tie.processingHook(EPCISServiceBinding_Tie.java:952)
         at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:287)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:356)
         at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:283)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doRequestProcessing(JAXRPCProcessor.java:272)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:94)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doService(JAXRPCProcessor.java:128)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:170)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    07/01/22 13:13:18 --------------- linked to ------------------
    Can anyone please let me know the solution for this..?
    Thanks
    Rajasekaran

    Adding some more information for the same problem.....
    I tried to add the sequence like this.. But It doesnt helps..
    DatasourceLogin login = (DatasourceLogin)session.getDatasourceLogin();
    TableSequence seq = new TableSequence();
    seq.setName("OBJECT_EVENT_SEQ");
    seq.setTableName("OBJECTEVENT");
    seq.setNameFieldName("GUID");
    seq.setCounterFieldName("GUID");
    login.setDefaultSequence(seq);
    Can any one please throw some light into this problem ASAP..?
    Thanks
    Rajasekaran

  • Jaxb unmarshal/marshal with accentuate characters

    Is it an option to set to manage accentuate characters with unmarshal/marshal methods in jaxb interface.
    We are getting the content of your xml document but the accentuate character appear coded and after we marshal an updated content with normal accentuate character we are no more able to parse the document again.

    We are using utf-8 encoding.
    Here is the xml document header :
    <?xml version="1.0" encoding="UTF-8"?>
    <classification schema-version="alpha 1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:/DOCUME~1/micwic/Bureau/ofs_xml_repository/xmlSchema/classification.xsd">
    Here is a part of our document content :
                             <classification-entry-title>
                                  <classification-entry-main-title language="fr">autres infections intestinales bactériennes</classification-entry-main-title>
                                  <classification-entry-main-title language="en">Other bacterial intestinal infections</classification-entry-main-title>
                                  <classification-entry-main-title language="de">Sonstige bakterielle Darminfektionen</classification-entry-main-title>
                             </classification-entry-title>
                             <classification-entry-external-reference>
                                  <classification-entry-external-reference-system>CIM 10 Access database</classification-entry-external-reference-system>
                                  <classification-entry-external-reference-key>26</classification-entry-external-reference-key>
                                  <classification-data-entry-external-reference-import-date>2006-10-19</classification-data-entry-external-reference-import-date>
                             </classification-entry-external-reference>
                        </classification-entry>
                        <classification-entry>
                             <classification-entry-identification>8</classification-entry-identification>
                             <classification-entry-code>A05</classification-entry-code>
                             <classification-entry-code-fullPath>(A00-B99).(A00-A09).A05</classification-entry-code-fullPath>
                             <classification-entry-category-code>Code level 1</classification-entry-category-code>
                             <classification-entry-status>enable</classification-entry-status>
                             <classification-entry-title>
                                  <classification-entry-main-title language="fr">autres intoxications bactériennes d&apos;origine alimentaire</classification-entry-main-title>
                                  <classification-entry-main-title language="en">Other bacterial foodborne intoxications</classification-entry-main-title>
                                  <classification-entry-main-title language="de">Sonstige bakteriell bedingte Lebensmittelvergiftungen</classification-entry-main-title>
                             </classification-entry-title>
    Thanks for help

  • How to unmarshal non-root JAXB class

    How to unmarshal non-root JAXB class? I used work around to marshal an object without *@XmlRootElement*:
    marshaller.marshal( new JAXBElement(
      new QName("uri","local"), MessageType.class, messageType ));Now I need to unmarshal this object.

    what happened when you tried it?

  • JAXB and Complex Schemas  unmarshal error

    I have a complex schema that references several sub schema's as part of a domain model. When I unmarshal the xml document I get the top level elements and data, but nothing underneath the referenced schemas. I compiled with xjc and it created all of the class files for the sub schemas. Question: Does JAXB not load the sub schemas? Do I have to create unmarshal events for each sub schema to reference the data ?
    Thanks

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSpy v2010 rel. 2 (http://www.altova.com) by Regence Employee (THE REGENCE GROUP) -->
    <EnrollmentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="F:\data\Workspaces\enrollmentPOC\data\EnrollmentRequest.xsd">
         <Enrollments>
              <EnrollmentType>NewEnrollment</EnrollmentType>
              <SourceName>USRINPUT</SourceName>
              <GroupIdentifier>
                   <GroupId>60004854</GroupId>
                   <SubGroupID>0001</SubGroupID>
              </GroupIdentifier>
              <EnrollmentPolicy>
                   <HoursPerWeekWorked>40</HoursPerWeekWorked>
                   <Enrollment>
                        <Event>
                             <EventType>NEW</EventType>
                             <EventDate>05/15/2009</EventDate>
                             <EventEffectiveDate>06/10/2009</EventEffectiveDate>
                             <EventTerminationDate/>
                             <BreakInCoverage/>
                             <QualifyingEvent/>
                             <Description/>
                             <Reason/>
                        </Event>
                        <Cobra>
                             <CobraType/>
                             <QualifyingEvent/>
                             <CobraEffectiveDate/>
                             <CertificateLength/>
                             <CobraTerminationDate/>
                        </Cobra>
                        <Person>
                             <Name>
                                  <FirstName>TEST</FirstName>
                                  <LastName>ENROLLMENT</LastName>
                                  <MiddleName/>
                                  <NameSuffix/>
                             </Name>
                             <DateOfBirth>05/05/1976</DateOfBirth>
                             <Gender>Male</Gender>
                             <MaritalStatus>Single</MaritalStatus>
                             <Language>ENGL</Language>
                             <PersonIdentifier>
                                  <PersonId>555555555</PersonId>
                                  <PersonIdentifierType>SocialSecurityNumber</PersonIdentifierType>
                             </PersonIdentifier>
                             <PersonIdentifier>
                                  <PersonId>55555567345</PersonId>
                                  <PersonIdentifierType>MedicareId</PersonIdentifierType>
                             </PersonIdentifier>
                             <PriorCoverage>
                                  <CarrierName>Kaiser</CarrierName>
                                  <PolicyHolderID>345545</PolicyHolderID>
                                  <EffectiveDate>01/01/2009</EffectiveDate>
                                  <TerminationDate>01/31/2009</TerminationDate>
                                  <PolicyHolderName>Medical</PolicyHolderName>
                             </PriorCoverage>
                             <PriorCoverage>
                                  <CarrierName>Providence</CarrierName>
                                  <PolicyHolderID>23474</PolicyHolderID>
                                  <EffectiveDate>02/01/2009</EffectiveDate>
                                  <TerminationDate>03/31/2009</TerminationDate>
                                  <PolicyHolderName>Medical</PolicyHolderName>
                             </PriorCoverage>
                             <ContactInformation>
                                  <AddressDetails>
                                       <ContactType>Home</ContactType>
                                       <Address>
                                            <AliasName>ADDR1</AliasName>
                                            <AddressLine1>56 Test Street</AddressLine1>
                                            <AddressLine2/>
                                            <City>Portland</City>
                                            <County>Multnomah</County>
                                            <State>OR</State>
                                            <ZipCode>97203</ZipCode>
                                            <Country>US</Country>
                                       </Address>
                                  </AddressDetails>
                                  <AddressDetails>
                                       <ContactType>Mailing</ContactType>
                                       <Address>
                                            <AliasName>ADDR1</AliasName>
                                            <AddressLine1>89 Mailing Street</AddressLine1>
                                            <AddressLine2/>
                                            <City>Portland</City>
                                            <County>Multnomah</County>
                                            <State>OR</State>
                                            <ZipCode>97203</ZipCode>
                                            <Country>US</Country>
                                       </Address>
                                  </AddressDetails>
                                  <PhoneNumber>
                                       <ContactType>Home</ContactType>
                                       <PhoneNumber>665-567-8888</PhoneNumber>
                                  </PhoneNumber>
                                  <EMailAddress>
                                       <EmailAddress>[email protected]</EmailAddress>
                                  </EMailAddress>
                             </ContactInformation>
                             <Membership>
                                  <MembershipIdentifier>
                                       <MemberID/>
                                       <MemberIdentifierType>CPSS_SBSB_ID</MemberIdentifierType>
                                  </MembershipIdentifier>
                                  <RelationshipToSubscriber>Subscriber</RelationshipToSubscriber>
                                  <MemberIndex>0</MemberIndex>
                                  <InsuranceIDCard>
                                       <IDLevel>FAMILY</IDLevel>
                                       <IDBackground>100</IDBackground>
                                  </InsuranceIDCard>
                                  <Eligibility>
                                       <Coverage>
                                            <ClassId>0001</ClassId>
                                            <Product>
                                                 <ProductId>MINN1001</ProductId>
                                                 <BusinessCategory>M</BusinessCategory>
                                            </Product>
                                            <Product>
                                                 <ProductId>RX000001</ProductId>
                                                 <BusinessCategory>R</BusinessCategory>
                                            </Product>
                                       </Coverage>
                                  </Eligibility>
                                  <Preference>
                                       <PreferenceType>EEOB</PreferenceType>
                                       <Detail>
                                            <DetailType>EMAIL</DetailType>
                                            <DetailValue>[email protected]</DetailValue>
                                       </Detail>
                                  </Preference>
                             </Membership>
                             <Medicare>
                                  <Entitlement>Blah</Entitlement>
                                  <EntitlementStartDate>01/01/2008</EntitlementStartDate>
                                  <EntitlementEndDate/>
                                  <MedicareProgram>
                                       <MedicareProgramType>TypeA</MedicareProgramType>
                                       <EffectiveDate>01/01/2008</EffectiveDate>
                                       <TerminationDate/>
                                  </MedicareProgram>
                                  <MedicareProgram>
                                       <MedicareProgramType>TypeB</MedicareProgramType>
                                       <EffectiveDate>01/01/2008</EffectiveDate>
                                       <TerminationDate/>
                                  </MedicareProgram>
                             </Medicare>
                             <Disability>
                                  <IsDisabled>false</IsDisabled>
                                  <DisabledDate/>
                                  <Description/>
                                  <VerifiedBy/>
                                  <VerifiedDate/>
                                  <VerificationMethod>EMAIL</VerificationMethod>
                             </Disability>
                        </Person>
                   </Enrollment>
              </EnrollmentPolicy>
         </Enrollments>
    </EnrollmentRequest>

  • Problem in Marshaling UnMarshaling with @XmlAnyElement using JAXB

    Hi all,
    I am having a class annotated with XML binding annotations. I am using this class to marshal and unmarshal XML content.
    I am having one class named Data. This class is field of some other class.
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "any"
    @XmlRootElement(name = "Data")
    public class Data {
        @XmlAnyElement
        protected Element any;
        public Element getAny() {
            return any;
        public void setAny(Element value) {
            this.any = value;
    Data class is having one element named any. any holds any kind of XML Content.
    Now when I Unmarshal XML content to java class displayed above it works fine.
    But when Marshaling java class to XML it adds some unwanted namespaces and prefixes to content in any element in Data class.
    I am using javax.xml.bind.JAXBContext class for getting javax.xml.bind.Marshaller and javax.xml.bind.Unmarshaller.
    Here are the XML Data:
    Original:
    <bh:BookRequest xmlns:bh="http://www.mybookstore.com">
         <bh:Data>
              <Books xmlns="http://www.anynamespace.com">
                   <Book>
                        <Name>Any Java Book1</Name>
                        <Price>$5.0</Price>
                        <Publication>Any Publication</Publication>
                   </Book>
                   <Book>
                        <Name>Any Java Book2</Name>
                        <Price>$7.0</Price>
                        <Publication>Any Publication2</Publication>
                   </Book>
                   <Book>
                        <Name>Any Java Book3</Name>
                        <Price>$6.5</Price>
                        <Publication>Any Publication3</Publication>
                   </Book>
              </Books>
         </bh:Data>
    </bh:BookRequest>After Marshaling and Unmarshaling:
    <bh:BookRequest xmlns:bh="http://www.mybookstore.com">
         <bh:Data>
              <Books:Books xmlns:Books="http://www.mybookstore.com" xmlns="http://www.anynamespace.com">
                   <Book>
                        <Name>Any Java Book1</Name>
                        <Price>$5.0</Price>
                        <Publication>Any Publication</Publication>
                   </Book>
                   <Book>
                        <Name>Any Java Book2</Name>
                        <Price>$7.0</Price>
                        <Publication>Any Publication2</Publication>
                   </Book>
                   <Book>
                        <Name>Any Java Book3</Name>
                        <Price>$6.5</Price>
                        <Publication>Any Publication3</Publication>
                   </Book>
              </Books:Books>
         </bh:Data>
    </bh:BookRequest>Notice the <Books> element in both XML above.
    First one is the actual content. Second one is the Marshalled XML with addtional Namespace and prefixes.
    I don't want this behaviour. *I want Marshaling and UnMarshaling not to touch Content in any element of Data Class.I want that content as it is.* Is there any way to do so?
    Any comment for this will help me.
    thanks in adavnce,
    TYPurohit.

    What exactly the message mean: Use the "-extension" switch.
    My work around is to remove the abstract="true" from abstract element. Is there a better way?
    thanks.

  • Unmarshal SOAP response, as raw XML String with JAXB

    Hi,
    I have a soap response, as raw xml (a java.lang.String), and I want to unmarshal it's content into the classes generated by wsimport.
    This must be a simple task but I couldn't find a way to do it.
    Can someone tell me how I can achieve this ?
    Edited by: Raphael_Lemaire on May 25, 2010 8:30 AM

    Raphael_Lemaire wrote:
    Yes it works this way.
    I kind of hoped that i could use a jax-ws api to shorten the code.well, how exactly do you get that string full of xml? (as a side note, you need to be careful turning xml into strings, the data can easily broken if you don't translate the bytes into characters correctly). if you use the jaxws api to make soap calls, then you don't really need to deal with the xml at all.
    Edited by: jtahlborn on May 26, 2010 7:38 AM

Maybe you are looking for