Parser used by JAXB in JDK

Hi All,
i want to know what is the parser that JAXB impl provided by JDK. x  uses???
Thanks

There is no such thing as 'JDK.x -
JAXB implementations use both SAX and DOM parsers so it isn't clear what you mean by 'what is the parser'.

Similar Messages

  • Use of JAXB in NWDS

    Hi Experts,
    We are facing problems with the use of JAXB 2.0 in NWDS 2004, with JDK 1.5.
    Actually we had to do XML parsing, along with validation, w.r.t.
    a large and complicated schema definition, so we chose JAXB,
    which would be faster.
    For working with JAXB, we installed the Java WSDP 2.0, and were
    successful in creating the Java classes from the given schema definition.
    But, when we imported the generated classes in a Java DC, syntax errors
    are shown on the annotations generated by the JAXB Binder / compiler.
    Hence, the Java Project cannot be compiled.
    Also, if the java project is compiled at the command prompt,ie. using javac,
    it gets successfully compiled and executed. That means, we are able to fetch
    the Objects (of the JAXB generated Java classes) created by unmarshalling
    (parsing in JAXB terms) the XML.
    We have included all the required JAR files for use of JAXB.
    Please give some guidelines, for the use of JAXB 2.0 generated Java Classes
    in NWDS.
    For reference, <a href="http://www.oreillynet.com/cs/user/view/cs_msg/81043">JAXB 2.0</a> and <a href="http://java.sun.com/developer/technicalArticles/WebServices/jaxb/#binsch">Using JAXB</a>
    Regards,
    Alka.

    Hi
    Following links may help you.
    1 . https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30b14637-8cb3-2910-438d-9ebed6144d67
    2 . /people/sap.user72/blog/2005/12/14/is-web-dynpro-using-ajax
    Regards
    Abhijith YS

  • JAXB and JDK 1.1

    Hi,
    is it possible to use JAXB with JDK 1.1?
    Is the source code available to change the collection imports?
    Thanks
    Guenther

    Sorry, but the List class is in java.util since 1.2.
    I have tried to use it with JDK 1.2.2, and it fails because the RI try to use some classes from the sun JDK (com.sun... classes) that are not yet there in the JDK 1.2.2. (Or that are different).
    The same occurs with JDK 1.3.0.
    So even if you don't take into account the problem mentionned by jlongmsn, the RI will not work with JDK 1.1.

  • Build using 32-bit Sun JDK in dev windows OS and deploy in 32-bit RHEL

    Is there any potential problems associated with building/compiling my Java classes for my EE (Seam) app into an EAR and deploying on 32-bit Windows OS JBoss AS dev box using 32-bit Windows JDK 1.5 and then deploying the same EAR into 32-bit RHEL OS JBoss AS? The dev envmt is not clustered and the UAT RHEL envmt is a 2 node horizontal cluster without state replication (only mod_jk load balancing and failover).
    Perhaps the entity (and other) classes that implement java.io.Serializable will have issues? thx.

    Note: This thread was originally posted in the Serialization forum, but moved to this forum for closer topic alignment.

  • Parser used in Msg Mapping

    Hi all,
    We all know that DOM / SAX Parser will be used in Java Mapping.
    Then what is the parser used in Message Mapping.
    Thanks
    Krishna.

    Hi,
    Graphical Mapping is internally converted into a Java Code that uses SAX Parser.
    Regards
    Bhavesh

  • How to parse using DOM parser:

    <employee>
         <name>phaneendra</name>
         <age>21</age>
         <company>ABC</company>
         <Authorization>
              <ID>21<ID>
              <Role>Normal</Role>
         </Authorization>
    </employee>
    I am using DOM Parser.Using that parser how can i wil get the <Authorization> node value as
    <Authorization>
         <ID>21<ID>
         <Role>Normal</Role>
    </Authorization>
    thanks in advance

    Since you seem new to using DOM, I'll first give a word of advice.
    Get very familiar with the JavaDocs for things like Document, Element, Node and Attribute. There is much wisdom in those files, especially in the table near the top of the Node interface. Pay particular attention to the meaning of nodeValue for various types on content.
    Using DOM, you get a Document.
    From a Document, you can use the getDocumentElement to get the root element (in your case, the one with a name of "employee").
    From an Element, to get to a child Element with a specific name, use getElementsByTagName or getElementsByTagNameNS (if your elements are coded with NameSpaces).
    Then get the first entry in the resulting list and process it however you like.

  • How to configure WL 10.3 to used log4j instead of jdk logging

    Hi,
    How can I configure WL 10.3 to use log4j instead of jdk default logging. I did changed the logging to log4j through the console for the AdminServer and one of the Managed Instance. I try to deploy axis2.war but it fails and complains about apache logger class not found. So wondering what other settings do I need. I even copied log4j-1.2.15.jar & wllog4j.jar in WL_DOMIAN\lib and restaretd the server but still gets the following error is
    'weblogic.application.ModuleException: [HTTP:101216]Servlet: "AxisServlet" failed to preload on startup in Web application: "axis".
    java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at weblogic.servlet.internal.WebComponentContributor.getNewInstance(WebComponentContributor.java:223)
         at weblogic.servlet.internal.WebComponentContributor.createServletInstance(WebComponentContributor.java:247)
         at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:255)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
         at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
         at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1913)
         at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1887)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1805)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         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:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)
         at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:40)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@70b01a for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@70b01a for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger))
         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
         at org.apache.axis2.transport.http.AxisServlet.<clinit>(AxisServlet.java:83)
         ... 50 more
    Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@70b01a for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger)
         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
         ... 54 more
    Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
         at java.lang.Class.getConstructor0(Class.java:2699)
         at java.lang.Class.getConstructor(Class.java:1657)
         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
         ... 55 moreThanks

    Go to Environments >> servers>> adminServer >> logging >> advanced
    change the default JDK logging to log4j
    by default weblogic provides two types of logging JDK and log4j

  • Web services using Ant, Axis2 and Jdk

    Hi Experts,
    I was able to deploy a web service locally using Ant, Axis2 and Jdk. Then I tried to create a stub using the command "%AXIS2_HOME%\bin\WSDL2Java -uri StockQuoteService.wsdl -d adb –o client" which generated an Stub and a handler. Now I have a pblm in creating the client program. Where shld the client pgm be placed and how to run it. Please help.
    Thanks in Advance,
    Sharmele.

    Anywhere you want. You create a project, since you use ANT you give it its own ANT build file and you put the generated stub classes as part of it like you would your own source files. Then you write the code to actually call the methods of the stub classes.
    Note that if you generate class files, it might be better to generate source files in stead and simply compile them as part of your client application code.

  • Xml parsing using dom4j

    I have some XML in String format, and I want to use the DocumentHelper.parseText() method on that string to parse it to Document format.
    I use it and it doesn't say anything about an error, however when I try to get "getelementroot()" and "getattributevalue" it gives me null.
    The XML looks like this:
    <Response status="1">
    <ERROR code="1">Offer is not available. </ERROR>
    <OFFER_ID>fPSC00010_PKG</OFFER_ID>
    </Response>
    I want to get the value of "status", i.e 1 in this case. So I do something like this:
    Element e = doc.getRootElement();
    String s = e.attributeValue("Status");
    Have I misunderstood something or what?

    Well I am not 100% sure why your code is causing a problem. I used dom4j 1 year ago.
    But I can give you my code snippet, the difference there to your snippet is that I first retrieved an Iterator over the Root element. And as I think the root element in your case is not the "Response" element it is more like a pointer to the start of the document. I am sorry for my vague explanation,it's too long age.
    But I am sure that you can use my example for your need effectively.
    public XMLMetaReader( String fileName )
            Document document = null;
            try
                SAXReader reader = new SAXReader( true );
                document = reader.read( fileName );
                root = document.getRootElement();
                createDBTree();
            catch ( DocumentException e )
                e.printStackTrace();
        public Map getSourceTables()
            return sourceTables;
        /** Return all tables which are set in the currently connected Database. */
        private void createDBTree() throws DocumentException
            for ( Iterator iterator0 = root.elementIterator( "database" ); iterator0.hasNext(); )
                Element databaseNode = ( Element ) iterator0.next();
                database = databaseNode.attributeValue( "ID" );
                // iterate through child elements of root with element name "table"
                for ( Iterator iterator = databaseNode.elementIterator( "table" ); iterator.hasNext(); )
                    Element tableNode = ( Element ) iterator.next();
                    Table table = new Table( tableNode.attributeValue( "ID" ) );
                    sourceTables.put( tableNode.attributeValue( "ID" ), table );
                    // iterate through child elements of root with element name "field"
                    for ( Iterator iterator2 = tableNode.elementIterator( "field" ); iterator2.hasNext(); )
                        Element fieldNode = ( Element ) iterator2.next();
                        Field field = new Field( fieldNode.attributeValue( "ID" ) );
                        field.setOriginalDomain( fieldNode.attributeValue( "datatype" ) );
                        if ( fieldNode.attributeValue( "default" ) != null )
                            String fieldValue = fieldNode.attributeValue( "default" );
                            if ( ( fieldValue ).equalsIgnoreCase( "NULL" ) )
                                field.setIsOriginalNullable( true );
                            else if ( ( fieldValue ).equalsIgnoreCase( "NOT NULL" ) )
                                field.setIsOriginalNullable( false );
                            else
                                field.setOriginalDefault( fieldValue );
                        table.addField( field );
                    for ( Iterator iterator2 = tableNode.elementIterator( "primarykey" ); iterator2.hasNext(); )
                        Element primaryNode = ( Element ) iterator2.next();
                        for ( Iterator iterator3 = primaryNode.elementIterator( "key" ); iterator3.hasNext(); )
                            Element keyNode = ( Element ) iterator3.next();
                            table.addPrimaryKey( keyNode.attributeValue( "field" ) );
                            Field primaryField = table.getField( keyNode.attributeValue( "field" ) );
                            primaryField.setIsOriginalPrimary( true );
                    for ( Iterator iterator2 = tableNode.elementIterator( "foreignkey" ); iterator2.hasNext(); )
                        Element foreignNode = ( Element ) iterator2.next();
                        ForeignKey foreignKey = new ForeignKey();
                        for ( Iterator iterator3 = foreignNode.elementIterator( "key" ); iterator3.hasNext(); )
                            Element keyNode = ( Element ) iterator3.next();
                            foreignKey.setOnField( keyNode.attributeValue( "field" ) );
                            System.out.println( keyNode.attributeValue( "field" ) );
                            foreignKey.setReferencedTable( keyNode.attributeValue( "references" ) );
                            System.out.println( keyNode.attributeValue( "references" ) );
                        for ( Iterator iterator3 = foreignNode.elementIterator( "onupdate" ); iterator3.hasNext(); )
                            Element onUpdateNode = ( Element ) iterator3.next();
                            foreignKey.setOnUpdate( onUpdateNode.attributeValue( "action" ) );
                        for ( Iterator iterator3 = foreignNode.elementIterator( "ondelete" ); iterator3.hasNext(); )
                            Element onDeleteNode = ( Element ) iterator3.next();
                            foreignKey.setOnDelete( onDeleteNode.attributeValue( "action" ) );
                        table.addForeignKey( foreignKey );
                    for ( Iterator iterator2 = tableNode.elementIterator( "index" ); iterator2.hasNext(); )
                        Element indexNode = ( Element ) iterator2.next();
                        Index index = new Index( indexNode.attributeValue( "name" ) );
                        index.setIsUNIQUE( ( indexNode.attributeValue( "unique" ) ).equalsIgnoreCase( "true" )  );
                        index.setIsDESC( ( indexNode.attributeValue( "ASC" ) ).equalsIgnoreCase( "true" )  );
                        /* index.setTable( tableNode.attributeValue( "ID" ) ); */
                        for ( Iterator iterator3 = indexNode.elementIterator( "indexfield" ); iterator3.hasNext(); )
                            Element indexFieldElement = ( Element )iterator3.next();
                            int position = Integer.parseInt( indexFieldElement.attributeValue( "position" ) );
                            index.addField( indexFieldElement.attributeValue( "field" ), ( short ) position );
                        table.addIndex( index );
                    for ( Iterator iterator2 = tableNode.elementIterator( "uniqueclause" ); iterator2.hasNext(); )
                        Element uniqueNode = ( Element ) iterator2.next();
                        UniqueConstraint uniqueConstraint = new UniqueConstraint();
                        for ( Iterator iterator3 = tableNode.elementIterator( "uniquefield" ); iterator3.hasNext(); )
                            Element uniqueFieldNode = ( Element ) iterator3.next();
                            uniqueConstraint.addField( uniqueFieldNode.attributeValue( "field" ) );
    }Hope it helps.
    Best regards
    Tarik

  • XML - 0112 Error on parsing using SAX and xml file in InputSource object.

    I need to parse a XML string and extract some information. I have to use SAX parser. I'm converting hte string to InputSource and then trying to parese.
    i'm getting XML-0112 error, my guess is that it is not able to locate DTD file but i tried hardcoding the whole path in DOCTYPE tag.
    i tried doing setSystemId also but no luck.
    null

    Can you post a simple test case to look at?

  • Xml parsing using java DefaultHandler of org.xml.sax.helpers.DefaultHandler

    i am using
    org.xml.sax.helpers.DefaultHandler api for parsing xml file ,while parsing i am getting exception sometimes ,
    i am using code below to parse the element and then store it to vectore
    parser truncate the charaacters sometimes like parsing string
    " NJ-HealthCare " i am getting only " NJ-HealthCare " and remaing characters are added in new element
    public void characters(char ch[], int start, int length) {
    try{
    ElementVal="";
    System.out.println(" start "+start+" ength :: "+length);
    String ElementVal = new String(ch,start,length);
    v.addElement( ElementVal );
    }catch(Exception ex){
    System.out.println("Exception in vector::"+ex);
    System.out.println(""+ex.getMessage());
    ex.printStackTrace();
    }

    This is an FAQ in the XML forum. The characters() method is not required to give you an entire text node all at once. The parser is free to split up the text node and call characters() several times if it likes. Your program will have to account for that possibility.

  • ? is shown for Norwegian characters when XML document is parsed using DOM

    Hi,
    I've a sample program that creates a XML document with a single element book having Norwegian characters. Encoding is UTF-8. When i parse the XML document and try to access the value of that element then ? are shown for Norwegian characters. XML document file name is "Sample.xml"
                DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
                Document doc = docBuilder.newDocument();
                Element root = doc.createElement("root");
                root.setAttribute("value", "Á á &#260; &#261; ä É é &#280;");
                doc.appendChild(root);
                TransformerFactory transfac = TransformerFactory.newInstance();
                Transformer trans = transfac.newTransformer();
                trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
                trans.setOutputProperty(OutputKeys.INDENT, "yes");
                trans.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                //create string from xml tree
                java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
                StreamResult result = new StreamResult(baos);
                DOMSource source = new DOMSource(doc);
                trans.transform(source, result);
                writeToFile("Sample.xml", baos.toByteArray());
                InputSource is = new InputSource(new java.io.ByteArrayInputStream(readFile("Sample.xml")));
                is.setEncoding("UTF-8");
                DocumentBuilder obj_db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document obj_doc = obj_db.parse(is);
                obj_doc.normalize();
                System.out.println("Value is : " + new String(((Element) obj_doc.getElementsByTagName("root").item(0)).getAttribute("value").getBytes()));writeFile() - Writes the document bytes in Sample.xml file
    readFile() - Reads the Sample.xml file
    When i run this program XML editor shows the characters correctly but Java code output is: Á á ? ? ä É é ?
    What's the problematic area in my java code. I didn't get any help from any source. Please suggest me the solution of this problem.
    Thanx in advance.

    Hi,
    I'm using JBuilder 2005 and i mentioned encoding UTF-8 for saving Java source files and also for compilation. I've modified my source code also. But the problem persists. After applying changing the dumped sample.xml file doesn't display these characters correctly in IE, but earlier it was displaying it correctly at IE.
    Modified code is:
    DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
                Document doc = docBuilder.newDocument();
                Element root = doc.createElement("root");
                root.setAttribute("value", "Á á &#260; &#261; ä É é &#280;");
                doc.appendChild(root);
                OutputFormat output = new OutputFormat(doc, "UTF-8", true);
                java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
                OutputStreamWriter osw = new OutputStreamWriter(baos, "UTF-8");
                XMLSerializer s = new XMLSerializer(osw, output);
                s.asDOMSerializer();
                s.serialize(doc);
                writeToFile("Sample5.xml", baos.toByteArray());
                InputSource o = new InputSource(new java.io.ByteArrayInputStream(readFile("Sample5.xml")));
                o.setEncoding("UTF-8");
                com.sun.org.apache.xerces.internal.parsers.DOMParser obj_parser = new com.sun.org.apache.xerces.internal.parsers.DOMParser();
                obj_parser.parse(o);
                Document obj_doc = obj_parser.getDocument();
                System.out.println("Value : " + new String(((Element) obj_doc.getElementsByTagName("root").item(0)).getAttribute("value").getBytes()));I'm hanged on this issue. Can u please provide me the code snippet that works with these characters or suggest solution.
    Thanx

  • Problem in using sybase drivers with JDK 1.5

    hi all,
    i have an app that is connecting to a sybase database.
    so far i have run it using jdk 1.4 using sybase jconn2.jar , it has workedf ine.
    Now, i haven't changed the code, i just recompiled it and re-run it using jdk 1.5 , and suddenly i am getting a classNotFoundException
    java.lang.ClassNotFoundException: com.sybase.jdbc2.jdbc.SybDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at BNPParibas.Collateral.SQL.SQLConnectionFactory.DoConnection(SQLConnec
    tionFactory.java:65)
    at BNPParibas.Collateral.SQL.SQLConnectionFactory.Connect(SQLConnectionF
    actory.java:29)
    at BNPParibas.Collateral.SQL.ResultSetFactory.<init>(ResultSetFactory.ja
    va:27)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.load(FlowControl.java:81
    at BNPParibas.Collateral.Batch.Flow.FlowControl.<init>(FlowControl.java:
    62)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.main(FlowControl.java:37
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Appe
    nder
    at BNPParibas.Collateral.Batch.Flow.FlowControl.load(FlowControl.java:16
    8)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.<init>(FlowControl.java:
    62)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.main(FlowControl.java:37
    and NOTHING has changed except that now i am runnign java 1.5 instead of 1.4
    has anyone ever experienced a similar problem?
    regards
    marco

    Hello,
    well, yes it is.
    Running the code with jdk 1.4 is absolutely fine.
    if i run it like this
    <myjdk14install>\bin\java -jar xxx.jar works fine
    if i run it l ike this (which will use 1.5 by default)
    java -jar xxx.jar it gives me that exception...
    have the classloading mechanism changed between jdk 1.4 and jdk 1.5?
    regards
    marco

  • JAXB and JDK 6

    Hi,
    I am using the JAXB2 version that is delivered with Java 1.6.0-beta2-b82. I have written an EJB3 entity bean and would like to serialize it as XML. But JAXB2 has trouble with annotations of the Java Persistence API like 'javax.persistence.Column' or 'javax.persistence.Id'.
    The stack trace looks usually like this:
    java.lang.IllegalArgumentException: interface javax.persistence.Column is not visible from class loader
    at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
    at com.sun.xml.bind.v2.model.annotation.LocatableAnnotation.create(LocatableAnnotation.java:37)
    at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllMethodAnnotations(RuntimeInlineAnnotationReader.java:47)
    at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllMethodAnnotations(RuntimeInlineAnnotationReader.java:17)
    at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findGetterSetterProperties(ClassInfoImpl.java:869)
    at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:257)
    at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:91)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:127)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:330)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:199)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
    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:589)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:381)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:561)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:508)
    at test.JAXBClient.marshal(JAXBClient.java:59)
    at test.JAXBClient.main(JAXBClient.java:26)
    You can also take a look at the following topic (the last comment):
    http://forums.java.net/jive/thread.jspa?messageID=151165&tstart=0
    Thanks a lot!
    Michael

    Yeah, it's my post ... I need it to work with JDK 6
    Sun fellows? What is happening with it?

  • Attribute parsing using the Oracle SAX Parser

    I am trying to parse attributes like <Phone Type="N"> using the SAX xml parser from oracle in the startElement method and am getting a null pointer exception
    public void startElement(String sName_, AttributeList attrs_) {
    if sName_.equals("Phone")
    String phoneType = attrs_.getValue("Type")
    Any ideas ??
    null

    Using 2.0.2.9, the following works for me:
    import oracle.xml.parser.v2.*;
    public class SAXParserExample {
    public static void main(String[] a) throws Throwable {
    SAXParser s = new SAXParser();
    Handler h = new Handler();
    s.setDocumentHandler(h);
    s.parse(new java.io.StringReader("<Phone Type='N'/>"));
    import org.xml.sax.*;
    public class Handler extends HandlerBase {
    public void startElement(String sName_, AttributeList attrs_) {
    if (sName_.equals("Phone")) {
    String phoneType = attrs_.getValue("Type");
    System.out.println(phoneType);
    }What's different about your case?

Maybe you are looking for