NullPointerException using xjc

I'd like to use xjc to generate the Java Bindings from my schemas.
Using the console to start xjc (xjc ATE_Display.xsd ATE_Template.xsd) I've got the following error.
Exception in thread "main" java.lang.NullPointerException
     at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._getBindInfoReadOnly(BGMBuilder.java:383)
     at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.getBindInfo(BGMBuilder.java:367)
     at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.getLocalDomCustomization(BGMBuilder.java:405)
     at com.sun.tools.xjc.reader.xmlschema.RawTypeSetBuilder.particle(RawTypeSetBuilder.java:79)
     at com.sun.tools.xjc.reader.xmlschema.RawTypeSetBuilder.build(RawTypeSetBuilder.java:43)
     at com.sun.tools.xjc.reader.xmlschema.ct.MixedComplexTypeBuilder.build(MixedComplexTypeBuilder.java:46)
     at com.sun.tools.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder.build(ComplexTypeFieldBuilder.java:64)
     at com.sun.tools.xjc.reader.xmlschema.BindRed.complexType(BindRed.java:37)
     at com.sun.xml.xsom.impl.ComplexTypeImpl.visit(ComplexTypeImpl.java:237)
     at com.sun.tools.xjc.reader.xmlschema.ClassSelector$Binding.build(ClassSelector.java:175)
     at com.sun.tools.xjc.reader.xmlschema.ClassSelector.executeTasks(ClassSelector.java:321)
     at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:139)
     at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:77)
     at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:387)
     at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:145)
     at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:91)
     at com.sun.tools.xjc.Driver.run(Driver.java:287)
     at com.sun.tools.xjc.Driver.run(Driver.java:173)
     at com.sun.tools.xjc.Driver._main(Driver.java:98)
     at com.sun.tools.xjc.Driver.access$000(Driver.java:56)
     at com.sun.tools.xjc.Driver$1.run(Driver.java:78)
I am using Java 1.5.0_08 & Jaxb2_20060801

Yes I am using JAXB2 (JAXB2_20060801) & java 1.5.0_08
I tried the "Simple Mode" (with the call xjc -extension simpleMode.xsd ATE_Display.xsd ATE_Template.xsd) described at the Website you posted me, but the error message was just the same as before.

Similar Messages

  • Can't create a JAXB binding for ejb-jar.xml using xjc

    Hi all,
    I have been trying to build a JAXB binding for EJB deployment descriptors, mainly because I have to update a hand-cranked ejb-jar.xml file on the fly with some additions that have come from a code generator.
    I have tried to use
    xjc ejb-jar_2_1.xsd j2ee_1_4.xsd ejb-jar_2_1.xsd
    xjc on the schema definitions I found at http://java.sun.com/xml/ns/j2ee/ but I can't get it to work. It produces reams of errors, see below for a short extract.
    Of course, someone could put me out of my misery and tell me where to find a binding that someone else has done. I can't be the first chimp on the planet that has wanted to do this!
    Any help much appreciated.
    errors:
    [WARNING] warning: "blockDefault" attribute of <schema> is not supported
    line 3 of xml.xsd
    [WARNING] warning: "finalDefault" attribute of <schema> is not supported
    line 3 of xml.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 117 of j2ee_web_services_client_1_1.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 115 of ejb-jar_2_1.xsd
    [WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
    line 129 of ejb-jar_2_1.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 145 of ejb-jar_2_1.xsd
    [WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
    line 159 of ejb-jar_2_1.xsd

    Exception initializing 'oracle.dbtools.raptor.MonitorJDBCAddin' in extension 'Oracle SQL Developer': oracle.classloader.
    util.AnnotatedNoClassDefFoundError:
    Missing class: oracle.jdbc.OracleDriverThe Oracle driver is not on the classpath.

  • Problem using xjc

    Hi,
    I try to use xjc with my schema, with this command
    D:\Travail\WEGinst\CrossSection>C:\jwsdp-1.1\jaxb-1.0\bin\xjc.bat CrossSection.xsd -p CrossSection
    I obtain
    parsing a schema...
    [ERROR] s4s-elt-schema-ns: The namespace of element 'schema' must be from the schema namespace.
    line 7 of feature.xsd
    the CrossSection.xsd is as follow:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- created by Antonio Guillen 22/03/2003 Version 0.0-->
    <xs:schema targetNamespace="http://www.opengis.net/gml/cross" xmlns:cross="http://www.opengis.net/gml/cross" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="2.05">
         <xs:import namespace="http://www.opengis.net/gml" shemaLocation="feature.xsd"/>
    and feature.xsd is as follow:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- File: feature.xsd -->
    <schema targetNamespace="http://www.opengis.net/gml"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns="http://www.w3.org/2000/10/XMLSchema"
    elementFormDefault="qualified"
    version="2.05">
    <!-- include constructs from the GML Geometry schema -->
    <include schemaLocation="geometry.xsd"/>
    I don't understand why i have this problem can any body help me.
    Thanks very much
    Antonio

    Add a 'xs' prefix to the schema element in feature.xsd & include a xmlns:xs namespace in the xs:schema element.
    <xs:schema targetNamespace="http://www.opengis.net/gml"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns="http://www.w3.org/2000/10/XMLSchema"
    elementFormDefault="qualified"
    version="2.05">

  • "java.lang.NullPointerException" using the calender-iview

    Hi,
    We are using SAP NetWeaver Portal 6.0.14.0.0, KM-Version 6.0.14.2.0 and Microsoft Exchange 2000.
    Our SysAdmin has integrated Exchange into the portal and I integrated two calender-iviews (one-month-overview & one-daay-overview). Until last week everything worked fine and everybody was able to see his appointments within this two iviews. But now we get the error-message "
    java.lang.NullPointerException" in this iviews. 
    We haven´t changed anything, this error-message appeared suddenly. Has anybody an idea what´s wrong?
    Thanks for help.
    Greetings,
    Sven

    Hi Sven,
    (a) You should definitely check the log files (default.X.trc) to get a more specific idea where the error comes from.
    (b) If you don't realise immediately where the problem comes from when watching the traces, consider opening an OSS message, for at least a NPE should never be thrown on the UI.
    Hope it helps
    Detlev

  • Got NullPointerException using plain/text content in the mail.

    Hi,
    Here is the code sipnet, and i am facing problems, when i use it
            InternetAddress[] addressTo = new InternetAddress[tok.countTokens()];
            int i=0;
            while(tok.hasMoreTokens())
                addressTo[i++] = new InternetAddress(tok.nextToken());
            msg.setRecipients(Message.RecipientType.TO, addressTo);
            tok = new StringTokenizer(cc,",");
            InternetAddress[] addressCC = new InternetAddress[tok.countTokens()];
            i=0;
            while(tok.hasMoreTokens())
                addressCC[i] = new InternetAddress(tok.nextToken());
            msg.setRecipients(Message.RecipientType.CC, addressCC);
            // Optional : You can also set your custom headers in the Email if you Want
            msg.addHeader("MyHeaderName", "myHeaderValue");
            // Setting the Subject and Content Type
            msg.setSubject(subject);
            msg.setContent(message, "text/html; charset=\"UTF-8\"");
         //msg.setText(message);
            Transport.send(msg);on execution of the above code, i get the following exceptions please help..
    java.lang.NullPointerException
    at com.sun.mail.handlers.text_plain.writeTo(text_plain.java:98)
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
    at javax.activation.DataHandler.writeTo(DataHandler.java:295)
    at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:222)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1065)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1914)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1895)
    at javax.mail.Transport.send(Transport.java:79)
    at com.prosoft.workflow.extensions.SMTPMailAuthenticationExtension.postMail(SMTPMailAuthenticationExtension.java:114)
    at com.prosoft.workflow.extensions.SMTPMailAuthenticationExtension.execute(SMTPMailAuthenticationExtension.java:62)
    Any sugession also welcome.
    Thanks in advance
    Thanks,
    - Moses.

    Hi Krupa,
    Still same error .
    Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null "null"]; nested exception caused by: com.sap.aii.af.sdk.xi.util.XMLScanException: expecting end tag: {http://sap.com/xi/XI/Mail/30}Mail, but found {}Content at state

  • NullPointerException using weight based load algorithm?

              We're using WL451, on Solaris. We have two clusters, Cluster A (running
              servlets) and Cluster B (running EJB's).
              We've enabled weight-based load balancing on cluster B. Each machine
              has a weblogic.system.weight property defined.
              When running code on cluster A, we get frequent null pointer exceptions
              in Weblogic. Has anyone seen this?
              Wed Aug 30 17:11:54 EDT 2000 <E> [ShockExServlet] Unexpected failure:
              java.lang.NullPointerExceptio
              n. Exception: java.lang.NullPointerException
              java.lang.NullPointerException
              at weblogic.service.RichReplicaList.getMaxServerWeight(Compiled
              Code)
              at
              weblogic.service.WeightBasedReplicaHandler.chooseReplica(Compiled Code)
              at weblogic.service.BasicReplicaHandler.loadBalance(Compiled
              Code)
              at weblogic.service.BasicServiceStub._wl_loadBalance(Compiled
              Code)
              at
              weblogic.service.BasicServiceStub._wl_autoLoadBalance(Compiled Code)
              at
              com.shockmarket.ejb.ir.ShockInformationReceiverBeanEOImpl_ServiceStub.exOccurred(Compiled
              Code)
              at
              com.shockmarket.data.ShockInformationReceiverProxy.exOccurred(Compiled
              Code)
              at com.shockmarket.servlet.ShockExServlet.recordEx(Compiled
              Code)
              at com.shockmarket.servlet.ShockExServlet.emitHTML(Compiled
              Code)
              at com.shockmarket.servlet.ShockBaseServlet.sendHTML(Compiled
              Code)
              at com.shockmarket.servlet.ShockBaseServlet._jspService(Compiled
              Code)
              at com.shockmarket.servlet.ShockBaseServlet.doGet(Compiled Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              Code)
              and
              Wed Aug 30 17:12:01 EDT 2000 <E>
              [UUID=prodweb2.shockmarket.com967669921432] [_RG] Failed processing
              form request. data = BH=foo&U=1. Exception:
              java.lang.NullPointerException
              java.lang.NullPointerException
              at
              weblogic.service.WeightBasedReplicaHandler.chooseReplica(Compiled Code)
              at weblogic.service.BasicReplicaHandler.loadBalance(Compiled
              Code)
              at weblogic.service.BasicServiceStub._wl_loadBalance(Compiled
              Code)
              at
              weblogic.service.BasicServiceStub._wl_autoLoadBalance(Compiled Code)
              at
              com.shockmarket.ejb.subscriber.ShockSubscriberBeanHomeImpl_ServiceStub.findByBrIDB
              rHandle(Compiled Code)
              at
              com.shockmarket.ejb.ShockEJBClientUtils.getSubscriberState(Compiled
              Code)
              at
              com.shockmarket.servlet.ShockBaseServlet.getSubscriberState(Compiled
              Code)
              at
              com.shockmarket.servlet.ShockBaseServlet.getNextSubpage(Compiled Code)
              at
              com.shockmarket.servlet.ShockBaseServlet.processRequest(Compiled Code)
              at com.shockmarket.servlet.ShockBaseServlet.doGet(Compiled Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              Code)
              at weblogic.servlet.JSPServlet.service(Compiled Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled
              Code)
              at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
              at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
              David Michaels <[email protected]>
              Director of Technology
              ShockMarket Corporation (650) 330-4665
              [david.vcf]
              

    Which service pack? Could you use most recent service pack?
              Cheers - Wei
              David Michaels <[email protected]> wrote in message
              news:[email protected]...
              >
              > We're using WL451, on Solaris. We have two clusters, Cluster A (running
              > servlets) and Cluster B (running EJB's).
              >
              > We've enabled weight-based load balancing on cluster B. Each machine
              > has a weblogic.system.weight property defined.
              >
              > When running code on cluster A, we get frequent null pointer exceptions
              > in Weblogic. Has anyone seen this?
              >
              > Wed Aug 30 17:11:54 EDT 2000 <E> [ShockExServlet] Unexpected failure:
              > java.lang.NullPointerExceptio
              > n. Exception: java.lang.NullPointerException
              > java.lang.NullPointerException
              > at weblogic.service.RichReplicaList.getMaxServerWeight(Compiled
              > Code)
              > at
              > weblogic.service.WeightBasedReplicaHandler.chooseReplica(Compiled Code)
              > at weblogic.service.BasicReplicaHandler.loadBalance(Compiled
              > Code)
              > at weblogic.service.BasicServiceStub._wl_loadBalance(Compiled
              > Code)
              > at
              > weblogic.service.BasicServiceStub._wl_autoLoadBalance(Compiled Code)
              > at
              >
              com.shockmarket.ejb.ir.ShockInformationReceiverBeanEOImpl_ServiceStub.exOccu
              rred(Compiled
              >
              > Code)
              > at
              > com.shockmarket.data.ShockInformationReceiverProxy.exOccurred(Compiled
              > Code)
              > at com.shockmarket.servlet.ShockExServlet.recordEx(Compiled
              > Code)
              > at com.shockmarket.servlet.ShockExServlet.emitHTML(Compiled
              > Code)
              > at com.shockmarket.servlet.ShockBaseServlet.sendHTML(Compiled
              > Code)
              > at com.shockmarket.servlet.ShockBaseServlet._jspService(Compiled
              >
              > Code)
              > at com.shockmarket.servlet.ShockBaseServlet.doGet(Compiled Code)
              >
              > at javax.servlet.http.HttpServlet.service(Compiled Code)
              > at javax.servlet.http.HttpServlet.service(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              > Code)
              >
              > and
              >
              > Wed Aug 30 17:12:01 EDT 2000 <E>
              > [UUID=prodweb2.shockmarket.com967669921432] [_RG] Failed processing
              > form request. data = BH=foo&U=1. Exception:
              > java.lang.NullPointerException
              > java.lang.NullPointerException
              > at
              > weblogic.service.WeightBasedReplicaHandler.chooseReplica(Compiled Code)
              > at weblogic.service.BasicReplicaHandler.loadBalance(Compiled
              > Code)
              > at weblogic.service.BasicServiceStub._wl_loadBalance(Compiled
              > Code)
              > at
              > weblogic.service.BasicServiceStub._wl_autoLoadBalance(Compiled Code)
              > at
              >
              com.shockmarket.ejb.subscriber.ShockSubscriberBeanHomeImpl_ServiceStub.findB
              yBrIDB
              >
              > rHandle(Compiled Code)
              > at
              > com.shockmarket.ejb.ShockEJBClientUtils.getSubscriberState(Compiled
              > Code)
              > at
              > com.shockmarket.servlet.ShockBaseServlet.getSubscriberState(Compiled
              > Code)
              > at
              > com.shockmarket.servlet.ShockBaseServlet.getNextSubpage(Compiled Code)
              > at
              > com.shockmarket.servlet.ShockBaseServlet.processRequest(Compiled Code)
              > at com.shockmarket.servlet.ShockBaseServlet.doGet(Compiled Code)
              >
              > at javax.servlet.http.HttpServlet.service(Compiled Code)
              > at javax.servlet.http.HttpServlet.service(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              > Code)
              > at weblogic.servlet.JSPServlet.service(Compiled Code)
              > at javax.servlet.http.HttpServlet.service(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              > Code)
              > at
              > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
              > Code)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled
              > Code)
              > at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
              > at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
              >
              >
              > --
              > David Michaels <[email protected]>
              > Director of Technology
              > ShockMarket Corporation (650) 330-4665
              >
              >
              

  • NullPointerException Using PrintStream or PrintWriter

    Here is the code that I am using. I am taking the output of a program and trying to write that output to a file. When outputting to the file I receive a null pointer exception that I don't know why I am getting. I am using PrintStream here but I also tried using PrintWriter and I got the same error. If I uncomment the System.out.println statement the first line is printed to the console window, but then when it tries to print that line to the file I apparently get the NullPointerException. Can anyone help? Thank you. Here is that bit of code.
    p = r.exec(myprogram);
                                  InputStream in = p.getInputStream();
                                  BufferedReader br = new BufferedReader(new InputStreamReader(in));
                                  String line = null;
                                  try
                                       PrintStream outFile = new PrintStream(new FileOutputStream("testresults.txt"));
                                  catch(FileNotFoundException fe)
                                       System.out.println("File not found: " + fe);
                                  while ((line = br.readLine()) != null)
                                       //System.out.println(line);
                                       outFile.println(line);
                                  p.waitFor();

    I can tell you exactly why... Here's an example
    public static void aMethod() {
      String s = "Foo";
        String s = "Bar";
      System.out.println(s);
    }The value output is "Foo" because the 's' declared in the parenthesis is a different variable in it's own scope.
    Your code does something similar when you did the following
    try {
      PrintStream outFile = new PrintStream(new FileOutputStream("testresults.txt"));
    } catch(FileNotFoundException fe) {
      System.out.println("File not found: " + fe);
    }This declares a variable in the scope of the try block and assigns a reference to a new PrintStream object. However this variable ceases to exist immediately following the closing parenthesis of the catch block.
    Since your code compiles you must, further up have already declared outFile so I would change the code to
    try {
      outFile = new PrintStream(new FileOutputStream("testresults.txt"));
    } catch(FileNotFoundException fe) {
      System.out.println("File not found: " + fe);
      outfile = null;
    }Note that this means if the exception occurs, outFile will be null. You need to decide what action to take in this situation.
    Hope that helps - now put up your Dukes... ;)

  • NullPointerException using loadbundle

    I'm a newbie to JSF and am getting a NullPointerException when trying to use the loadbundle tag. I saw someone else posted a similar post here but didn't see any resolution.
    I'm using NetBeans 4.1 and have all of my property files in a package:
    com.mycompany.myproject.bundles.Login.properties
    com.mycompany.myproject.bundles.Login_en_US.properties
    com.mycompany.myproject.bundles.Login_es_ES.properties
    etc...
    In the body of the html in my login.jsp file I'm using:
    <f:loadBundle basename="com.mycompany.myproject.bundles.Login" var="loginBundle" />
    I don't know if this is relavent, but this is how the url pattern looks in my web.xml:
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    Anyone have any idea? TIA.

    Nevermind I figured this out...
    I had to manually add library references to jstl.jar and standard.jar. Don't know why they are automatically added? :-\
    I also changed the url mapping to *.jsf (just my preference). During debugging with NetBeans you have to manually type in the name of the altered page name (login.jsf instead of login.jsp). I also added preventive-access security settings to the web.xml:
    <security-constraint>
    <display-name>Restrict access to JSP pages</display-name>
    <web-resource-collection>
    <web-resource-name>
              Restrict access to JSP pages
    </web-resource-name>
         <url-pattern>*.jsp</url-pattern>
         </web-resource-collection>
    <auth-constraint>
    <description>
    With no roles defined, no access granted
    </description>
    </auth-constraint>
    </security-constraint>
    That way the *.jsp pages cannot be accessed directly (since they need to go through the faces servelet via *.jsf).
    Sort of a pain-in-the-ass IMO.

  • NullPointerException using DeploymentXMLGenerator

    Hi,
    I'm using JDeveloper 10.1.3.2 with TopLink. I'm building the application with Maven and I would like during the build process to export the mappings.
    I found out that the DeploymentXMLGenerator class mentionned in the TopLink docs was located in tl_mappingeditor.jar under JDEV_HOME/jdev/lib. So I'm trying to use it to generate the xml deployment descriptor, however I'm always getting a NullPointerException:
    java.lang.NullPointerException
            at oracle.toplink.workbench.external.api.Generator.generate(Generator.java:65)I'm using the following code:
    new DeploymentXMLGenerator().generate(new File("path-to-mwp-file"), new File("path-to-xml-file"));What's wrong? Is there another way around?
    Thanx
    Olivier

    I should probably give a more accurate example. The original is over-simplified and you might think I am passing null into setObject().
    for ( int j = 0; j < data.length; j++ ) {
    for ( int k = 0; k < data[j].length; k++ ) {
    if ( data[j][k] == null ) {
    statement.setNull(k + 1, getSqlType(k));
    } else {
    statement.setObject(k + 1, data[j][k]);
    statement.addBatch();
    statement.executeBatch();

  • NullPointerException using @Resource for JDBC lookup

    I had the following working and am trying to convert to using @Resource and have been unsuccessful:
    First I had the following working, inside a jar within an ear deployed to glassfish v3 and no sun-ejb-jar.xml file:
    public CM
    public CM() {
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("jdbc/xDataSource");
    Connection conn = ds.getConnection();
    When I switched to the following I get a NullPointerException when I deploy, indicating that the resource could not be found
    @Stateful
    public CM
    @Resource(name="jdbc/xDataSource", mappedName="jdbc/xDataSource")
    private DataSource ds;
    public CM() {
    Connection conn = ds.getConnection();
    and added sun-ejb-jar.xml file to META-INF directory
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 EJB 3.1//EN"
    "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_1-0.dtd">
    <sun-ejb-jar>
    <enterprise-beans>
    <ejb>
    <ejb-name>CM</ejb-name>
    <resource-ref>
    <res-ref-name>jdbc/xDataSource</res-ref-name>
    <jndi-name>jdbc/xDataSource</jndi-name>
    </resource-ref>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    P.S. Sorry about not using code tags I'm not sure which tag to use to properly format it.

    Do you know what those authorizations should be when using a standard JDBC Lookup mapping function?  Currently we have a custom UDF that calls the table via a <schema>.<table name> and the current user in the Receiver Comm Channel works just fine.  It appears that when using the standard SAP JDBC Lookup function it calls the table directly and the user in the Comm Channel no longer has the correct permissions.
    I would expact that the JDBC Lookup function would allow for a standard "Read" on any table as long as the user has that level of access...but not in this case.  I am going to bring it up to our SAP XI software development team and see what they say, but wanted to get some views from our other experts as well.
    Thanks,
    Matt

  • NullPointerException using custom aggregator

    We have implemented a custom parallel-aware aggregator, extending from AbstractAggregator, and tried running it against a distributed cache on a single member. The calling code is:
              Map map = (Map) cache.aggregate(
                   new AlwaysFilter(),
                   GroupAggregator.Parallel.createInstance("getCcyPair",
                        new TestAggregator()
    This works fine when we substitute the TestAggregator initialisation with: new LongSum("getBalance")
    In trying to resolve this issue, TestAggregator was reduced to:
    public class TestAggregator extends AbstractAggregator {
         private static final long serialVersionUID = 1L;
         @Override
         protected Object finalizeResult(boolean arg0) {
              return new Long(7);
         @Override
         protected void init(boolean arg0) {
         @Override
         protected void process(Object arg0, boolean arg1) {
    However, we still receive the following exception on execution:
    java.lang.NullPointerException
         at com.tangosol.util.InvocableMapHelper.extractFromEntry(InvocableMapHelper.java:289)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$Storage$BinaryEntry.extract(DistributedCache.CDB:27)
         at com.tangosol.util.aggregator.AbstractAggregator.aggregate(AbstractAggregator.java:96)
         at com.tangosol.util.aggregator.GroupAggregator.aggregate(GroupAggregator.java:156)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache.onAggregateFilterRequest(DistributedCache.CDB:74)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$AggregateFilterRequest.run(DistributedCache.CDB:1)
         at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheRequest.onReceived(DistributedCacheRequest.CDB:12)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onMessage(Service.CDB:9)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onNotify(Service.CDB:122)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache.onNotify(DistributedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:35)
         at java.lang.Thread.run(Thread.java:595)
    Is there a crucial element that we are missing from our aggregator implementation? Any help would be appreciated.
    Regards,
    James

    Hi James,
    AbstractAggregator requires a ValueExtractor in order to obtain the value to be aggregated. This ValueExtractor will be applied to the map entry. You can either pass one into the constructor or override AbstractAggregator.getValueExtractor().
    Note that AbstractAggregator implements ExternalizableLite, so if your aggregator has non transient values that need to be serialized, they need to be read/written out using readExternal(DataInput in) and writeExternal(DataOutput out) using the helper methods in ExternalizableHelper.
    Thanks,
    Patrick Peralta
    Tangosol, Inc.

  • NullPointerException using Map

    Map<String,Integer> m = new HashMap<String,Integer>();
    for(int i=0;i<part_trans.length;i++)
    m.put(part_trans,intValue(part_trans[i],rule_to_hide_l));
    for(int i=0;i<m.size();i++)
    if(m.get(part_trans[i])>max)
    result1 = part_trans[i];
    max = m.get(part_trans[i]);
    // intValue function works fine ......
    So plz help......
    ty

    ezo wrote:
    tsith wrote:
    if this line threw a NPE
    if(m.get(part_trans)>max)
    then either m is null or part_trans[i] is null.
    part_trans[i] being null would not result in a NullPointerException. Ah, true - I was thinking of the Map contract which says (optionally) that Map.get would throw an NPE if given a null. HashMap, however, won't do that - though it might return null leading to your next scenario.
    But another possibility is that the Map does not contain a matching key, so get returns null. The value, being an Integer, is then auto-unboxed so that it can be compared with the primitive max, and that will throw a NullPointerException.

  • NullPointerException using when an Aggregator

    Hi,
    There seems to be a problem with the way my cache is setup and how it handles an aggregator.
    When the aggregator is run from my UT on my local machine, it seems to perform fine; however, when my aggregator is executed on a cache outside of the JVM of my test then the following NullPointerException is thrown.
    It really seems like the external cache may not have the necessary dependencies, that would naturally exist when the cache is started on the same JVM of the test.
    It seems like there may be a simple solution, but at the moment it is beyond me.
    Thank you kindly in advance,
    Mike Menne
    Portable(com.tangosol.util.WrapperException): (Wrapped: Failed request execution for DistributedCache service on Member(Id=1, Timestamp=2011-06-30 10:44:45.942, Address=10.29.9.91:8088, MachineId=7771, Location=site:na.ds.----------.com,machine:na1000-lasch2,process:5628, Role=IntellijRtExecutionAppMain)) null
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:36)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onAggregateFilterRequest(PartitionedCache.CDB:67)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$AggregateFilterRequest.run(PartitionedCache.CDB:1)
         at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)
         at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
         at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:63)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
         at <process boundary>
         at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:57)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3306)
         at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2603)
         at com.tangosol.coherence.component.net.extend.message.Response.readExternal(Response.CDB:20)
         at com.tangosol.coherence.component.net.extend.Codec.decode(Codec.CDB:29)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.decodeMessage(Peer.CDB:25)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:47)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: Portable(java.lang.NullPointerException)
         at com.tangosol.util.InvocableMapHelper.extractFromEntry(InvocableMapHelper.java:294)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage$BinaryEntry.extract(PartitionedCache.CDB:32)
         at com.tangosol.util.aggregator.AbstractAggregator.processEntry(AbstractAggregator.java:107)
         at com.tangosol.util.aggregator.AbstractAggregator.aggregate(AbstractAggregator.java:94)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onAggregateFilterRequest(PartitionedCache.CDB:46)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$AggregateFilterRequest.run(PartitionedCache.CDB:1)
         at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)
         at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
         at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:63)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
         at <process boundary>
         at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:57)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3306)
         at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2603)
         at com.tangosol.io.pof.PortableException.readExternal(PortableException.java:150)
         at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:58)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3306)
         at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2603)
         at com.tangosol.coherence.component.net.extend.message.Response.readExternal(Response.CDB:20)
         at com.tangosol.coherence.component.net.extend.Codec.decode(Codec.CDB:29)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.decodeMessage(Peer.CDB:25)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:47)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    Edited by: 869517 on Jul 6, 2011 10:03 AM

    Hi Mike,
    Hm, that is weird.
    Could you post a simple test case which reproduces it? A unit test source, cache and operation and POF configuration for the source and destination for all JVMs in the test (extend client, proxy node, cache server node if separate).
    Thanks and best regards,
    Robert

  • How to marshal List Source using JAXB and xjc?

    Hi all,
    I'm having problems to marshal objects of xjc generated java classes to xml output. In detail I am facing problems to use a list of sources (List<javax.xml.transform.Source>) that's been generated.
    The schema I am using is:
    <xs:complexType name="tTestAttachment">
    <xs:sequence>
    <xs:element name="textXML" type="xs:base64Binary" xmime:expectedContentTypes="text/xml" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="TestAttachment" type="tTestAttachment" />
    ...By using xjc the java classes are generated without problems. The expectedContentTypes="text/xml" results the generation of a List<Source> parameter for the class.
    public class TTestAttachment {
    @XmlMimeType("text/xml")
    protected List<Source> textXML;
    ...Now I want to test the generated classes and marshal an object I created by the following code
    StreamSource ssrc = new StreamSource("file:D:/temp/test.xml");
    attachment.getTextXML().add(ssrc);
    attachment.getTextXML().add(ssrc);
    ObjectFactory objFactory = new ObjectFactory();
    JAXBContext jc = JAXBContext.newInstance(TTestAttachment.class);
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    JAXBElement<TTestAttachment> jaxbelem = objFactory.createTestAttachment(attachment);
    marshaller.marshal(jaxbelem, new PrintWriter(System.out));
    ...But as return I just receive an error message, that StreamSource is not known to the context:
    javax.xml.bind.MarshalException
    - with linked exception:
    [javax.xml.bind.JAXBException: class javax.xml.transform.stream.StreamSource nor any of its super class is known to this context.]
    ...So now I made it known to the JAXBContext by adding it as parameter:
    JAXBContext jc = JAXBContext.newInstance(TTestAttachment.class);With the result, that I get an output but not as expected with content of the source inline but with the link to it.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns2:TestAttachment xmlns:ns2="http://www.example.com/schema01">
    <ns2:textXML xsi:type="streamSource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <systemId>file:D:/temp/test.xml</systemId>
    </ns2:textXML>
    <ns2:textXML xsi:type="streamSource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <systemId>file:D:/temp/test.xml</systemId>
    </ns2:textXML>
    </ns2:TestAttachment>A second idea was to leave the JAXBContext as it is and add the annotation @XmlList to the attribute of the generated java class. But that also does not lead to the expected result. It included the content of the source now but whitespace separated and not as single objects. The expected result should look some like this:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <TestAttachment xmlns="http://www.example.com/schema01">
    <textXML>PD94...sbzwvbWVzc2FnZT4=</textXML>
    <textXML>PD94...sbzwvbWVzc2FnZT4=</textXML>
    </TestAttachment>By the way - when I'm using a single "text/xml" mime type element (maxOccurs="1") in the based schema everything works fine. xjc generates a single attribute of type javax.transform.Source and the marshalling works out the expected way.
    Any suggestions on how to marshal the objects correctly?
    - Thanks in advance

    Hope this link help you -
    http://chakkaradeep.com/index.php/autohosted-sharepoint-apps-deep-dive-part-2/
    Also check this link, About Autohosted Apps Preview program
    http://blogs.msdn.com/b/calvarro/archive/2014/05/20/about-autohosted-apps-preview-program.aspx
    For production, it is recommended to convert Auto Hosted to Provider Hosted App, so better prepared for it now.
    http://msdn.microsoft.com/EN-US/library/office/dn722449(v=office.15).aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • NullPointerException in JAXB

    Hi all,
    I have a problem with JAXB. I installed the jwsdp-1_6-windows-i586.exe,
    and made some test running the xjc using the command line. It works fine,
    all Classes has been created and compiled. Furthermore I wanted to use it
    within eclipse. I created a new Project, copied all needed libs into it,
    but I got a NPE:
    E:\eclipse>E:\java\j2sdk1.4.2_04\bin\java -Djava.endorsed.dirs=E:\workspace\_internTestJAXB\lib;E:\workspace\_internTestJAXB\lib\endorsed -jar E:\workspace\_internTestJAXB\lib\jaxb-xjc.jar E:\workspace\_internTestJAXB\xsd\faa.xsd -p de.jaxb.bo -d E:\workspace\_internTestJAXB\src\
    parsing a schema...
    compiling a schema...
    Exception in thread "main" java.lang.NullPointerException
    at com.sun.tools.xjc.generator.SkeletonGenerator.generateStaticRuntime(SkeletonGenerator.java:238)
    at com.sun.tools.xjc.generator.SkeletonGenerator.<init>(SkeletonGenerator.java:130)
    at com.sun.tools.xjc.generator.SkeletonGenerator.generate(SkeletonGenerator.java:110)
    at com.sun.tools.xjc.Driver.generateCode(Driver.java:379)
    at com.sun.tools.xjc.Driver.run(Driver.java:220)
    at com.sun.tools.xjc.Driver._main(Driver.java:80)
    at com.sun.tools.xjc.Driver.access$000(Driver.java:46)
    at com.sun.tools.xjc.Driver$1.run(Driver.java:60)
    Someone an idea what's wrong?
    Thanks in advance,
    zzkozak

    It looks like a build path problem with your Eclipse project. Why not try an Ant script such as the following? It's much easier than using xjc from the command line.
    <?xml version="1.0" standalone="yes"?>
    <project name="DataExtract JAXB Build" basedir="." default="run">
         <description>
              Controls the JAXB XML schema and Java compilations and wraps the results into a JAR file.
        </description>
         <!-- Change this property to point to the JWSDP installation directory on your machine.  -->
         <property name="jwsdp.home" value="C:\Program Files\Java\jwsdp-1.6" />
         <path id="classpath">
              <pathelement path="src" />
              <fileset dir="${jwsdp.home}" includes="jaxb/lib/*.jar" />
              <fileset dir="${jwsdp.home}" includes="jwsdp-shared/lib/*.jar" />
              <fileset dir="${jwsdp.home}" includes="jaxp/lib/**/*.jar" />
         </path>
         <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
              <classpath refid="classpath" />
         </taskdef>
         <target name="run" description="Compile the XML schemas and all the Java source files they create.">
              <echo message="Compiling the Schema..." />
              <mkdir dir="tmpClasses" />
              <mkdir dir="tmpSource"/>
              <echo message="Doing forum.xsd..." />
              <xjc schema="forum.xsd" package="extract" target="tmpSource" />
              <echo message="Compiling the java source files..." />
              <javac srcdir="tmpSource" destdir="tmpClasses" debug="on" >
                   <classpath refid="classpath" />
              </javac>
              <echo message="Bundling the generated classes and source files into forum.jar"/>
              <jar destfile="forum.jar" update="true">
                   <fileset dir="tmpClasses"/>     
                   <fileset dir="tmpSource"/>
              </jar>
              <echo message="Cleaning up the working directories."/>          
              <delete dir="tmpClasses"/>
              <delete dir ="tmpSource"/>
         </target>
    </project>Copy this script into a file called build.xml within your Eclipse project. Change the value of jwsdp.home to the location of your JWSDP installation, and change the name of the Schema. With the script and the Schema in the same directory, right-click on the file and select Run As -> Ant Build.
    This script bundles the generated classes into a jar file and and then deletes the source. But, you can play around with it if you want to do something else.

Maybe you are looking for

  • Example of NI's Detailed Module/Board Repair Report

    Is an example available of NI's Detailed Module/Board Repair Report.  I am returning an SCXI-1581 module for repair under warranty due to a single channel being >25% out of spec.  A detailed repair report can be purchased from NI for $99.  I need to

  • OBIEE11g client configuration using odbc on windows 32

    Hi, I can able to install obiee11g on windows 32 but after installaion it points directly to odbc32 so from here how to go? can i go for System DSN or else what? Thanks in advance... Regards, Abs

  • Load BLOB column in Oracle to Image column in MS SQL Server

    Hi there, I have an Oracle table as the source and a MS SQL Server table as the target. A blob(4000) column in source is mapped with a Image(2147483647) column in target. The execution will give me error message "*java.lang.NumberFormatException: For

  • Dequeuing multiples messages in a PLSQL CallBack

    Hi all: I would like to dequeue multiples messages in a PLSQL CallBack for performance reason. Everything works fine, but I see that Oracle AQ sent the rest of the notifications messages to the callback independent of an empty queue. I added a table

  • Relatively slow display of pdf files?

    Hi: I've got an Oracle Text application that indexes and queries various file types fine, but the actual display of pdf files is pretty slow. On a 2.4GHz P4 w/1G Ram it took about 20 seconds to display it's version of a 2.5M pdf file. It takes < 10 s