Java.lang.NullPointerException : Where is the bug ?!

Hi,
where is the bug in this method ?
I just do not see it !
When I run it I get the following error message
Exception in thread "main" java.lang.NullPointerException
at edu.clip.rerank.main.packageRec(main.java:239)
and line 239 is the one I have indicated with <================
Any suggestion would be immensely appreciated.
Many thanks.
public static RerankInstance packageRec (ArrayList chunk)
String spanish = new String();
String gold = new String();
String line = null;
boolean readingCandidates = false;
Double lm = null;
Double tm = null;
Double lm_tm = null;
ArrayList candidates = new ArrayList();
ArrayList LM_likelihoods = new ArrayList();
ArrayList TM_likelihoods = new ArrayList();
ArrayList LM_TM_likelihoods = new ArrayList();
RerankInstance foo = null;
for (int i = 0; i < chunk.size(); i++) {
if (!chunk.get(0).toString().startsWith("<REC>")) {
System.out.println("PROBLEM DETECTED " + chunk.get(0));
line = chunk.get(i).toString();
if (line.startsWith("Spanish=")) {
spanish = line.substring("Spanish=".length());
System.out.println("SPANISH== " + spanish);
else if (line.startsWith("Gold="))
gold = line.substring("Gold=".length());
else if (line.startsWith("<CANDIDATES>"))
readingCandidates = true;
else if (line.startsWith("</CANDIDATES>"))
readingCandidates = false;
if (spanish != null && candidates.size() > 0) {
System.out.println("Spanish=" + spanish);
String [] cands = (String[]) candidates.toArray(new String[0]);
foo = new RerankInstance (spanish, cands);
ArrayList LM_temp = new ArrayList();
ArrayList TM_temp = new ArrayList();
ArrayList LM_TM_temp = new ArrayList();
if (LM_likelihoods.size() > 0 )
Double [] LM_likes = (Double[])LM_likelihoods.toArray(new Double[0]);
foo.setLikelihoods_single(LM_likes);
if (TM_likelihoods.size() > 0 ){
Double [] TM_likes = (Double[])TM_likelihoods.toArray(new Double[0]);
foo.setLikelihoods_single(TM_likes);
if (LM_TM_likelihoods.size() > 0 ) {
Double [] LM_TM_likes = (Double[])LM_TM_likelihoods.toArray(new Double[0]);
foo.setLikelihoods_single(LM_TM_likes);
}//if
else if (readingCandidates) {
System.out.println("Candidate[" + line + "]");
int ndx = line.indexOf('\t');
candidates.add(line.substring(0,ndx));
int ndx_a = line.indexOf('\t', ndx+1);
int ndx_b = line.indexOf('\t', ndx_a+1);
if (ndx_a > ndx+1) {
lm = (line.substring(ndx+1,ndx_a)).startsWith("-Infinity") ? new Double(0) : new Double (line.substring(ndx+1,ndx_a));
if (ndx_b > ndx_a+1) {
tm = (line.substring(ndx_a+1,ndx_b)).startsWith("-Infinity") ? new Double(0) : new Double(line.substring(ndx_a+1,ndx_b));
if ( ndx_b > -1) {
lm_tm = (line.substring(ndx_b+1)).startsWith("-Infinity") ? new Double (0) : new Double(line.substring(ndx_b+1));
try
if (lm != null)
LM_likelihoods.add(lm);
if (tm != null)
TM_likelihoods.add(tm);
if (lm_tm != null)
LM_TM_likelihoods.add(lm_tm);
} catch (Exception e){ };
}//else
}//for
String test = foo.getSourcePhrase().getPhrase(); <==============
System.out.println("WHERE IS THE SOURCE " + test);
return foo;
} //end of method

Foo is definatelly null because...
Near the begining of the method foo is initialised to null.
A load of conditional statements follow in only one of which foo is instantiated.
If this condition is not satisfied foo will remain null.
If that happens then you will get the error that you're getting on line 239.
Essentially all the conditions before the above mentioned condition would have to evaluate to false for foo not to remain null by the time line 239 is executed.
Line 239 is executed regardles of any of the conditional statements in your method, i.e. regardless of whether null is instantiated or not, in which case it remains null - hence the NullPointerException.

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 ?

  • Java.lang.NullPointerException still in the beta 2

    I opened a class with 322 lines of code, press CTRL+A (select all) and then CTRL+C (copy to clipboard) and gives me the exception:
    "Copy" did not complete normally.  Please see the log for more information.
    java.lang.NullPointerException
    This error was already reported in the beta 1 of the Flash Builder 4.7 so seems that still remains in this new release.

    Hi,
    Could you please send a sample snippet or class to [email protected] ? It will help us reproduce this issue.
    Also, please attach log file (Location: yourworkspace/.metadata/.log)?
    Thanks,
    Radhakrishna

  • Java.lang.NullPointerException : while editing the human task  JDeveloper

    java.lang.NullPointerException
    o.bpel.services.workflow.verification.impl.TaskContentAccess.getAccess(TaskContentAccess.java:127)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getDefaultActionAccessData(AccessRulesUtil.java:265)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getChangedActionAccessData(AccessRulesUtil.java:174)
    o.tip.tools.ide.workflow.editor.tab.TaskActionAccessConfigurationPanel.getData(TaskActionAccessConfigurationPanel.java:272)
    o.tip.tools.ide.workflow.editor.tab.TaskActionAccessConfigurationPanel.initMode(TaskActionAccessConfigurationPanel.java:439)
    o.tip.tools.ide.workflow.editor.tab.TaskAccessConfigurationPanel.initMode(TaskAccessConfigurationPanel.java:147)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsPanel.setData(AdvancedOptionsPanel.java:195)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsEditor.setData(AdvancedOptionsEditor.java:116)
    o.tip.tools.ide.workflow.editor.WorkflowManager.loadIntoUIModel(WorkflowManager.java:218)
    o.tip.tools.ide.workflow.addin.WFTabbedEditor.load(WFTabbedEditor.java:265)
    o.tip.tools.ide.workflow.addin.WFTabbedEditor.access$000(WFTabbedEditor.java:105)
    o.tip.tools.ide.workflow.addin.WFTabbedEditor$1.run(WFTabbedEditor.java:253)
    j.lang.Thread.run(Thread.java:619)

    Getting following error when I try to update Human task from JDeveloper
    Uncaught exception
    java.lang.NullPointerException
    o.bpel.services.workflow.verification.impl.TaskContentAccess.getAccess(TaskContentAccess.java:127)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getDefaultActionAccessData(AccessRulesUtil.java:265)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getChangedActionAccessData(AccessRulesUtil.java:174)
    o.tip.tools.ide.workflow.editor.tab.TaskActionAccessConfigurationPanel.getData(TaskActionAccessConfigurationPanel.java:272)
    o.tip.tools.ide.workflow.editor.tab.TaskAccessConfigurationPanel.getActionData(TaskAccessConfigurationPanel.java:103)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsPanel.getData(AdvancedOptionsPanel.java:215)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsEditor$LocalPropertyChangeListener.propertyChange(AdvancedOptionsEditor.java:141)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    j.a.Component.firePropertyChange(Component.java:8128)
    o.tip.tools.ide.workflow.editor.tab.AssigneesEditor.propertyChange(AssigneesEditor.java:186)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    j.a.Component.firePropertyChange(Component.java:8128)
    o.tip.tools.ide.workflow.editor.v2.StageEditor.firePropertyChange(StageEditor.java:1488)
    o.tip.tools.ide.workflow.editor.v2.StageEditor.propertyChange(StageEditor.java:1081)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    j.a.Component.firePropertyChange(Component.java:8128)
    o.tip.tools.ide.workflow.editor.v2.ParticipantEditor.editParticipant(ParticipantEditor.java:1304)
    o.tip.tools.ide.workflow.editor.v2.ParticipantEditor$LocalMouseAdapter.mouseClicked(ParticipantEditor.java:1004)
    j.a.Component.processMouseEvent(Component.java:6266)
    jx.s.JComponent.processMouseEvent(JComponent.java:3267)
    j.a.Component.processEvent(Component.java:6028)
    j.a.Container.processEvent(Container.java:2041)
    j.a.Component.dispatchEventImpl(Component.java:4630)
    j.a.Container.dispatchEventImpl(Container.java:2099)
    j.a.Component.dispatchEvent(Component.java:4460)
    j.a.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    j.a.LightweightDispatcher.processMouseEvent(Container.java:4247)
    j.a.LightweightDispatcher.dispatchEvent(Container.java:4168)
    j.a.Container.dispatchEventImpl(Container.java:2085)
    j.a.Window.dispatchEventImpl(Window.java:2478)
    j.a.Component.dispatchEvent(Component.java:4460)
    j.a.EventQueue.dispatchEvent(EventQueue.java:599)
    j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    j.a.EventDispatchThread.run(EventDispatchThread.java:122)

  • Jax-ws 2.2.8 and ws-addressing: Client throwing java.lang.NullPointerException on receipt of HTTP 202 when using non-anonymous ReplyTo address

    Server: JBoss EAP 6.2.0
    Client: JDK 1.7.0_51 x64
    JAX-WS: RI 2.2.8 ( via -Djava.endorsed.dirs )
    I am getting a java.lang.NullPointerException when calling the operation on the WS endpoint from the client when using non-anonymous replyTo address.
    I have simplified the scenario into a small test case that hopefully others can replicate. Since the exception is happening on the client instead of the server, I would think that the container used is irrelevant, but I have specified it nonetheless.
    1) WebService:
    package test.webservice;
    import java.util.Random;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.xml.ws.soap.Addressing;
    @WebService(targetNamespace="http://services.nowhere.org/")
    @Addressing(required=true)
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
    public class RandomTest {
        @WebMethod
        public long nextRandom(@WebParam boolean forceException) throws Exception {
            if( forceException ) {
                throw new Exception("Some exception");
            Random rand = new Random();
            return rand.nextLong();
    2) Generated WSDL by JBossEAP 6.2.2:
    <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://webservice.test/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="RandomTestService" targetNamespace="http://webservice.test/">
      <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webservice.test/" elementFormDefault="unqualified" targetNamespace="http://webservice.test/" version="1.0">
      <xs:element name="nextRandom" type="tns:nextRandom"/>
      <xs:element name="nextRandomResponse" type="tns:nextRandomResponse"/>
      <xs:complexType name="nextRandom">
        <xs:sequence/>
      </xs:complexType>
      <xs:complexType name="nextRandomResponse">
        <xs:sequence>
          <xs:element name="return" type="xs:long"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
      </wsdl:types>
      <wsdl:message name="nextRandom">
        <wsdl:part element="tns:nextRandom" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="nextRandomResponse">
        <wsdl:part element="tns:nextRandomResponse" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="RandomTest">
        <wsdl:operation name="nextRandom">
          <wsdl:input message="tns:nextRandom" name="nextRandom" wsam:Action="http://webservice.test/RandomTest/nextRandomRequest" wsaw:Action="http://webservice.test/RandomTest/nextRandomRequest">
        </wsdl:input>
          <wsdl:output message="tns:nextRandomResponse" name="nextRandomResponse" wsam:Action="http://webservice.test/RandomTest/nextRandomResponse" wsaw:Action="http://webservice.test/RandomTest/nextRandomResponse">
        </wsdl:output>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="RandomTestServiceSoapBinding" type="tns:RandomTest">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsaw:UsingAddressing wsdl:required="true"/>
        <wsp:PolicyReference URI="#RandomTestServiceSoapBinding_WSAM_Addressing_Policy"/>
        <wsdl:operation name="nextRandom">
          <soap:operation soapAction="" style="document"/>
          <wsdl:input name="nextRandom">
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output name="nextRandomResponse">
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="RandomTestService">
        <wsdl:port binding="tns:RandomTestServiceSoapBinding" name="RandomTestPort">
          <soap:address location="http://localhost:8080/servertest/RandomTest"/>
        </wsdl:port>
      </wsdl:service>
        <wsp:Policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="RandomTestServiceSoapBinding_WSAM_Addressing_Policy"><wsam:Addressing><wsp:Policy/></wsam:Addressing></wsp:Policy>
    </wsdl:definitions>
    3) ant build.xml to generate the client code from WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <project default="build" basedir="..">
        <property name="jaxws.classpath" location="C://jaxws-2.2.8/jaxws-ri/lib/*.jar"/>
        <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
               <classpath path="${jaxws.classpath}"/>
        </taskdef>
        <target name="build" >
            <!-- For these to work, the JAR files in tools/jaxws-ri must be included in Ant's classpath -->
            <wsimport wsdl="http://localhost:8080/servertest/RandomTest?wsdl"
                   verbose="true"
                   sourcedestdir="src"
                   destdir="bin"
                   keep="true">
                   <xjcarg value="-enableIntrospection"/>
            </wsimport>
        </target>
    </project>
    4) Client code
    4a) ClientTest.java - Actual client run from client
    package test.wsclient;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.ws.BindingProvider;
    import javax.xml.ws.Endpoint;
    import javax.xml.ws.handler.Handler;
    import javax.xml.ws.soap.AddressingFeature;
    import org.nowhere.services.RandomTest;
    import org.nowhere.services.RandomTestService;
    public class ClientTest {
        public static void main(String args[]) throws Exception {
            ClientTest app = new ClientTest();
            app.testAddressing();
        public void testAddressing() throws Exception {
            String REPLY_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallback";
            String FAULT_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallbackFault";
            RandomTestService service = new RandomTestService();
            RandomTest port = service.getRandomTestPort(new AddressingFeature());
            BindingProvider provider = (BindingProvider) port;
            // pass the replyTo address to the handler
            provider.getRequestContext().put("ReplyTo", REPLY_TO_ADDRESS);
            provider.getRequestContext().put("FaultTo", FAULT_TO_ADDRESS);
            // Register handlers to set the ReplyTo and FaultTo on the SOAP request sent to the WS endpoint
            List<Handler> handlerChain = new ArrayList<Handler>();
            handlerChain.add(new ClientHandler());
            provider.getBinding().setHandlerChain(handlerChain);
            // Start endpoint to receive callbacks from WS
            Endpoint endpoint = Endpoint.publish(REPLY_TO_ADDRESS, new CallbackSEI());
            try {
                port.nextRandom(false);
            } catch( Exception ex ) {
                ex.printStackTrace();
            } finally {
                Thread.sleep(10000);
            endpoint.stop();
            System.exit(0);
    4b) ClientHandler.java - Used to set the wsa ReplyTo address and FaultTo address when sending SOAP request from client to server
    package test.wsclient;
    import java.util.Set;
    import javax.xml.namespace.QName;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.ws.handler.MessageContext;
    import javax.xml.ws.handler.MessageContext.Scope;
    import javax.xml.ws.handler.soap.SOAPHandler;
    import javax.xml.ws.handler.soap.SOAPMessageContext;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class ClientHandler implements SOAPHandler<SOAPMessageContext> {
        public ClientHandler() {};
        @Override
        public Set<QName> getHeaders() {
            return null;
        @Override
        public void close(MessageContext arg0) {
        @Override
        public boolean handleFault(SOAPMessageContext context) {
            return true;
        protected void setAnAddress(SOAPHeader header, String tagName, String address) {
            NodeList nodeListReplyTo = header.getElementsByTagName(tagName);
            NodeList nodeListAddress = nodeListReplyTo.item(0).getChildNodes();
            for (int i = 0; i < nodeListAddress.getLength(); i++) {
                Node node = nodeListAddress.item(i);
                if ("Address".equals(node.getLocalName())) {
                    node.setTextContent(address);
                    break;
        protected String getMessageID(SOAPHeader header) {
            NodeList nodeListMessageId = header.getElementsByTagName("MessageID");
            return nodeListMessageId.item(0).getTextContent();
        @Override
        public boolean handleMessage(SOAPMessageContext context) {
            Boolean isOutbound = (Boolean) context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (isOutbound) {
                try {
                    SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
                    SOAPHeader header = envelope.getHeader();
                    /* extract the generated MessageID */
                    String messageID = getMessageID(header);
                    context.put("MessageID", messageID);
                    context.setScope("MessageID", Scope.APPLICATION);
                    /* change ReplyTo address */
                    setAnAddress(header, "ReplyTo", (String) context.get("ReplyTo"));
                    setAnAddress(header, "FaultTo", (String) context.get("FaultTo"));
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
            return true;
    4c) CallbackSEI.java - endpoint on the client for server to send the SOAP response back to the client
    package test.wsclient;
    import javax.annotation.Resource;
    import javax.jws.Oneway;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.ws.Action;
    import javax.xml.ws.RequestWrapper;
    import javax.xml.ws.WebServiceContext;
    import javax.xml.ws.soap.Addressing;
    @WebService
    @Addressing
    //@HandlerChain(file = "/handler-chain.xml")
    public class CallbackSEI {
        @Resource
        private WebServiceContext context;
         * If there is no namespace specified in the method below, then the CallbackSEI needs to be in the same package as the
         * WS endpoint.
        @Oneway
        @Action(input="http://services.nowhere.org/RandomTest/nextRandomResponse")
        @RequestWrapper(localName="nextRandomResponse", targetNamespace="http://services.nowhere.org/")
        public void handleNotification(@WebParam(name="return")long random) {
            System.out.println("Asynch response received");
            System.out.println( random );
            //System.out.println("This response relates to the message ID: "+ getMessageID());
    In summary:
    Server is listening on port 8080
    Client will listen in port 8082 for the callback from the server for the SOAP response
    Now when I run the client, I see that the proper behaviour as far as ws-addressing is concerned. That is:
    client  -- SOAP request ( on port 8080 ) --> server
    client <-- HTTP 202 ( empty HTTP body )  --- server
    client <-- SOAP response ( on port 8082 )  --- server
    All well and good, except that I am getting a NullPointerException on the client side when I call the operation.
    With debugging of the SOAP request and responses, I get the following output:
    ---[HTTP request - http://localhost:8080/servertest/RandomTest]---
    Accept: text/xml, multipart/related
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "http://services.nowhere.org/RandomTest/nextRandomRequest"
    User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
    <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/servertest/RandomTest</To><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomRequest</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallback</Address>
    </ReplyTo><FaultTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallbackFault</Address>
    </FaultTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</MessageID></S:Header><S:Body><ns2:nextRandom xmlns:ns2="http://services.nowhere.org/"><arg0>false</arg0></ns2:nextRandom></S:Body></S:Envelope>--------------------
    ---[HTTP response - http://localhost:8080/servertest/RandomTest - 202]---
    null: HTTP/1.1 202 Accepted
    Content-Length: 0
    Content-Type: text/xml;charset=UTF-8
    Date: Fri, 18 Jul 2014 08:34:36 GMT
    Server: Apache-Coyote/1.1
    java.lang.NullPointerException
        at com.sun.proxy.$Proxy38.nextRandom(Unknown Source)
        at test.wsclient.ClientTest.testAddressing(ClientTest.java:43)
        at test.wsclient.ClientTest.main(ClientTest.java:18)
    ---[HTTP request]---
    Cache-control: no-cache
    Host: localhost:8082
    Content-type: text/xml; charset=UTF-8
    Content-length: 704
    Connection: keep-alive
    Pragma: no-cache
    User-agent: Apache CXF 2.7.7.redhat-1
    Accept: */*
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomResponse</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:65d8d7fc-09e4-494a-a9c5-0a01faf4d7e6</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8082/servertest/RandomCallback</To><RelatesTo xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</RelatesTo></soap:Header><soap:Body><ns2:nextRandomResponse xmlns:ns2="http://services.nowhere.org/"><return>2870062781194370669</return></ns2:nextRandomResponse></soap:Body></soap:Envelope>--------------------
    Asynch response received
    2870062781194370669
    As you can see from the output above, the proxy is throwing an Exception when it receives the HTTP 202 response.
    Any ideas ?

    I think I have found when I get this error and probably I have found a bug. I will appreciate if someone can confirm this.
    In my BPEL project setup, my BPEL process's wsdl file imports another wsdl from different namespace. Here is sample snippet -
    <wsdl:definitions targetNamespace="http://namespace/1">
    <wsdl:import namespace="http://namespace/2" location="resources/another.wsdl"/>
    <plnk:partnerLinkType....../>
    </wsdl:definitions>
    Please let me know. I checked the bundled samples with Oracle BPEL PM and did not find any similar case where process wsdl imports another wsdl.
    Thank you.
    Meghana

  • 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 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

  • Java.lang.NullPointerException trying to migrate from MySQL to OracleXE

    (Originally posted in the SQL Developer forum)
    I'm trying to migrate a small MySQL database (four tables) to OracleXE. When I capture an object (table, schema or entire database), I'm receiving a java.lang.NullPointerException message from the Capture source in the Migration Log window. The migrated object doesn't show up in the Captured Objects window until after I shut down SQL Developer and restart it, then the tables in the migration script don't have any columns defined in them.
    Here's the error from the console:
    java.lang.Exception: java.lang.NullPointerException
    at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:139)
    at oracle.dbtools.migration.workbench.core.CaptureInitiator.launch(CaptureInitiator.java:57)
    at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:127)
    at oracle.ide.controller.IdeAction.performAction(IdeAction.java:551)
    at oracle.ide.controller.IdeAction$2.run(IdeAction.java:804)
    at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:823)
    at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:521)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
    at java.awt.Component.processMouseEvent(Component.java:5501)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5266)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3968)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)Caused by: java.lang.NullPointerException
    at oracle.dbtools.migration.workbench.plugin.MySQLCapturer.captureColumnDetails(MySQLCapturer.java:473)
    at oracle.dbtools.migration.workbench.plugin.MySQLCapturer.captureObjects(MySQLCapturer.java:145)
    at oracle.dbtools.migration.capture.CaptureWorker.capturePerTable(CaptureWorker.java:568)
    at oracle.dbtools.migration.capture.CaptureWorker.captureType(CaptureWorker.java:331)
    at oracle.dbtools.migration.capture.CaptureWorker.runCapture(CaptureWorker.java:282)
    at oracle.dbtools.migration.workbench.core.ui.CaptureRunner.doWork(CaptureRunner.java:63)
    at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.run(AbstractMigrationProgressRunnable.java:159)
    at oracle.dbtools.migration.workbench.core.ui.MigrationProgressBar.run(MigrationProgressBar.java:532)
    at java.lang.Thread.run(Thread.java:595)
    My environment is:
    Windows Xp sp2
    SQL Developer (ver. 1.1.2.25.78)
    J2SE Development Kit 5.0 Update 11
    mysql-connector-java-5.0.5
    Oracle Database 10g Express Edition Release 10.2.0.1.0
    The MySQL database is version 4.1.2 running on a remote Mandriva Linux 2006 server.
    Are there any specific version requirements for the components involved?
    Thanks.

    Hi,
    There's a known bug in the code that captures 4.1 MySQL databases (specifically). The fix has been applied, and will be available in our next release.
    for a temporary workaround, you can put your data into a MySQL 4.0 or 5.0 database.
    Regards,
    Dermot.

  • Data Federator Connection to R3 - java.lang.NullPointerException

    Hi.
    We are trying to add a SAP R3 DataSource in Data Federator XI 3.0 SP2.
    Test Connection gives us the following message: "The connection was established but there is no table for the given connection parameters", what it seems to be ok according to the SAP doc.
    However, when we try to get a list of the Functions or Infosets in the SAP system, an error comes because of a "java.lang.NullPointerException". Checking the application log we get the following:
    2010/03/30 12:21:27.059|<=|||0|26537104| |||||||||||||||"[LeSelect.Api.LSStatementImpl] - [Execution Thread 4]Executing query: CALL executeConnectorCommand '/TEST//TEST/user_bla/sources/draft/R3SYS', 'GET_FUNCTION_LIST * * 200'"
    2010/03/30 12:21:27.074|>=|E||0|26537104| |||||||||||||||"[LeSelect.Core.n] - [Execution Thread 4]Bad Wrapper Error:
    java.lang.NullPointerException
         at LeSelect.Wrappers.SAPR3.H.F(y:343)
         at LeSelect.Wrappers.SAPR3.H.executeCommand(y:285)
         at LeSelect.Core.B.D.R(y:151)
         at LeSelect.Core.QueryEngine.H.p.G(y:131)
         at LeSelect.Core.QueryEngine.H.p.A(y:105)
         at LeSelect.Core.QueryEngine.B.J.A(y:72)
         at LeSelect.Core.QueryEngine.Executor.y.A(y:227)
         at LeSelect.Core.QueryEngine.m.A(y:284)
         at LeSelect.Api.LSStatementImpl.lsExecuteQuery(y:314)
         at LeSelect.B.E.D.V(y:935)
         at LeSelect.B.E.K.B(y:105)
         at LeSelect.B.E.G$_A.run(y:691)"
    We registered the callback program and did all of the steps indicated for the installation, also checked the possible sources of the error according to OSS Note 1278491.
    Any idea how to solve this? Thanks.

    Hello, we have the similar problem: while connecting from Data Federator to SAP ERP we get the following error - "Wrapper /ZTEST/sources/ZTEST reported an exception which is not a WrapperException: java.lang.NullPointerException: null"
    It's necessary to install "SAP BusinessObjects Data Federator Infoset, SAP Query and ABAP Functions Connector Prototype"
    SAP BusinessObjects Web Intelligence Reporting for SAP ERP
    for connection to SAP ERP.
    Are there any ideas? Thanks

  • Getting "java.lang.NullPointerException" error message when trying to run an OATS OpenScript file from Eclipse to Create a record in Oracle EBS

    Hello,
    I'm trying to run a simple OpenScript script in Eclipse that creates a record (a Supplier in this case) in Oracle E-Business Suite. So I copied the the script file from OpenScript and created it as a Class in Eclipse.  Then I created a main class to call the methods within the script class but no matter what method I call (initialize, run or finalize) I'm getting the java.lang.NullPointerException message. The error doesn't seem to be related with any specific line in the script but with the way that I'm calling it.
    Should I call the OpenScript class from my main class in a different way? (see my examples below)
    BTW, all external .jar files coming with OATS have been added to my project in Eclipse.
    1) Here's the main class I created to call the OpenScript method (Eclipse auto-corrected my main class adding a Try and Catch around the method call):
    public class Test {
        public static void main(String[] args) {
            nvscript nvs = new nvscript();
            try {
                nvs.initialize();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
    2) Here's the script from OpenScript (the actual script has more steps but I'm just using the first one for a proof of concept):
    import oracle.oats.scripting.modules.basic.api.*;
    import oracle.oats.scripting.modules.browser.api.*;
    import oracle.oats.scripting.modules.functionalTest.api.*;
    import oracle.oats.scripting.modules.utilities.api.*;
    import oracle.oats.scripting.modules.utilities.api.sql.*;
    import oracle.oats.scripting.modules.utilities.api.xml.*;
    import oracle.oats.scripting.modules.utilities.api.file.*;
    import oracle.oats.scripting.modules.webdom.api.*;
    import oracle.oats.scripting.modules.formsFT.api.*;
    import oracle.oats.scripting.modules.applet.api.*;
    public class nvscript extends IteratingVUserScript {
        @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
        @ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
        @ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
        @ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
        @ScriptService oracle.oats.scripting.modules.applet.api.AppletService applet;
        @ScriptService oracle.oats.scripting.modules.formsFT.api.FormsService forms;
        public void initialize() throws Exception {
            this.getSettings().set("formsft.useformsonly",true);
            browser.launch();
        public void run() throws Exception {
            beginStep(
                    "[1] E-Business Suite Home Page Redirect (/ebs12cloud.winshuttle.com:8000/)",
                    0);
                web.window(2, "/web:window[@index='0' or @title='about:blank']")
                        .navigate("http://ebs12.xxxxxxx.com:8000/");
                web.window(4, "/web:window[@index='0' or @title='Login']")
                        .waitForPage(null);
                    think(4.969);
                web.textBox(
                        7,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_text[@id='usernameField' or @name='usernameField' or @index='0']")
                        .setText("winshuttle_user");
                    think(2.0);
                web.textBox(
                        8,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
                        .click();
                    think(1.109);
                web.textBox(
                        9,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
                        .setPassword(deobfuscate("kjhkjhkj=="));
                    think(1.516);
                web.button(
                        10,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:button[@id='SubmitButton' or @value='Login' or @index='0']")
                        .click();
            endStep();
        public void finish() throws Exception {       
    3) Here's the error messages I'm getting based on the method I call from my main class:
    3.a) when calling Initialize():
    java.lang.NullPointerException
        at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.getSettings(IteratingVUserScript.java:723)
        at nvscript.initialize(nvscript.java:22)
        at Test.main(Test.java:9)
    3 b) when calling Run():
    java.lang.NullPointerException
        at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.beginStep(IteratingVUserScript.java:260)
        at nvscript.run(nvscript.java:30)
        at Test.main(Test.java:9)
    Any help and/or constructive comment will be appreciated it.
    Thanks.
    Federico.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • Java.lang.NullPointerException in RFC Receiver Adapter

    Hi Experts,
    i have configured SQL Sender Adapter and this works fine, i can see the payload. and at the receiver adapter i have configured RFC Receiver Adapter this is throwing NullPointerException as mentioned below.. can someone help me out to fix this issue..
    Error Description:
    Error     Exception caught by adapter framework: null
    Success     MP: Processing local module localejbs/AF_Modules/RequestResponseBean
    Error     MP: Exception caught with cause java.lang.NullPointerException
    Error     Delivery of the message to the application using connection   
                    RFC_http://sap.com/xi/XI/System failed, due to:
                    com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.NullPointerException.
    Success     The message status set to WAIT.
    Thanks,
    Srikanth

    Hi Srikanth,
    This error Occurs because of incomplete configuration in the reciever communication channel.Please check all the required configurations in the reciever communication channel and then activate the channel.
    Regards,
    Naveen

  • SOAP: call failed: java.lang.NullPointerException

    Hi,
    We are geeting the error in RWB -->
    SOAP: call failed: java.lang.NullPointerException
    We checked the communication channel and interface and all are working fine.
    Can anybody suggest?
    Regards,
    Akki..................

    Hi,
    use this link to find the answer..
    SOAP adapter
    Regards,
    Amitanshu

  • Getting Java.Lang.NullPointerException

    Hi,
    I am getting java.lang.NullPointerException when calling the 'validate' method. Appreciate any help.
    Thanks
    import com.sun.net.ssl.internal.ssl.Provider;
    import java.io.*;
    import java.net.URL;
    import java.net.URLEncoder;
    import java.security.Security;
    import java.text.DateFormat;
    public class PSCASClient{
    public static String validate(String fullUrl, String ticket, String altVal) throws IOException {
    String validateURL = null;
    if (altVal.equals("N")) {
    validateURL = "https://login.uconn.edu/cas/validate";
    else
    validateURL = "https://login.uconn.edu/cas/validate";
    try
    Security.addProvider(new Provider());
    System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    int ticketParamIndex = fullUrl.lastIndexOf("&ticket=");
    String service = null;
    if (ticketParamIndex != -1) {
    // service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex)); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex), service);
    else {
    // service = URLEncoder.encode(fullUrl); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl, service);
    URL u = new URL(validateURL + "?ticket=" + ticket + "&service=" + service);
    BufferedReader in = new BufferedReader(new InputStreamReader(u.openStream()));
    if (in == null) {
    return null;
    String line1 = in.readLine();
    String line2 = in.readLine();
    if (line1 != null && line2 != null && line1.equals("yes"))
    String user = line2;
    user = user.toUpperCase();
    return user;
    else {
    return null;
    catch(Exception e)
    logMessage("ERROR: Exception attempting validate: " + e);
    return null;
    public static void logMessage(String message){
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
    Date now = new Date();
    try
    BufferedWriter os = new BufferedWriter(new FileWriter("/tmp/pscas_signon_log.txt", true));
    os.write(formatter.format(now));
    os.write(message);
    os.write("\n");
    os.close();
    catch(IOException _ex) { }

    Hi,
    I am getting java.lang.NullPointerException when
    calling the 'validate' method. Appreciate any help.
    Thanks
    import com.sun.net.ssl.internal.ssl.Provider;
    import java.io.*;
    import java.net.URL;
    import java.net.URLEncoder;
    import java.security.Security;
    import java.text.DateFormat;
    public class PSCASClient{
    public static String validate(String fullUrl, String
    ticket, String altVal) throws IOException {
    String validateURL = null;
    if (altVal.equals("N")) {
    validateURL = "https://login.uconn.edu/cas/validate";
    else
    validateURL = "https://login.uconn.edu/cas/validate";
    try
    Security.addProvider(new Provider());
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    int ticketParamIndex =
    fullUrl.lastIndexOf("&ticket=");
    String service = null;
    if (ticketParamIndex != -1) {
    // service = URLEncoder.encode(fullUrl.substring(0,
    ticketParamIndex)); /* This method is deprecated - JA
    service = URLEncoder.encode(fullUrl.substring(0,
    ticketParamIndex), service);
    else {
    // service = URLEncoder.encode(fullUrl); /* This
    method is deprecated - JA */
    service = URLEncoder.encode(fullUrl, service);
    URL u = new URL(validateURL + "?ticket=" + ticket +
    "&service=" + service);
    BufferedReader in = new BufferedReader(new
    InputStreamReader(u.openStream()));
    if (in == null) {
    return null;
    String line1 = in.readLine();
    String line2 = in.readLine();
    if (line1 != null && line2 != null &&
    line1.equals("yes"))
    String user = line2;
    user = user.toUpperCase();
    return user;
    else {
    return null;
    catch(Exception e)
    logMessage("ERROR: Exception attempting validate: " +
    e);
    return null;
    public static void logMessage(String message){
    SimpleDateFormat formatter = new
    SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
    Date now = new Date();
    try
    BufferedWriter os = new BufferedWriter(new
    FileWriter("/tmp/pscas_signon_log.txt", true));
    os.write(formatter.format(now));
    os.write(message);
    os.write("\n");
    os.close();
    catch(IOException _ex) { }
    }I am using the package jsse.jar. The following lines may be causing the error.
    try
    Security.addProvider(new Provider());
    System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    int ticketParamIndex = fullUrl.lastIndexOf("&ticket=");
    String service = null;
    if (ticketParamIndex != -1) {
    // service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex)); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex), service);
    else {
    // service = URLEncoder.encode(fullUrl); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl, service);
    URL u = new URL(validateURL + "?ticket=" + ticket + "&service=" + service);

  • Java.lang.NullPointerException warning beside components on ADF JSP page

    java.lang.NullPointerException warning beside components on ADF JSP page problem
    Hello
    i developed a web application with the help of the Adf technology On jdeveloper 10.1.3.3.0 . Everything is Ok.
    But when i use application sometimes on the page i take a java.lang.NullPointerException warn beside the some components like a inputbox or a radio button ..)
    i looked the logs but nothing.
    How can i solve this problem.
    Have you got any idea?

    Hi,
    it's the validator property on inputText components that causes it. not validation or StateValidation or EnableTokenValidation.
    Paste your inputText source from the page if you are not sure.
    Brenden

  • Java.lang.NullPointerException (OC4J 10.1.3.1 & JDeveloper 10.1.3.1)

    My project that ran perfectly under JDeveloper 9.0.5.2/OC4J 9.0.2 no loner runs under Jdeveloper 10.1.3.1/OC4J 10.1.3.1.
    The failure (java.lang.NullPointerException ) is in the following code snippet:
    =================================================
    Public String getString(String columnName) throws SQLException {
    return getResultSet().getString(columnName);
    =================================================
    columnName is being passed the same value in both environments.
    The JSP snippet that executes the above is:
    =================================================
    com.app.servlet.SQLDataSource detail =
    ((com.app.servlet.SQLDataSource)request.getAttribute("AcctList"));
    <td width="20%" class="tableRow">
    <a class="a4"><%= detail.getString("ACCT")%></a>
    </td>
    ==================================================
    AcctList is a text file that contains the following SQL code:
    ============
    select ACCT
    , VDESC
    from GL
    :WhereClause
    :OrderByClause
    ============
    :WhereClause & :OrderByClause are set in a calling "Filter" JSP filter page.
    All debug statements in my code indicate the the getResultSet is properly executed. Yet when the detail.getString("ACCT") is hit I receive the NullPointerException.
    Any clues?
    Remember, no code has changed between the 9.0.2 and 10.1.3.1 environments. They both hot the same database with the same JDBC drivers.
    TIA,
    Ed.

    Jan,
    The NullPointerException is pointed to:
    at oracle.jdbc.driver.ScrollableResultSet.findColumn(ScrollableResultSet.java:1308)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1572)
    at oracle.jdbc.SQLDataSource.getString(SQLDataSource.java:388)
    at apps.AcctList._jspService(_AcctList.java:66)
    The code ( in "_AcctList.java") at line 66 reads:
    out.print(detail.getString"ACCT") );
    However, digging into my application log file I found that the following error happend at 10:52:46.0 (the above error occured at 10:52.50):
    07/03/02 10:52:46.0 intemrp: Servlet error
    java.lang.IllegalStateException: OutputStream already retrieved
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.EvermindHttpServletResponse.getWriter(EvermindHttpServletResponse.java:921)
         at com.sage.servlet.ServletAdaptor.error(ServletAdaptor.java:148)
         at com.sage.servlet.ServletAdaptor.service(ServletAdaptor.java:74)
         at inetmrp.servlet.ServletAdaptor.service(ServletAdaptor.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    07/03/02 10:52:46.0 intemrp: An existing connection was forcibly closed by the remote host
    07/03/02 10:52:46.0 intemrp: An existing connection was forcibly closed by the remote host
    Any ideas?
    Thanks,
    Ed.

Maybe you are looking for

  • How do I use movies in iPhoto 9 to iMovie 10

    I am using iPhoto 9 and have recently upgraded to iMovie 10. I have a lot of movie clips in iPhoto (taken on an iPhone or digital photo camera) and want to be able to use them in iMovie projects.  (I was able to do that quite easily in previous versi

  • System cannot find the path specified in logman

    I am getting this error while creating logman counter. My command looks like this.  Logman create counter test5 -f csv -si 0:60 -sc 15 -cf "C:\\CounterList.txt" --v -o "C:\\test5.csv" -u domain\user passwd Counterlist.txt contains : \\<remote_ip_addr

  • Officejet J6480 All-In-One Printer

    I just bought a new Dell tower with Windows 8.1.  When I was installing the printer's software, it told me that I needed new software for a 64 bit computer, which I found online.  Everything seemd fine for the type of documents I first printed.  Howe

  • Photoshop Elements 10 and Inspiration Browser installation help needed.

    Photoshop Elements 10 said delete Inspiration Browser, then reinstall.Keep getting "download error". Was able to install Adobe AIR. Now what do I do?

  • Where has the art work arrow gone?

    I have recently noticed that the art work column arrows have gone. I can no longer change to list only and visa versa. I know I can use "View" at the top and change artwork to show or not but this is tedious! The arrows were quick and easy. Can anyon