Generating and compiling jaxb 1.0 source with jaxb 2.0 binaries

Hi
Does anyone know if v 2.13 is backwards compatible in terms of generating the source files for version 1 and also compiling and deploying the code?
I am developing a project that needs to use jaxb 1.0 and jaxb 2.0 for legacy reasons. I have downloaded 2.1.3 an managed to use xjc to generate the new code (2.1) but when I try and generate the 1.0 classes I get this error
Couldn't load Resource 1.0/com/sun/xml/bind/JAXBAssertionError.class
java.lang.NoClassDefFoundError: com/sun/xml/bind/JAXBAssertionError
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultEx
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NoClassDefFoundError: com/sun/xml/bind/JAXBAssertionError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.tools.xjc.Options.class$(Options.java:154)
at com.sun.tools.xjc.Options.findServices(Options.java:482)
at com.sun.tools.xjc.Options.<clinit>(Options.java:154)
at com.sun.tools.xjc.XJCTask.<init>(XJCTask.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:49)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
And this is the ant build file
<?xml version="1.0" encoding="windows-1252"?>
<project name="jaxb" default="compile" basedir=".">
<path id="classpath">
<pathelement location="activation.jar"/>
<pathelement location="jaxb-api.jar"/>
<pathelement location="jaxb-impl.jar"/>
<pathelement location="jaxb1-impl.jar"/>
<pathelement location="jaxb-xjc.jar"/>
<pathelement location="jsr173_1.0_api.jar"/>
</path>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath refid="classpath"/>
</taskdef>
<target name="compile">
<xjc schema="import.xsd" destdir="generated"
package=".jaxb.importxsd" source="1.0" target="1.0" />
</target>
</project>
I have checked the classpath and there is nothing untoward there and
all the jars are in the same folder as the ant file. I thought jaxb
2.1 is meant to be backwards compatible?
Many thanks for your help.
With the version of the JAXB binaries installed with the web services pack I get this error message instead
Class com.sun.tools.xjc.XJCTask$AntElement loaded from ant loader (parentFirst)
ResourceStream for 1.0/com/sun/tools/xjc/XJCTask$AngProgressCodeWriter.class loaded from ant loader
BUILD FAILED
java.lang.IncompatibleClassChangeError: Implementing class
It seems to want to load the 1.0/com...version of xjc but has loaded the 2.0 version already.

Hi,
Can you please check your classpath incase there are still jaxb-ea jars in it.
We have had such problems reported to us because of this reason.
If the problem still persists can you pls provide more information like the stack trace the schema files etc.
Thanks,
Bhakti Mehta
Sun Microsystems Inc.

Similar Messages

  • CBS generating and compiling on 7.31 for 7.0 track

    Hi  NWDI experts
    My NWDI is based on 7.0 hosts both JDK1.4 and 1.6 for 7.0 and 7.3 tracks respectively.
    But the CBS is generating and building 7.31 code and giving errors for a 7.0 track.
    The Build Variant , CBS Visual Admin settings for both JDKs and Track Dependencies are looking fine. But I am not sure why CBS is generating 7.31 code and giving compile time issues for the track DCs.. may I know how can we fix these issues?
    When I check the build log in CBS , it seems it is using WD Plugin version 7.30 SP1 to generate the source code for WD project and giving compile time issues.
    Build Plugin 'WebdynproPlugin', Version 7.30 SP 1 (NW731CORE_01_REL, built on 2011-09-17 17:11:55 +0200, CL155733)

    Hi Ervin,
    I checked the track's dependencies in Development and Consolidation tabs, I found that one of our team imported a Dependency (EP_BUILDT/) with 7.31 for this 7.0 track and I am thinking thats why all the DCs are failing to build.
    The track was working fine 3 months back and this 7.31 dependency (EP_BUILDT/)was imported in March.
    Could you please let me know , how can I delete this 7.31 dependency (EP_BUILDT/)?
    I am trying to import 7.0 version of the same, but it is giving error that already the higher version is imported.
    Component (Vendor/Name/Location/Counter sap.com/EP_BUILDT/SAP AG/20090815234300) specified in the file (/usr/sap/xxx/CMS/inbox/EPBUILDT20_0-10003786.SCA) has already been imported into the system (Domain/Name xx/xxxxx_D) in a higher version.

  • Can't generate setters for array or collection classes with JAXB

    I am trying to use JAXB to generate the required setters for Spring beans. Although according to the book Java & XML Data Binding
    Chapter 3 page 42 by Brett McLaughlin it was possible with DTD's using
    <?xml version="1.0"?>
    <xml-java-binding-schema version="1.0-ea">
    <options package="javajaxb.generated.movies" default-reference-collection-type="array" />
    <element name="movies" type="class" root="true"/>
    </xml-java-binding-schema>
    to generate an array as in
    public Movie[] getMovie( ) {
    // implementation
    public void setMovie(Movie[] _Movie) {
    it doesn't look like that capability exists with JAXB 2.0 and XML Schemas. In their wisdom they just generate getters on Lists and tell you:
    <p>
    * This accessor method returns a reference to the live list,
    * not a snapshot. Therefore any modification you make to the
    * returned list will be present inside the JAXB object.
    * This is why there is not a <CODE>set</CODE> method for the filingForm property.
    * <p>
    * For example, to add a new item, do as follows:
    * <pre>
    * getFilingForm().add(newItem);
    * </pre>
    Of course this doesn't work for Spring injection where setters are needed.
    Does anyone know different or is there a way of getting around this ?
    I've tried constructor injection in Spring but it's not as convenient and involves extensive coding of generated code (not nice).
    Edited by: user3806112 on Mar 15, 2011 11:13 AM

    Oh I found it on this post
    http://cxf.547215.n5.nabble.com/NPE-in-generated-setter-method-when-collectionType-quot-indexed-quot-and-a-null-array-is-used-td3323012.html
    collectionType="indexed" in the globalBindings-tag
    it works in schema internal global bindings as well
    <jaxb:globalBindings collectionType="indexed" >

  • How to generate and output 3 TTL square waveforms with different pulse widths using counters of NI 6034E

    Hello
    I just have a few questions.
     I am using the NI 6034E DAQ board in order to
    generate simultaneouly 3 different TTL digital signals, with different
    pulse width, and output these TTL signals to an external circuit that I
    am using for this application.
    The following pattern of the TTL pulses will look like this:
    01010101 01010101
    00110011 00110011
    00001111 00001111
    From
    what I understand,  I have to use the 2 counters, Ctr0 and Ctr1, to
    generate the TTL pulses that I desire, because the DIO lines are
    software timed only and I will not be able to produce a deterministic
    output period using these DIO lines.  Am I correct?    Also, do I have
    to use a separate counter to generate a separate TTL digital pulse.  I
    need 3 different TTL pulses and there are only 2 counters for this DAQ
    device.  The three generated TTL signals will be feed to an external
    circuit.  Concerning the hardware connections for my application, I
    assume that the generated TTL signals will be output from
    GPCTR0_OUT(pin 2)  for counter 0 and GPCTR1_OUT(pin 40) for counter 1
    of the NI 6034E. Is this correct?  Is there any way that these TTL
    signals can be output from three DIO lines(DIO0...2). 
    Here is some code that I plan to use in order to do this:
     #include <NIDAQmx.h>
    static TaskHandle gTaskHandle = 0;
    DAQmxCreateTask ("", &gTaskHandle);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "Dev1/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 1.0, 2.0, 2.0);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "Dev1/ctr1", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 3.0, 4.0, 4.0);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "?????", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 7.0, 8.0, 8.0);
    DAQmxCfgImplicitTiming (gTaskHandle, DAQmx_Val_FiniteSamps, 5);
    DAQmxStartTask (gTaskHandle);
    DAQmxWaitUntilTaskDone(gTaskHandle)
    DAQmxErrChk DAQmxStopTask(gTaskHandle)
    DAQmxErrChk DAQmxClearTask(gTaskHandle)
    I believe this code should generate the 3 TTL square waveforms that I want for my application.
    Please provide me with some feedback.  It would greatly be appreciated.
    Thank You

     Hi,
    The NI 6034E is a multifuntion DAQ device, this means you have:
      (2) counters
      (8) DIO lines (software timed)
      (16) AI, single ended
      (0) Analog Output
     You have a couple choices here:
       1. Software timed digital output of all three signals, max 1khz loop rate, non-deterministic.
       2. Hardware timed digital output of 2 signals, max 20Mhz.
       3. Hardware timed digital output of 2 signals and software timed digital output of 1 signal.
       4. Find another NI MIO board such as the NI 6251. This board will do 10Mhz pattern generation for (8) DIO lines.
    For the hardware connection, you are correct, the output for the counters will be taken from pin 2 & pin 40.  Here's the pinout for the NI 6034E for reference:
    The output of the Counters can be routed to some of the PFI's or to the RTSI connector. You can see this in MAX
    Message Edited by Matthew W on 11-19-2007 01:24 PM
    Attachments:
    2007-11-19_131609.jpg ‏61 KB
    2007-11-19_132435.jpg ‏86 KB

  • Generate and Compile new classes during runtime

    Hi!
    I use the Parser-Generator JavaCC to build a parser from a BNF-Grammar.
    During runtime, the user shall be able to change the
    grammar, so the Parser-Generator will build new .java-Files for the new Parser.
    Does anyone know any Java-Generic-Methods to use .java-Files in a program? Or do they have to be compiled with javac?
    Or does perhaps anyone know a Parser reading a BNF-Grammar-File and parsing according to this grammar?
    Thanks a lot for possible Help, Henning.

    Here is a link to a useful program with source code that uses javac. It creates a window and allows you to type in java source code and execute. I use it to test small java functions that I'm not very familiar with.
    http://www.javaworld.com/javatips/jw-javatip131.html?#

  • Error while generating an XML Document from XML Schema with JAXB

    Hi,
    I am following this OTN tutorial to generate the XML document from Java classes got from the XSD document.
    http://www.oracle.com/technology/pub/notes/technote_jaxb.html
    I am able to generate all the Java classes but getting error on compiling the XMLConstructor.java class which is use for generating the XML document :
    I am using JDK 1.5 and
    Oracle 10g XML Developer's Kit (XDK) Production for Java. xdk_nt_10_1_0_2_0_production
    (though these are warnings I am not able to run it.)
    Error
    C:\Prototype\classes\jaxbderived\catalog>javac -Xlint XMLConstructor.java
    warning: [path] bad path element "%CLASSPATH%": no such file or directory
    XMLConstructor.java:42: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    journalList.add(journal);
    ^
    XMLConstructor.java:46: warning: [unchecked] unchecked call to add(E) as a membe
    r of the raw type java.util.List
    articleList.add(article);
    Thanks
    Sanjeev ([email protected])

    Use JDK 1.4.

  • Elvis: Is It possible to use the Function Generator and the Oscilloscope simultaneously?

    Hi,
     We are using the NI Elvis to output a function or a sine wave at a certain frequency and using the oscilloscope on the same board/elvis to read a modified signal. Is this possible? Can we use both the Function Generator and the oscilloscope at the same time? Please help. The oscilloscope would be reading signal from an accelerometer. Thank you in advance. We have no VI as we do not know which to use and if they are possible.

    Hi,
    There is no problem using the Function Generator and Oscilloscope
    at the same time with NI ELVIS. Using the NI ELVIS soft front panels (Start
    >> Programs >> National Instruments >> NI ELVIS 3.0 >>
    NI ELVIS – see picture attached –‘NI ELVIS soft front panels.JPG’), you can choose
    to open more than one instrument at a time. We do this by opening one
    instrument, allowing it to begin, and then opening another. We can also program
    in LabVIEW using more than one instrument at a time by placing down multiple
    Express VI’s taken from the NI ELVIS pallet on the block diagram (see picture
    attached – ‘ELVIS Express VI's (LabVIEW).JPG’). One note when doing this,
    please see KB 41ODPHX1 
    for an example of how to program in parallel. If you do not wire the ‘stop’
    terminal of the express VI’s, you will get the error described.
    David L.
    Systems Engineering
    National Instruments
    Attachments:
    ELVIS Express VI's (LabVIEW).JPG ‏74 KB
    NI ELVIS soft front panels.JPG ‏56 KB

  • [svn:osmf:] 15867: asdocs: Update to accomodate generating OSMF for Flex 4. 0 asdocs from OSMF 1.0 source with as few changes as possible.

    Revision: 15867
    Revision: 15867
    Author:   [email protected]
    Date:     2010-05-02 19:36:51 -0700 (Sun, 02 May 2010)
    Log Message:
    asdocs: Update to accomodate generating OSMF for Flex 4.0 asdocs from OSMF 1.0 source with as few changes as possible.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/display/ScaleMode.as

    bringrags wrote:
    We do indeed recommend replacing the osmf.swc from a Flex 4 project if you're going to use OSMF in Flex 4, but you may (will?) run into issues if you attempt to use Flex's VideoPlayer within that project.  Note also that you'll need to replace osmf.swc for each individual project (or edit your flex-config.xml file to point to the updated SWC).
    In terms of future plans, we are working closely with the Flex team to ensure that their next release ships with the latest OSMF version.  No ETA on that though.
    I have followed the recommendations and removed the old version of swc and replaced it with the release version. And so far the video and audio players work fine without errors.
    But looking at the flex-config.xml I see that it still points to the old version.
    <!-- OSMF SWC -->
        <runtime-shared-library-path>
    <path-element>libs/osmf.swc</path-element>
    <rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.0.0.14159/osmf_flex.4.0.0.13495.swz</rsl-url>
    <policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
    <rsl-url>osmf_flex.4.0.0.13495.swz</rsl-url>
    <policy-file-url></policy-file-url>
    </runtime-shared-library-path>
    Could you elaborate a little bit more on editing this part of flex-config.xml?
    Thanks,
    FTQuest

  • XML (un)marshalling with JAXB and "any" blocks

    I have 2 very simple XSD schema's.
    SchemaA.xsd:
    [request]-------[element_A] is xs:string
    |__(ANY)
    SchemaB.xsd:
    [body]--------[element_B] is xs:string
    The any block says that there can follow any type of xml after the element_a.
    In the xsd it is coded as: <xs:any />
    I compiled both schema's with jaxb, using this command line:
    xjc SchemaA.xsd -p test.request
    xjc SchemaB.xsd -p test.body -use-runtime test.request.impl.runtime
    I created the following code :
    test.request.ObjectFactory of1 = new test.request.ObjectFactory();
    test.body.ObjectFactory of2 = new test.body.ObjectFactory();
    Request r = of1.createRequest();
    r.setElementA("testing, element one");
    Body b = of2.createBody();
    b.setElementB("testing, element two");
    r.setAny(b);
    Marshaller m = of1.createMarshaller();
    m.marshal(r,System.out);
    And the result is what I expected:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <request><element_a>testing, element one</element_a><body><element_b>testing, element two</element_b></body></request>
    JAXB added the xml from the second schema to the first.
    Ok, so far so good. Now I'm trying to do it the other way around, I want to unmarshall that XML to objects again:
    String xml <- contains the outputted xml from the marshall (as pasted a few lines above)
    Unmarshaller um = of1.createUnmarshaller();
    Request r2 = (Request)um.unmarshal(new ByteArrayInputStream(xml.getBytes()));
    System.err.println(r2.getElementA());
    System.err.println(r2.getAny());
    The output:
    testing, element one
    null
    now, the first message is good. The second is not however...why is the "getAny" null ? I can't figure this one out. In the best possible case it should return an object that can be cast to "Body" .
    In the worst case it should just return the "<Body> ...." xml as string. But not null ...
    Any help on this is appreciated !

    JAXB does not support xs:any

  • [svn:fx-trunk] 11488: Resubmitting binary distribution of xercesPatch. jar from the third party module in the SDK and compiled it with Sun JDK 1.4 .2_12.

    Revision: 11488
    Author:   [email protected]
    Date:     2009-11-05 17:10:10 -0800 (Thu, 05 Nov 2009)
    Log Message:
    Resubmitting binary distribution of xercesPatch.jar from the third party module in the SDK and compiled it with Sun JDK 1.4.2_12.
    QE notes: N/A
    Doc notes: N/A
    Bugs:
    SDK-16818 - Must open-source the code for xercesPatch.jar.
    Reviewer: Discussed with Gordon
    Tests run: Checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-16818
    Modified Paths:
        flex/sdk/trunk/lib/xercesPatch.jar
        flex/sdk/trunk/modules/thirdparty/xerces-patch/build.xml

    Did you try this:
    http://forum.java.sun.com/thread.jsp?thread=434718&forum=60&message=1964421

  • Problems generating classes with JAXB

    Does anyone know where there might be a list of known problems with generating classes from an xsd with JAXB? I have a very deep and pretty complicated xsd, and it seems some elements get generated correctly and some don't. It's very hard to find any pattern of why. Is there a limit to the number of levels deep it will go?

    Try here as well
    https://jaxb.dev.java.net/

  • I need to count intermitte​nt high speed pulses from an outside source with cFP-CTR-50​2 and labview.

    I need to count intermittent high speed pulses from an outside source with cFP-CTR-502 and Labview 8.2 . I've found example code for generating pulses and creating intricate count setups but no straightforward examples of a simple counter. Any suggestions?

    Hello tinfish,
    I could not find a simple example that implements simple counting either, but it should be straightforward enough for us to try. Do you have the CTR module configured properly in MAX? If so, can you monitor the channels on your CTR 502 for input? Try connecting a square wave or some other digital pulse to the terminal to test the functionality of the counter module first (before programming). If you monitor the input channels with somethign connected you should see the count increment each time it sees a rising edge (assuming default configuration).
    Once you've verified that everything works in MAX, you can set up your CTR module in a LV 8.2 project. If you need help with this, refer to the help document (look in the "Configuring FieldPoint in LabVIEW" section):
    C:\Program Files\National Instruments\FieldPoint\documentation\Online Help\fplv.chm
    You should be able to just read a channel tag from your CTR 502 using an FP Read VI. (Simply drag the channel from your project onto the block diagram). Since counting is the default behavior of the 502, there is no special programming involved to make it work.
    I hope this helps -- if it's too high-level we can talk details about specific questions you have.  Have a good one!
    Charlie S.
    Visit ni.com/gettingstarted for step-by-step help in setting up your system

  • Automatically "Code Check" and "Compile/Generate" program or function

    Hello Experts;
    We will do upgrade to ECC 6.0 at near time.
    Our basis team will give us sendbox systems.
    And then We will enter the all z or y programs and check "Unicode Checks active".
    I want to do automatically "Code Check" and "Compile/Generate" with program.
    But I don't know "which use function or program"
    Please help me this point.
    Thanks.
    Best regards.

    HIi,
    Try Tcode : SGEN
    or
    try this link
    mass compile customer programs
    Regards
    Rajashiva.R

  • Have published iweb site for five years with no problems and just opened a new site and get - 404: Page not found  This error is generated when there was no web page with the name you specified at the web site.-is the problem with iweb or with hosting?  T

    I am sorry if thie is republished-My first time doing this and I am not sure what goes where and where to hear feedback.
    Have published iweb site for five years with no problems and just opened a new site and get -
    404: Page not found 
    This error is generated when there was no web page with the name you specified at the web site.-
    Troubleshooting suggestions:
    Ensure the page you are linking to exists in the correct folder.
    Check your file name for case sensitivity . Index.htm is not the same as index.htm!
    Temporarily disable any rewrite rules by renaming your .htaccess file if it exists
    is the problem with
    iweb or with hosting?
    One Apple tech started to fix Iweb and had to end session and the next said problem with hosting at Network Solutions as it published
    to local folder. NWS has checked sttting a few times-
    Any help would be extremely appreciated as trying to fix this for about five weeks
    Thanks VG
    <Email Edited by Host>

    It's a really bad idea to post your email address - it's an invitation to spam - and I've asked the Hosts to remove it. (Even though I've now noticed you mis-spelled it! - anyway, never post your address in a forum.)
    You have a site here: http://virginiagordon.com/www.virginiagordon.com/WELCOME.html
    If that's not the page you are having trouble with, what is that page's URL?

  • How To Generate And Print Reports In PDF Format From EBS With The UTF8 Char

    Hi,
    I want to know How To Generate And Print Reports In PDF Format From EBS With The UTF8 Character Set in R12.0.4.
    Regards

    Refer to Note: 239196.1 - PASTA 3.0 Release Information
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=239196.1
    Or, you can use XML Publisher.
    Note: 551591.1 - Need Latest XML Publisher / BI Publisher Patches For R12
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=551591.1

Maybe you are looking for

  • Your computer restarted because of a problem

    Hi there, my 15 inch mid 2010 macbook pro has a nasty habit of restarting at random times (typing a word document or playing a game) and starts with the dreaded "your computer restarted because of a problem". I can't really make sense of the error re

  • How to get a LabVIEW class object to expose an invoke-node method?

    Hi,       I like the property/invoke-node "paradigm" used for interacting with "objects".  Can LabVIEW-class objects expose their properties and methods this way?  Can one or more LabVIEW-class objects be compiled into a library or "assembly" (or oth

  • Problems Reinstalling Acrobat 9.

    My computer recently crashed and I reinstalled CS5 Design Premium. Everything went fine including the activation, but when I installed Acrobat 9 I got the following message: "Licensing for this product has stopped working." It said to uninstall and r

  • Users are created but Roles are not Provisioned in the Target System

    Hi, It would be great if somebody would provided solution to my problem. The problem is when I try to create the Users in Identity Managment UI then the Users are created in the Target systems but the Roles are not provisioned to the Users. In the pr

  • Db_stat performance -  will it depend on database size ?

    Does db_stat have to trawl through the database to get its information or is BerkeleyDB clever about maintaining the information ready for db_stat to just query and return ? We're running db_stat (from a perl program as it happens) and finding that f