NullPointerException when getting resources

Hi,
I am trying to build a simple program to get a file resource. The code is fairly simple, with the next method in mypackage.MyClass:
File someMethod(String filename) {
         String name =
              this.getClass().getResource(filename).getFile();
        File file = new File(name);
return file;
}The project is organised as follows:
/src - the sources directory
/bin - the binaries directory
/resources - the directory where my file exists, let's say testfile.html
I try to call someMethod("resources/testfile.html") or
someMethod("../resources/testfile.html").
Also tried to set the classpath in the .ant file:
  <path id="classpath.project">
     <pathelement path="${dir.build}"/>
     <pathelement location="resources"/>
  </path>and then call someMethod("testfile.html").
Every time I get NullPointerException, IDE or command line.
Thanks for help!
l.

Hi,
I am trying to build a simple program to get a file
resource. The code is fairly simple, with the next
method in mypackage.MyClass:
File someMethod(String filename) {
String name =
this.getClass().getResource(filename).getFile();
File file = new File(name);
return file;
}The project is organised as follows:
/src - the sources directory
/bin - the binaries directory
/resources - the directory where my file exists, let's
say testfile.html
I try to call someMethod("resources/testfile.html") or
someMethod("../resources/testfile.html").
Also tried to set the classpath in the .ant file:
<path id="classpath.project">
<pathelement path="${dir.build}"/>
<pathelement location="resources"/>
</path>and then call someMethod("testfile.html").
Every time I get NullPointerException, IDE or command
line.
Thanks for help!
l.try the following:
String name = ClassLoader.getSystemClassLoader().getResource("../resources/" + filename).getFile();In the API you can find:
public URL getResource(String name)
Finds a resource with a given name. This method returns null if no resource with this name is found. The rules for searching resources associated with a given class are implemented by the * defining class loader of the class.
This method delegates the call to its class loader, after making these changes to the resource name: if the resource name starts with "/", it is unchanged; otherwise, the package name is prepended to the resource name after converting "." to "/". If this object was loaded by the bootstrap loader, the call is delegated to ClassLoader.getSystemResource.
The fact that the package is prepended to the resource might cause many problems
(as it also did within my project).
Remark that the .. might also cause problems (since I'm not sure if this is 100% pure java
or if this is 100% windows). I guess you should parse the filename in order to find the parent-directory.
kind regards,

Similar Messages

  • Java.lang.NullPointerException: When Get the PDF File Name

    Hi,
    i try to follow the blog on <b>Handling FileUpload and FileDownload in NetWeaver Developer Studio(NWDS) 2004S</b> on /people/rekha.malavathu2/blog/2006/12/12/handling-fileupload-and-filedownload-in-netweaver-developer-studionwds-2004s
    as i create a fileupload and i wish to get the file name and the pdf, then i to run and deploy it but i get <b>java.lang.NullPointerException</b>
    the code are as below when i click on send email button
    IPrivateEmail.IFileUploadNodeNode node = wdContext.nodeFileUploadNode();
    IPrivateEmail.IFileUploadNodeElement fileUploadEle = node.createFileUploadNodeElement();
         try{
         IWDResource resource = WDResourceFactory.createResource(wdContext.currentContextElement().getFileUploadUI().read(true), wdContext.currentContextElement().getFileUploadUI().getResourceName(), WDWebResourceType.PDF, true);
         fileUploadEle.setFileUploadAttr(resource);
         fileUploadEle.setFileUploadName(wdContext.currentContextElement().getFileUploadUI().getResourceName());
         node.addElement(fileUploadEle);
         }catch(Exception e){
         wdComponentAPI.getMessageManager().reportSuccess("ERROR"+e.getMessage());
    but i wonder which part of the code i did wrongly.. as i wish to insert into my send email code
    Properties props = new Properties();
              String host = "SMTP HOST";
              props.put("mail.smtp.host", host);
              Session session = Session.getInstance(props, null);
              MimeMessage message = new MimeMessage(session);
              Address toAddress = new InternetAddress();
              Address fromAddress = new InternetAddress();
              Address ccAddress = new InternetAddress();
              Address bccAddress = new InternetAddress();
              try
                   MimeMultipart multipart = new MimeMultipart();
                   BodyPart messageBodyPart = new MimeBodyPart();
                   if (! wdContext.currentEmailElement().getFrom().equals(""))
                        fromAddress = new InternetAddress(wdContext.currentEmailElement().getFrom());               
                        message.setFrom(fromAddress);
                   if (! wdContext.currentEmailElement().getTo().equals(""))
                        toAddress = new InternetAddress(wdContext.currentEmailElement().getTo());
                        message.setRecipient(Message.RecipientType.TO, toAddress);
                   if (! wdContext.currentEmailElement().getCc().equals(""))
                        ccAddress = new InternetAddress(wdContext.currentEmailElement().getCc());
                        message.setRecipient(Message.RecipientType.CC, ccAddress);
                   if (! wdContext.currentEmailElement().getBcc().equals(""))
                        bccAddress = new InternetAddress(wdContext.currentEmailElement().getBcc());
                        message.setRecipient(Message.RecipientType.BCC, bccAddress);
                   if (! wdContext.currentEmailElement().getSubject().equals(""))
                        message.setSubject(wdContext.currentEmailElement().getSubject());
                   if (! wdContext.currentEmailElement().getBody().equals(""))
                        messageBodyPart.setText(wdContext.currentEmailElement().getBody());
                   multipart.addBodyPart(messageBodyPart);
                   messageBodyPart = new MimeBodyPart();
                   String filename = IWDResource.getResourceName();
                   DataSource source = new FileDataSource(filename);
                   messageBodyPart.setDataHandler(new DataHandler(source));
                   messageBodyPart.setFileName(source.getName());                    
                   messageBodyPart.setHeader("Content-Type","application/pdf");
                   multipart.addBodyPart(messageBodyPart);
                   message.setContent(multipart);
                   Transport.send(message);
              catch (AddressException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (SendFailedException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (MessagingException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
    so i wonder could anyone help me out.. as i need to get the pdf filename order to put into the variable call <b>filename</b> at the send mail code.
    below is the error message
    java.lang.NullPointerException
         at com.sap.example.uploademail.Email.wdDoInit(Email.java:124)
         at com.sap.example.uploademail.wdp.InternalEmail.wdDoInit(InternalEmail.java:146)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    facing same issue.
    jdev 10.1.3.3.0, on expanding the database connection, I get a null pointer exception.
    On the testing the connection it says 'success' though.
    any inputs ?

  • Nullpointerexception when running testsuite via Ant task

    I get a NullPointerException when trying to execute a testsuite via a commandline Ant task.
    The Nullpointerexception is occuring at the line:
    oracle.v2.parser.DOMLocator.getSystemId()
    Here the full trace of the execution (debug)
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    M:\>c:
    C:\>cd \projects\aorta_bpel\src\MWPEmailDispatcher
    C:\projects\aorta_bpel\src\MWPEmailDispatcher>ant deployProcess test -verbose
    Apache Ant version 1.6.5 compiled on June 2 2005
    Buildfile: build.xml
    Detected Java version: 1.4 in: C:\j2sdk1.4.2_08\jre
    Detected OS: Windows XP
    parsing buildfile C:\projects\aorta_bpel\src\MWPEmailDispatcher\build.xml with URI = file:///C:/proj
    ects/aorta_bpel/src/MWPEmailDispatcher/build.xml
    Project base dir set to: C:\projects\aorta_bpel\src\MWPEmailDispatcher
    [xmlproperty] Loading C:\projects\aorta_bpel\src\MWPEmailDispatcher\bpel\bpel.xml
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.partnerLinkBindings.partnerLinkB
    inding.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(name)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property(encryption)
    Overriding previous definition of property BPELSuitcase.BPELProcess.preferences.property
    [property] Loading Environment env.
    Property ${env.BPEL_HOME} has not been set
    Property ${env.BPEL_HOME} has not been set
    [available] Unable to find ${env.BPEL_HOME}\utilities\ant-orabpel.xml
    [property] Loading C:\projects\aorta_bpel\src\MWPEmailDispatcher\build.properties
    Importing file C:/oracle/product/10.1.3.1/OracleAS_1/bpel/utilities/ant-orabpel.xml from C:\projects
    \aorta_bpel\src\MWPEmailDispatcher\build.xml
    parsing buildfile C:\oracle\product\10.1.3.1\OracleAS_1\bpel\utilities\ant-orabpel.xml with URI = fi
    le:///C:/oracle/product/10.1.3.1/OracleAS_1/bpel/utilities/ant-orabpel.xml
    Importing file ant-deployapps.xml from C:\oracle\product\10.1.3.1\OracleAS_1\bpel\utilities\ant-orab
    pel.xml
    parsing buildfile C:\oracle\product\10.1.3.1\OracleAS_1\bpel\utilities\ant-deployapps.xml with URI =
    file:///C:/oracle/product/10.1.3.1/OracleAS_1/bpel/utilities/ant-deployapps.xml
    [property] Loading C:\oracle\product\10.1.3.1\OracleAS_1\bpel\utilities\ant-orabpel.properties
    Override ignored for property bpel.home
    Override ignored for property oracle.home
    Override ignored for property admin.password
    Override ignored for property http.port
    dropping C:\oracle\product\10.1.3.1\OracleAS_1\bpel\system\appserver\oc4j\j2ee\home\lib\oc4j-interna
    l.jar from path as it doesn't exist
    parsing buildfile jar:file:/C:/oracle/product/10.1.3.1/OracleAS_1/bpel/lib/orabpel-ant.jar!/com/coll
    axa/cube/ant/orabpel-antlib.xml with URI = jar:file:/C:/oracle/product/10.1.3.1/OracleAS_1/bpel/lib/
    orabpel-ant.jar!/com/collaxa/cube/ant/orabpel-antlib.xml
    [property] Loading C:\oracle\product\10.1.3.1\OracleAS_1\bpel\utilities\ant-orabpel.properties
    Override ignored for property platform
    Override ignored for property verbose
    Override ignored for property j2ee.home
    Override ignored for property apps
    Override ignored for property orabpel.db.user
    Override ignored for property bpel.home
    Override ignored for property opmn.requestport
    Override ignored for property bpeltest.numWorkers
    Override ignored for property jndi.user
    Override ignored for property bpel.version
    Override ignored for property http.hostname
    Override ignored for property j2ee.hostname
    Override ignored for property oracle.home
    Override ignored for property jndi.password
    Override ignored for property bpeltest.minCoverage
    Override ignored for property admin.user
    Override ignored for property hostname
    Override ignored for property domain
    Override ignored for property orabpel.db.connect_string
    Override ignored for property bpeltest.timeout
    Override ignored for property jndi.url
    Override ignored for property soapServerUrl
    Override ignored for property rmi.port
    Override ignored for property admin.password
    Override ignored for property orabpel.db.password
    Override ignored for property cluster
    Override ignored for property rev
    Override ignored for property client.classpath
    Override ignored for property http.port
    Override ignored for property jndi.InitialContextFactory
    Override ignored for property bpeltest.results.dir
    Override ignored for property bpel.build
    Override ignored for property bpeltest.package
    Override ignored for property asinstancename
    Override ignored for property default-web-app.dir
    Override ignored for property oc4jinstancename
    [available] Unable to find pre-build.xml
    [available] Unable to find post-build.xml
    Build sequence for target(s) `deployProcess' is [deployProcess]
    Complete build sequence is [deployProcess, deployOc4j, deployBindWebAppOc4j, deployIas_10gR3, deploy
    BindWebAppIas_10gR3, deployIas_10gR2, deployBindWebAppIas_10gR2, prepareTests, pre-build, validateTa
    sk, compile, deployTaskForm, deployDecisionServices, process-deploy, post-build, deploy, deployNonOr
    aclej2ee, setJndiUrlOrclej2ee, deployIas, setJndiUrlIas, deployBindWebAppIas, deployTestSuites, bpel
    Test, report, test, deploy_test, schemac, setJndiUrlOc4j, build_ear, deployOraclej2ee, ]
    deployProcess:
    [echo]
    [echo] --------------------------------------------------------------
    [echo] | Deploying bpel process MWPEmailDispatcher on localhost, port 7777
    [echo] --------------------------------------------------------------
    [echo]
    [deployProcess] Deploying process C:\projects\aorta_bpel\src\MWPEmailDispatcher\output\bpel_MWPEmail
    Dispatcher_1.0.jar
    [deployProcess] Successfully deployed the process "MWPEmailDispatcher" on server "localhost" and por
    t "7777"
    Build sequence for target(s) `test' is [prepareTests, deployTestSuites, bpelTest, report, test]
    Complete build sequence is [prepareTests, deployTestSuites, bpelTest, report, test, deployOc4j, depl
    oyBindWebAppOc4j, deployIas_10gR3, deployBindWebAppIas_10gR3, deployIas_10gR2, deployBindWebAppIas_1
    0gR2, pre-build, validateTask, compile, deployProcess, deployTaskForm, deployDecisionServices, proce
    ss-deploy, post-build, deploy, deployNonOraclej2ee, setJndiUrlOrclej2ee, deployIas, setJndiUrlIas, d
    eployBindWebAppIas, deploy_test, schemac, setJndiUrlOc4j, build_ear, deployOraclej2ee, ]
    prepareTests:
    [echo]
    [echo] --------------------------------------------------------------
    [echo] | Preparing BPEL tests for deployment
    [echo] --------------------------------------------------------------
    [echo]
    [delete] Deleting: C:\projects\aorta_bpel\src\MWPEmailDispatcher\output\bpeltest.zip
    [zip] Building zip: C:\projects\aorta_bpel\src\MWPEmailDispatcher\output\bpeltest.zip
    [zip] adding entry regression_tests/testContainsSubjectP1WithAttachm.xml
    [zip] adding entry regression_tests/testEmptySubject.xml
    [zip] adding entry regression_tests/testEmptySubjectNoBodyPart.xml
    [zip] adding entry regression_tests/testEmptySubjectWithAttachm.xml
    [zip] adding entry regression_tests/testNominalP1214Meetdatavalide.xml
    [zip] adding entry regression_tests/testNominalP1214MeetdatavalideWithAttachm.xml
    [zip] adding entry regression_tests/testNominalP1217aMeetdatavalide.xml
    [zip] adding entry regression_tests/testNominalP1217aMeetdatavalideWithAttachm.xml
    [zip] adding entry regression_tests/testNominalP1WithAttachm.xml
    [zip] adding entry regression_tests/testP1WithBody.xml
    [zip] adding entry regression_tests/testRTFP1214Meetdatavalide.xml
    [zip] adding entry regression_tests/testRTFP1217Meetdatavalide.xml
    deployTestSuites:
    [echo]
    [echo] --------------------------------------------------------------
    [echo] | Deploying bpel tests MWPEmailDispatcher on localhost, port 7777
    [echo] --------------------------------------------------------------
    [echo]
    [deployTestSuites] bpeltest.zip deployed successfully.
    bpelTest:
    [echo]
    [echo] --------------------------------------------------------------
    [echo] | Executing process MWPEmailDispatcher(v.1.0): minCoverage=100%, timeout=90 sec, numWork
    ers=1
    [echo] --------------------------------------------------------------
    [echo]
    [delete] Deleting directory C:\oracle\product\10.1.3.1\OracleAS_1\j2ee\home\default-web-app\resul
    ts\xml\MWPEmailDispatcher
    [delete] Deleting directory C:\oracle\product\10.1.3.1\OracleAS_1\j2ee\home\default-web-app\resul
    ts\xml\MWPEmailDispatcher
    [bpeltest] XML-22000: (Fatal Error) Error while parsing XSL file ({0}).
    BUILD FAILED
    C:\projects\aorta_bpel\src\MWPEmailDispatcher\build.xml:181: java.lang.NullPointerException
    at org.apache.tools.ant.Task.perform(Task.java:373)
    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)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.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.NullPointerException
    at oracle.xml.parser.v2.DOMLocator.getSystemId(DOMLocator.java:115)
    at javax.xml.transform.TransformerException.getMessageAndLocation(TransformerException.java:
    210)
    at com.collaxa.cube.ant.taskdefs.BpelTest.createJUnitReport(BpelTest.java:741)
    at com.collaxa.cube.ant.taskdefs.BpelTest.createReport(BpelTest.java:877)
    at com.collaxa.cube.ant.taskdefs.BpelTest.execute(BpelTest.java:1033)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    ... 10 more
    --- Nested Exception ---
    java.lang.NullPointerException
    at oracle.xml.parser.v2.DOMLocator.getSystemId(DOMLocator.java:115)
    at javax.xml.transform.TransformerException.getMessageAndLocation(TransformerException.java:
    210)
    at com.collaxa.cube.ant.taskdefs.BpelTest.createJUnitReport(BpelTest.java:741)
    at com.collaxa.cube.ant.taskdefs.BpelTest.createReport(BpelTest.java:877)
    at com.collaxa.cube.ant.taskdefs.BpelTest.execute(BpelTest.java:1033)
    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)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.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)
    Total time: 1 minute 39 seconds
    C:\projects\aorta_bpel\src\MWPEmailDispatcher>

    I had this same issue, and after almost a month, finally found the solution...
    The <bpletest> task needs reference to an xls like:
    <!-- xsl="${bpel.home}/system/console/xslt/bpeltest-junit.xsl" was missing from <bpeltest> declaration -->
    <!-- "bpeltest" target runs deployed testsuites of a BPEL process -->
    <target name="bpelTest">
    <echo>
    | Executing BPEL Tests Process ${process.name} on:
    |
    | * user="${admin.user}" password="${admin.password}"
    | * hostname="${http.hostname}" httpport="${http.port}"
    | * domain="${domain}" process="${process.name}"
    | * rev="${rev}" name="${process.name}Tests"
    | * timeout="${bpeltest.timeout}"
    | * numWorkers="${bpeltest.numWorkers}"
    | * minCoverage="${bpeltest.minCoverage}"
    | * callHandler="${bpeltest.callHandler}"
    | * context="${bpel.context.properties}"
    | * resultsDir="${bpeltest.results.dir}/xml/${process.name}"
    | * resultsPropertyFile="${bpeltest.results.dir}/${process.name}.properties"
    | * verbose="${verbose}"
    | * xsl="${bpel.home}/system/console/xslt/bpeltest-junit.xsl"
    |
    </echo>
    <delete dir="${bpeltest.results.dir}/xml/${process.name}" quiet="true"/>
    <bpeltest
    user="${admin.user}" password="${admin.password}"
    hostname="${http.hostname}" httpport="${http.port}"
    domain="${domain}" process="${process.name}"
    rev="${rev}" name="${process.name}Tests"
    timeout="${bpeltest.timeout}"
    numWorkers="${bpeltest.numWorkers}"
    minCoverage="${bpeltest.minCoverage}"
    callHandler="${bpeltest.callHandler}"
    context="${bpel.context.properties}"
    resultsDir="${bpeltest.results.dir}/xml/${process.name}"
    resultsPropertyFile="${bpeltest.results.dir}/${process.name}.properties"
    verbose="${verbose}"
    xsl="${bpel.home}/system/console/xslt/bpeltest-junit.xsl"
    />
                   <!--<classpath>
                        <pathelement path="${bpeltest.results.dir}/xsl/bpeltest-junit.xsl" />
                        <pathelement path="${project.root}/tools/build-tools/src/main/resources/bpel" />
                        <pathelement path="C:/viewstore/esp_lynx_dap/esp/dap/tools/build-tools/src/main/resources/bpel/bpeltest-junit.xsl" />
                        <pathelement path="C:/viewstore/esp_lynx_dap/esp/dap/tools/build-tools/src/main/resources/bpel/com/collaxa/cube/ant" />
                   </classpath>
              </bpeltest>-->
    <property file="${bpeltest.results.dir}/${process.name}.properties"/>
    <echo>
    Executed ${test.total.count} test(s) for ${process.name} (v.${rev}) with
    ${test.failure.count} failure(s)
    </echo>
    </target>

  • Missing version field in response from server when accessing resource

    HY
    I have a problem to use the version option of the webstart. All files are included into a war file (created with jar cvf xx.war *). This file is in the webapps folder of the Tomcat 5. The jar files from the dev. kit (jnlp-servlet.jar, jaxp.jar, parser.jar are in the WEB-INF/lib folder).
    Every time I get the same message:
    Category: Download Error
    Missing version field in response from server when accessing resource: (http://localhost:8080/version/ademo.jar, 1.1)
    Do I need a aditional file or must Iwrite a servlet???
    Whats wrong
    my JNLP file
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File fuer HJP3 WebStart Demo-Applikation -->
    <jnlp codebase="http://localhost:8080/version/" href="wstest.jnlp">
    <information>
    <title>HJP3 WebStart Demo Application</title>
    <vendor>Guido Krueger</vendor>
    <homepage href="http://www.javabuch.de"/>
    <description>HJP3 WebStart Demo Application</description>
    <icon href="wstest.gif"/>
    <offline-allowed/>
    </information>
    <information locale="de">
    <description>HJP3 WebStart Demo-Applikation</description>
    <offline-allowed/>
    </information>
    <security>
    <!-- <all-permissions/> //-->
    </security>
    <resources>
    <j2se version="1.4+"/>
    <jar href="ademo.jar" version="1.1"/>
    </resources>
    <application-desc main-class="Listing3813"/>
    </jnlp>
    my version.xml file
    <jnlp-versions>
    <resource>
    <pattern>
    <name>ademo.jar</name>
    <version-id>1.1</version-id>
    </pattern>
    <file>application.jar</file>
    </resource>
    </jnlp-versions>
    my web.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
         <servlet>
              <servlet-name>JnlpDownloadServlet</servlet-name>
              <servlet-class>com.sun.javaws.servlet.JnlpDownloadServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>JnlpDownloadServlet</servlet-name>
              <url-pattern>*.jnlp</url-pattern>
         </servlet-mapping>
    </web-app>

    The log file (jnlpdownloadservlet.log) would show the calls for the jar files if the servlet is called for the jar files (did you correct the url mapping ?). Here are a few lines from a log file
    JnlpDownloadServlet(4): Initializing
    JnlpDownloadServlet(3): Request: /maportal/wfe/wfeguiv.jnlp
    JnlpDownloadServlet(3): User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
    JnlpDownloadServlet(4): DownloadRequest[path=/wfe/wfeguiv.jnlp isPlatformRequest=false]
    JnlpDownloadServlet(4): Basic Protocol lookup
    JnlpDownloadServlet(4): JnlpResource: JnlpResource[WAR Path: /wfe/wfeguiv.jnlp lastModified=Tue Mar 23 17:06:56 CET 2004]]
    JnlpDownloadServlet(3): Resource returned: /wfe/wfeguiv.jnlp
    JnlpDownloadServlet(4): lastModified: 1080058016000 Tue Mar 23 17:06:56 CET 2004
    JnlpDownloadServlet(3): Request: /maportal/wfe/wfegui.gif
    JnlpDownloadServlet(3): User-Agent: JNLP/1.0.1 javaws/1.4.2_03 (b02) J2SE/1.4.2_03
    JnlpDownloadServlet(4): DownloadRequest[path=/wfe/wfegui.gif isPlatformRequest=false]
    JnlpDownloadServlet(3): Request: /maportal/wfe/wfegui.jar
    JnlpDownloadServlet(3): User-Agent: JNLP/1.0.1 javaws/1.4.2_03 (b02) J2SE/1.4.2_03
    JnlpDownloadServlet(4): DownloadRequest[path=/wfe/wfegui.jar isPlatformRequest=false]
    JnlpDownloadServlet(4): Basic Protocol lookup
    JnlpDownloadServlet(4): JnlpResource: JnlpResource[WAR Path: /wfe/wfegui.jar lastModified=Tue Mar 23 17:06:30 CET 2004]]
    JnlpDownloadServlet(3): Resource returned: /wfe/wfegui.jarYou should see all the resources (including jar files) being requested, and whether a specific version was requested or not (in above sample, not).
    I put my problems down to my application server (Orion) as other people seem to have this working. The deployment in Orion keeps the original timestamps of the jars, so I explicitly set the timestamps in my build so that the unchanged jars do not have to be downloaded all the time. This is not really a good solution, so maybe someone else can give further advice.
    Brendan

  • NullPointerException when trying to load faces application

    Hi,
    I'm new with JSF and I have a NullPointerException when trying to use a JSF tag in my file.
    My web.xml is defined as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    </web-app>
    And faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    The exception that I get is:
    java.lang.NullPointerException
         javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
         org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
    (HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    I guess that it's a matter of configuration, but couldn't find a solution.
    Can someone help?
    Thanks,
    Efrat

    well i think you will need
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    in you web.xml as well can be server or client state save but quite sure you have to define that

  • Java.lang.NullPointerException when trying to compile

    Hi everybody!
    I'm trying to compile a file using javax.tools.JavaCompiler but I get a java.lang.NullPointerException when running the program.
    Here is my code:
    public boolean CompExecFile(File filename){
              boolean compRes = false;
              try {
                   System.out.println(filename.getAbsolutePath());
                   JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
                   StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); //line where I get the error
                   Iterable<? extends JavaFileObject> compilationUnits2 = fileManager.getJavaFileObjects(filename);
                   compRes = compiler.getTask(null, fileManager, null, null, null, compilationUnits2).call();
                   fileManager.close();
                 if (compRes) {
                     System.out.println ("Compilation was successful");
                 } else {
                     System.out.println ("Compilation failed");
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return compRes;
         }There error on the line "StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);":
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException+
    I've seen several examples using the parameters "null,null,null" but I don't know if it's good :(
    Many thanks for your help.

    I've found something which could maybe be what I need to do but I'm not sure:
    // Build a new ClassLoader using the given URLs, replace current Classloader
    ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
    ClassLoader newCL = new URLClassLoader(myClasspathURLs, oldCL);
    Thread.currentThread().setContextClassLoader(newCL);
    System.out.println("Successfully replaced ClassLoader");
    Class fooClass = newCL.loadClass(appClass); //which replaces the line "Class<?> tempFileClass = Class.forName("TempFile");" ?!Is that what I need to do?
    EDIT: I've tried that but I still have the same problem:
                      File classFile = new File ("TempFile.class");
                      ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
                      ClassLoader newCL = new URLClassLoader(new URL[] {classFile.toURL()}, oldCL);
                      Thread.currentThread().setContextClassLoader(newCL);
                      System.out.println("Successfully replaced ClassLoader");
                      Class tempFileClass = newCL.loadClass("TempFile");
                      Method main = tempFileClass.getMethod("main", String[].class);
                      main.invoke(null,new String[0]); Edited by: Foobrother on Jul 28, 2008 8:18 AM

  • Java.lang.NullpointerException when use source table as a mapping component

    Hi all,
    I am new to owb and I got NullPointerException when I try to drag a table to my mapping.
    The table is imported and it's from a windows oracle database. The mapping is located on my linux oracle database.
    By the way, I can even deploy the table.
    What have I done wrong and why this happen?
    thanks in advance.
    帖子经 953800编辑过

    Hi Timo,
    Thanks for the reply,
    If I understand correctly I need to apply to the weblogic server 10.3.5 + Sherman patch UPDATE1 patch #12979653 and patch #12917525. After this the ADF Runtime 11.1.1.5 installed in the Production environments will allow me to run my application that is running in ADF Runtime 11.1.2.1. right?
    I'm working on getting this patches installed. Thank you very much for your help.
    I run the test on my local server as a test class and as a web service, it worked perfect, nevertheless in the Production environment I got a interesting answer:
    Production 1 and 2:
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getVersion/>
    </env:Body>
    </env:Envelope>
    Response
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
    <faultcode>S:Server</faultcode>
    <faultstring>oracle/jbo/Version</faultstring>
    </S:Fault>
    </S:Body>
    </S:Envelope>
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getBuildLabel/>
    </env:Body>
    </env:Envelope>
    Response:
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <ns2:getBuildLabelResponse xmlns:ns2="http://model/">
    <return>oracle.jbo.Version</return>
    </ns2:getBuildLabelResponse>
    </S:Body>
    </S:Envelope>
    Edited by: 917852 on Jul 12, 2012 11:31 AM

  • Java.lang.NullPointerException when instantiating VORowImpl

    Hi , I am trying to extend a controller where I want to get an attribute value from a View object. I initiate the VO and then use vo.first() to get RowImpl. But I get NullPointerException when i use the extended CO in the page pointing to the line where I use VoRowImpl. Below is the code of ProcessFormRequest():
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAApplicationModule oarootam = oapagecontext.getRootApplicationModule();
    oarootam.invokeMethod("initExpenseReportHeadersVO");
    ExpenseReportHeadersVOImpl vo = (ExpenseReportHeadersVOImpl)oaapplicationmodule.findViewObject("ExpenseReportHeadersVO");
    ExpenseReportHeadersVORowImpl row = (ExpenseReportHeadersVORowImpl)vo.first(); //Error stack points to this line
    Number empId = null;
    if(row!=null){
    empId = (Number)row.getAttribute("EmployeeId");
    Please help me out.
    Regards,
    Gowthami.

    Looks like you are using OA Framework. Please ask on their forum {forum:id=210}
    Timo

  • Java.lang.NullPointerException when trying to start UM

    I get java.lang.NullPointerException when I try to start Unified Messaging using EM on a new Windows 2000 single-box installation. Has anyone enountered this problem?

    I have also encountered same issue. Please let me know the solution in case you find it.
    In fact after configuiring Oracle files as per the document provided at Oracle OTN site 'Collaboration handbook', I am unable to connect OID. As per log it says
    2003/04/01:20:37:58[Oidmon]: Unable to connect to database, will retry after 20 sec
    2003/04/01:21:20:21Starting Monitor Process, PID=2920
    2003/04/01:21:20:21ORACLE_SID not set, setting to iasdb
    2003/04/01:21:41:22Failed to fetch Process Table. ORA-12571: TNS:packet writer failure
    I checked Listener, which was found ok, then I checked TNSPING, which executed ok.
    I have dowloaded documents troubleshooting OID, but no success. The document itself says that architecture of OID is fairly complex and the log does not suggest much insight.
    Any solution?
    Regards,
    Vipul

  • Java.lang.NullPointerException when doing SQL on ms access

    I am trying to perform Insert and delete commands on an access database and I continue to get a java.lang.NullPointerException when performing the action. Everything is fine when i do a Select * FROM..., I am able to read all of the information I ask for, but when performing the Insert/Delete commands I get the error. Any help would be appreciated, I will copy and past a portion of my code below. All of the fields and variable types match with what is in the database.
    public void executeAddSecretary() throws SQLException{
    String a,b;
    a= txtSecLname.getText();
    b= txtSecFname.getText();
    statement.execute("INSERT INTO Contact_Sec (Sec_Lname,Sec_Fname) Values ('" + a + "', '" + b + "')");
    System.out.println("updated Secretary");
    public void executeDeleteContact() throws SQLException{
    String a = "a";
    statement.execute("DELETE FROM Contact WHERE Lname = ('" + a + "')");
    System.out.println("deleted contact");
    Thanks to anyone who can help me out.

    1) Use prepared statement instead of statement.
    2) Do like this ...
    PreparedStatement prepStmt = null;
    try
         String query="INSERT INTO Contact_Sec (Sec_Lname,Sec_Fname) Values (?,?)");
         prepStmt = connection.prepareStatement(query);
         prepStmt.setString(1, value1);
         prepStmt.setString(2, value2);
         prepStmt.executeUpdate();
    catch (SQLException e)
         throw e;
    catch (Exception e)
         throw e;
    finally
         try
              if (prepStmt != null)
                   prepStmt.close();
         } catch (Exception e) {}
         try
              if (connection != null)
                   connection.close();
         } catch (Exception e) {}
    }3) If you still get the null exception then put step wise System.out's
    and debug it.
    -Rohit

  • NullPointerException when using sharedNode in XML menu (jdev 11.1.1.3)

    I am using Jdeveloper 11.1.1.3 and when I use a sharedNode in my ADF XMLMenu, I get a NullPointerException when I start the application for the first time. I know it's the sharedNode because when I remove it i don't get the exception.
    Apparently something is not propertly initialized at startup, when I reload the page everything is fine. How can I fix this?
    java.lang.NullPointerException
         at org.apache.myfaces.trinidad.model.XMLMenuModel.getFocusRowKey(XMLMenuModel.java:302)
         at org.apache.myfaces.trinidad.component.UIXNavigationHierarchy.getFocusRowKey(UIXNavigationHierarchy.java:79)
         at oracle.adfinternal.view.faces.renderkit.rich.BreadCrumbsRenderer._getItemCount(BreadCrumbsRenderer.java:403)
         at oracle.adfinternal.view.faces.renderkit.rich.BreadCrumbsRenderer.encodeAll(BreadCrumbsRenderer.java:130)

    Hm I got it. I also have nested templates and in the outer template I had a breadcrumb referencing the sharedNode menu. Somehow this caused a NullPointerException. The breadcrumb was never meant to reference that menu in the first place so I changed it, but it is still a weird situation, maybe worth a testcase...

  • NullPointerException when running TopLink

    Hi. I'm working through the ADF tutorial for JDeveloper. I keep running into a NullPointerException when I try to complete the TopLink step
    java.lang.NullPointerException
         at oracle.ideimpl.log.TabbedLogManager.getMsgPage(TabbedLogManager.java:101)
         at oracle.toplink.addin.log.POJOGenerationLoggingAdapter.updateTask(POJOGenerationLoggingAdapter.java:42)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.fireTaskUpdated(MappingCreatorImpl.java:1102)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:269)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:206)
         at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:401)
         at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
         at java.lang.Thread.run(Thread.java:595)
    If I click OK, the JDeveloper shows a dialog box as if it's doing some work. This just runs indefinitely and never does anything. I've tried the tutorial a couple of times with the same problem at this step. Help!! I'm getting very frustrated and don't know what's going on.

    Thanks for your reply, user640530. No, this is XP Pro. It seems to be having trouble from the Java class connecting to the db; however, the db connection by itself works fine. Not sure what to do next. Help!!

  • NullPointerException when opening a script in SQL Developer 4.0.0.12

    I recently upgraded to SQL Developer v.4.0.0.12 64 bit, and am running into some issues.
    I am running this on 64 bit Windows 7. I have a 64 bit Oracle 11, and in addition have the 32 bit oracle client installed.
    I made an association between the .sql file extension and sqldeveloper64W.exe.
    However I frequently get a nullpointerexception when clicking on a script in the file explorer.
    It seems to occur mostly if I loaded scripts into SQL Developer before.
    If I close all the windows before closing SQL Developer and then click on a script in the file manager, things work (startup is arguably slower than v.3).
    But in most cases either nothing happens, or I get the NullPointerException below.
    What am I doing wrong?
    Regards,
    Wim
    java.lang.NullPointerException
      at oracle.dbtools.raptor.plsql.FindHighlightListener.editorDeactivated(FindHighlightListener.java:63)
      at com.oracle.jdeveloper.nbwindowsystem.NbEditorManager.fireEditorEvent(NbEditorManager.java:1315)
      at com.oracle.jdeveloper.nbwindowsystem.NbEditorManager.handleEditorEvent(NbEditorManager.java:1294)
      at com.oracle.jdeveloper.nbwindowsystem.NbEditorManager.whenCurrentEditorChanges(NbEditorManager.java:1556)
      at com.oracle.jdeveloper.nbwindowsystem.editor.TabGroup.whenCurrentEditorChanges(TabGroup.java:1026)
      at com.oracle.jdeveloper.nbwindowsystem.editor.TabGroup.setCurrentTabGroupState(TabGroup.java:847)
      at com.oracle.jdeveloper.nbwindowsystem.editor.TabGroup.addTabGroupState(TabGroup.java:129)
      at com.oracle.jdeveloper.nbwindowsystem.NbEditorManager.createEditor(NbEditorManager.java:534)
      at com.oracle.jdeveloper.nbwindowsystem.NbEditorManager.createEditor(NbEditorManager.java:511)
      at com.oracle.jdeveloper.nbwindowsystem.NbEditorManager.openEditor(NbEditorManager.java:379)
      at oracle.ide.cmd.OpenCommand.openWithNoProject(OpenCommand.java:337)
      at oracle.ide.cmd.OpenCommand.access$100(OpenCommand.java:62)
      at oracle.ide.cmd.OpenCommand$1.run(OpenCommand.java:266)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
      at java.awt.EventQueue.access$200(EventQueue.java:103)
      at java.awt.EventQueue$3.run(EventQueue.java:694)
      at java.awt.EventQueue$3.run(EventQueue.java:692)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
      at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
      at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

    Please refer to this White paper for how to generate PL/SQL package for workflow deployment:
    Oracle Data Miner (Extension of SQL Developer 4.0)
    Generate a PL/SQL script for workflow deployment
    http://www.oracle.com/technetwork/database/options/advanced-analytics/odmrcodegenwhitepaper-2042206.pdf

  • NullPointerException when deeplinking with extended VO

    Hey guys.
    Im having a problem with deeplinking. I have deeplinking working fine in JHS but when I extend the VO of the detail group that is being deep linked to I get a nullpointer exception. The extended VO doesnt have any extra functionality at this stage. All the attributes of the extended VO are the same. e.g. the base VO im using is EmployeesView and im deeplinking using the key expression #{param.ID}. The extended VO is EmployeesViewExt and has no extra features and the key expression is still #{param.ID} but I get a null pointer exception when I try to generate. Is the key expression correct for an extended VO even though the attribute names havent changed?
    Has anyone had this problem before?

    You get a NullPointerException when you generate. Can you start JDeveloper through jdev.exe in jdev_home/jdev/bin, this opens an additional console window that should display the stack trace of the NullPiointerException when you generate. Can you post that stack trace?
    Steven Davelaar,
    Jheadstart Team.

  • NullPointerException when mouselistener calls method

    Good Evening,
    I get a java.lang.NullPointerException when a mouselistener calls a method "populatethedatafields()" contained within the class. The populatethedatafields method tries to set the values of text fields and it is at this point the exception occurs. I have tried being more explict in identifying the fields using myclassname.this.textfieldname and this.textfieldname without success. When I moved the settext to within the mouselistener scope, I was able to make the changes.
    Why does this occur?
    I know that I can fix it by putting the settext into the listeners, but that does not seem to be good coding practice. Any suggestions for a good coding practice to solve this type of issue?
    Many thanks for your time.
    Some code removed for clarity and brevity.......
    package EMSBeta1;
    public class ContactInfoViewTEST2 extends JPanel {
    private JTextField textFieldFirstName, textFieldLastName;
    private JPanel custDetails;
    /** Creates new ContactInfoView */
    public ContactInfoViewTEST2(PowerSourceRacingModel model) {
    mod = model;
    cqm = mod.getContactQuery();
    cdt = mod.getContactDetails();
    initComponents();
    public void initComponents() {
    JPanel panel1 = new JPanel();
    JPanel panel2 = new JPanel();
    JPanel detailsPanel = new JPanel();
    double size[][] =
    {{10, -1.0, -1.0, -1.0, -1.0, TableLayout.PREFERRED, 10}, // Columns
    {10, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 10}}; // Rows
    panel1.setBorder(BorderFactory.createTitledBorder("This is a title"));
    BoxLayout layout = new BoxLayout(panel1, BoxLayout.Y_AXIS);
    panel1.setLayout(layout);
    // panel2.setBorder(BorderFactory.createTitledBorder("This is a title"));
    BoxLayout layout2 = new BoxLayout(panel2, BoxLayout.X_AXIS);
    panel2.setLayout(layout2);
    detailsPanel.setBorder(BorderFactory.createTitledBorder("This is a title"));
    detailsPanel.setLayout(new TableLayout(size));
    JLabel labelLastName = new JLabel("Last Name") ;
    final JTextField textFieldLastName = new JTextField("Enter LastName",10);
    JLabel labelFirstName = new JLabel("First Name") ;
    final JTextField textFieldFirstName = new JTextField("FirstName",5);
    textFieldLastName.setNextFocusableComponent(textFieldMembershipNum);
    textFieldMembershipNum.setNextFocusableComponent(textFieldAddress);
    textFieldAddress.setNextFocusableComponent(textFieldEmerContactPhone);
    detailsPanel.add(labelLastName, "1, 1, L, C");
    detailsPanel.add(textFieldLastName, "1, 2, L, T");
    detailsPanel.add(labelFirstName, "3, 1, L, C");
    detailsPanel.add(textFieldFirstName, "3, 2, L, T");
    panel1.add(contactListPane);
    this.setLayout(new BorderLayout());
    add(panel1,BorderLayout.WEST);
    add(panel2,BorderLayout.SOUTH);
    add(detailsPanel,BorderLayout.CENTER);
    MouseListener listMouseListener = new MouseListener() {
    public void mouseClicked(MouseEvent e) {
    public void mouseEntered(MouseEvent e) {
    public void mouseExited(MouseEvent e) {
    public void mousePressed(MouseEvent e) {
    public void mouseReleased(MouseEvent e) {
    createNewContact.setEnabled(true);
    updateButton.setEnabled(true);
    insertNewDataButton.setEnabled(false);
    clearButton.setEnabled(false);
    JList theList = (JList)e.getSource();
    int indexValue = theList.getSelectedIndex();
    System.out.println("This is the selected index from the JList: " + indexValue);
    ContactIdName selectedItem = (ContactIdName)list.getSelectedValue();
    int selectedKey = selectedItem.getKey();
    contactInfo = cdt.getContactDetails(selectedKey);
    populateTheDataFields();
    list.addKeyListener(listKeyListener);
    list.addMouseListener(listMouseListener);
    public void clearFields() {
    textFieldFirstName.setText(null);
    textFieldLastName.setText(null);
    public void populateTheDataFields() {
    String first = (String)contactInfo.get("FIRSTNAME");
    String last = (String)contactInfo.get("LASTNAME");
    this.textFieldFirstName.setText(first);
    this.textFieldLastName.setText(last);
    }

    Ah Ha, Discovered the solution/problem.
    Note that I declared textFieldFirstName and textFieldLastName as class objects with private scope. Then in the initComponents METHOD, I created NEW textFieldFirstName and textFieldLastName objects whose scope is limited only to the method. By prefixing the objects with type, I was creating new instances of the objects rather than "re-using" the class objects. Class objects with appropriate scope are accessible by methods and inner classes. Objects created within a method are not unless the method returns the object.
    Subtle, but basic OO stuff that was a painful lesson. Whew!

Maybe you are looking for

  • Which is better C++/JAVA?

    Could someone give me an explaination as to why C++/OpenGL is better than Java when trying to program 3D objects?? Also could you plsss tell me the pros and cons for each one?? Though i was thinking of using JAVA. thx

  • How do I fix broken HSB Sliders?

    My HSB Sliders aren't working - they're stuck in some weird default color positions that don't give me the preview of the color i'm sliding over - however the preview box does change. The slider just doesn't show the actual color range.

  • Clarification of iPhoto/Photo Stream

    Hi, I am having difficulty understanding how iPhoto handles photos taken on an iOS device(iPhone or iPad).  Currently I have my iPhoto set to do an automatic import when taking picture.  I take picture on iPhone, it shows up on iPad photo stream.  It

  • Which photoshop version should I use with...

    A. Ibook G4 Mac OS X 10.4.11 B. Mac Mini Power PC G4 Mac Os X 10.5.6 Any links to download a free trial Thanks in advance.

  • New User- Poor Reception

    Feb 2, 2012  DionM_VZW said,  "Smashogre has some terrific suggestions as to how to resolve the issues you described. . If they don't work for you . . . " Doesn't VERIZON have a LINK to a whole list of suggestions that you could SHARE with ALL of us?