Null Pointer Exception Trying to Read File?

I get a Null Pointer Exception when I try to perform the read hex2.txt, which i know exists and is in the same folder as this java file. Anyone see where my problem is?
<code>
import java.io.*;
public class BytesToZeros
          int count = 0;
          int[] data;
          public static void main (String[] args)
                    BytesToZeros btz = new BytesToZeros();
          public BytesToZeros()
                    this.readFile();
                    this.writeFile();
          private void readFile ()
                    try
                              FileInputStream fis = new FileInputStream("hex2.txt");
                              BufferedInputStream bis = new BufferedInputStream(fis);
                              boolean eof = false;
                              while (!eof)
                                        int input = bis.read();
                                        if (input == -1)
                                             eof = true;
                                        else
                                             data[count] = input;
                                             count++;          
                              bis.close();
                    catch (IOException e)
                              System.err.println("Error Reading File: " + e.getMessage());
                              count = 0;
          private void writeFile ()
                    String zeros;
                    try
                              FileOutputStream fos = new FileOutputStream("hex2.txt");
                              BufferedOutputStream bos = new BufferedOutputStream(fos);
                              for (int i=0; i<data.length; i++)
                                        bos.write(0);
                              bos.close();
                    catch (IOException e)
                              System.err.println("Error writing file: " + e.getMessage());
</code>

Doesn't the stack trace you get show which line it was thrown from?
That should tell you where the problem is.
It's weird to do a file read and a file write in the constructor like that. It would make somewhat more sense to do
public static void main (String[] args) {
  BytesToZeros btz = new BytesToZeros();
  btz.readFile();
  btz.writeFile();
}Although I realize this is just a test.
Finally, to quote code use square brackes around the code tags:
&#91;code]&#91;/code]

Similar Messages

  • Null pointer exception while downloading a file using a servlet

              Hi all
              I am getting the following error when downloading a file
              by invoking a servlet ...
              The following is the offending piece of code which has the
              problem ..
              protected void doGet( HttpServletRequest req,
                   HttpServletResponse resp ) throws ServletException,IOException
              resp.setContentLength ( length );
              OutputStream out = resp.getOutputStream();
              FileInputStream is = new FileInputStream(file);
              WriteToStream(is, out);
              out.flush(); // Error happens here
              out.close();
              java.lang.NullPointerException
              at weblogic.servlet.internal.ChunkOutput.clearBuffer(ChunkOutput.java:231)
              at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:251)
              at weblogic.servlet.internal.ChunkOutputWrapper.flush(ChunkOutputWrapper.java:152)
              at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:119)
              at com.epeople.servlet.FileDownloadServlet.doFileRequest(FileDownloadServlet.java:127)
              at com.epeople.servlet.FileDownloadServlet.doGet(FileDownloadServlet.java:75)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:24
              56)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2047)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Any help will be greatly appreciated.
              thanks,
              sri kumar
              

              Hi all
              I am getting the following error when downloading a file
              by invoking a servlet ...
              The following is the offending piece of code which has the
              problem ..
              protected void doGet( HttpServletRequest req,
                   HttpServletResponse resp ) throws ServletException,IOException
              resp.setContentLength ( length );
              OutputStream out = resp.getOutputStream();
              FileInputStream is = new FileInputStream(file);
              WriteToStream(is, out);
              out.flush(); // Error happens here
              out.close();
              java.lang.NullPointerException
              at weblogic.servlet.internal.ChunkOutput.clearBuffer(ChunkOutput.java:231)
              at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:251)
              at weblogic.servlet.internal.ChunkOutputWrapper.flush(ChunkOutputWrapper.java:152)
              at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:119)
              at com.epeople.servlet.FileDownloadServlet.doFileRequest(FileDownloadServlet.java:127)
              at com.epeople.servlet.FileDownloadServlet.doGet(FileDownloadServlet.java:75)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:24
              56)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2047)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Any help will be greatly appreciated.
              thanks,
              sri kumar
              

  • SPML GTC Null Pointer Exception

    Hoping someone call tell me where in the world to turn on this one. The sendData() routine in the SPML GTC provisioning transport provider is throwing a null pointer exception trying to parse the returned XML from my web service on an 'addUser' request. The returned XML (which is provided below) seems simple enough so I have no idea where to go with this one........any ideas anyone?
    <?xml version="1.0" ?>
    <soapenv:Envelope
         xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <soapenv:Body>
              <processRequestResponse
                   xmlns="http://http:localhost:9010/oim">
                   <sOAPElement xmlns="">
                        <ns1:addResponse status="success"
                             xmlns:ns1="urn:oasis:names:tc:SPML:2:0">
                             <ns1:pso>
                                  <ns1:psoID ID="theuser" />
                             </ns1:pso>
                        </ns1:addResponse>
                   </sOAPElement>
              </processRequestResponse>
         </soapenv:Body>
    </soapenv:Envelope>
    Stack trace from WebSphere provided below:
    [3/1/10 13:04:30:270 EST] 0000002e SystemOut O Running GENERICADAPTER
    [3/1/10 13:04:30:286 EST] 0000002e SystemOut O Target Class = com.thortech.xl.gc.runtime.GCAdapterLibrary
    [3/1/10 13:04:30:582 EST] 0000002e SystemOut O WARN,01 Mar 2010 13:04:30,582,[XELLERATE.GC.PROVIDER.PROVISIONINGFORMAT],SPML Request validation result w.r.t SPML v2 CORE schema(pstc_spmlv2_core.xsd)-->true
    [3/1/10 13:04:30:598 EST] 0000002e SystemOut O WARN,01 Mar 2010 13:04:30,598,[XELLERATE.GC.PROVIDER.PROVISIONINGTRANSPORT],WSProvisioningTransportProvider.initialize :webServiceSOAPAction is not defined
    [3/1/10 13:04:30:629 EST] 0000002e SystemOut O WARN,01 Mar 2010 13:04:30,629,[XELLERATE.GC.PROVIDER.PROVISIONINGTRANSPORT],SPML Response validation result w.r.t SPML v2 CORE schema(pstc_spmlv2_core.xsd)-->true
    [3/1/10 13:04:30:645 EST] 0000002e SystemOut O ERROR,01 Mar 2010 13:04:30,645,[XELLERATE.GC.PROVIDER.PROVISIONINGTRANSPORT],WSProvisioningTransportProvider.sendData :problem with private methods
    com.thortech.xl.gc.exception.ProvisioningTransportException: WEB_SERVICE_RESPONSE_XML_PARSINGPROBLEM
         at com.thortech.xl.gc.impl.prov.WSProvisioningTransportProvider.getSOAPMessage(Unknown Source)
         at com.thortech.xl.gc.impl.prov.WSProvisioningTransportProvider.sendData(Unknown Source)
         at com.thortech.xl.gc.runtime.GCAdapterLibrary.executeFunctionality(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:618)
         at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpTOMCAT3_GTC.GENERICADAPTER(adpTOMCAT3_GTC.java:125)
         at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpTOMCAT3_GTC.implementation(adpTOMCAT3_GTC.java:70)
         at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcProvisioningOperationsBean.retryTasks(Unknown Source)
         at com.thortech.xl.ejb.beans.tcProvisioningOperationsSession.retryTasks(Unknown Source)
         at com.thortech.xl.ejb.interfaces.EJSRemoteStatelesstcProvisioningOperations_6b2f800a.retryTasks(Unknown Source)
         at com.thortech.xl.ejb.interfaces._tcProvisioningOperations_Stub.retryTasks(_tcProvisioningOperations_Stub.java:1036)
         at Thor.API.Operations.tcProvisioningOperationsClient.retryTasks(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:618)
         at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(AccessController.java:214)
         at javax.security.auth.Subject.doAs(Subject.java:495)
         at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:118)
         at Thor.API.Security.LoginHandler.websphereLoginSession.runAs(Unknown Source)
         at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
         at $Proxy5.retryTasks(Unknown Source)
         at com.thortech.xl.webclient.actions.ResourceProfileProvisioningTasksAction.retryTasks(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:618)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
         at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
         at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
         at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1087)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
         at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:680)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:588)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:525)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:751)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:126)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
    Caused by:
    java.lang.NullPointerException
         ... 72 more

    I have a similar problem in OIM 9.1
    Something that used to work with SOA 10g, now is not working in SOA 11g.
    OIM sending a delete request to an external target (in this case, a BPEL end point) and the response generated by the BPEL comes back and has problems in OIM.
    The only difference that we can see is that SOA 11g is generating WS-Addressing elements in the header section of the Response Envelope, whereas 10g did not.
    09:58:34,378 INFO [STDOUT] Running GENERICADAPTER
    09:58:34,394 INFO [STDOUT] Target Class = com.thortech.xl.gc.runtime.GCAdapterLibrary09:58:36,347 WARN [PROVISIONINGFORMAT] SPML Request validation result w.r.t SPML v2 CORE schema(pstc_spmlv2_core.xsd)-->true
    09:58:38,769 WARN [PROVISIONINGTRANSPORT] SPML Response validation result w.r.t SPML v2 CORE schema(pstc_spmlv2_core.xsd)-->true
    09:58:38,769 ERROR [PROVISIONINGTRANSPORT] WSProvisioningTransportProvider.sendData :problem with private methods com.thortech.xl.gc.exception.ProvisioningTransportException: WEB_SERVICE_RESPONSE_XML_PARSINGPROBLEM
    at com.thortech.xl.gc.impl.prov.WSProvisioningTransportProvider.getSOAPMessage(Unknown Source)
    at com.thortech.xl.gc.impl.prov.WSProvisioningTransportProvider.sendData(Unknown Source)
    at com.thortech.xl.gc.runtime.GCAdapterLibrary.executeFunctionality(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpOIMTACTICAL005_GTC.GENERICADAPTER(adpOIMTACTICAL005_GTC.java:125)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpOIMTACTICAL005_GTC.implementation(adpOIMTACTICAL005_GTC.java:70)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    Network capture as follows (line wrapped for readability):-
    POST /soa-infra/services/default/SPML_Gateway/client HTTP/1.1
    Host: soa:8001
    Connection: Keep-Alive, TE
    TE: trailers, deflate, gzip, compress
    User-Agent: RPT-HTTPClient/0.3-3
    SoapAction: process
    Accept-Encoding: gzip, x-gzip, compress, x-compress
    Content-type: text/xml
    Content-length: 1190
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
    <wsa1:OIMUser soapenv:mustUnderstand="0" xmlns:wsa1="http://xmlns.oracle.com/OIM/provisioning">
    <wsa1:OIMUserId xmlns:wsa1="http://xmlns.oracle.com/OIM/provisioning">xelsysadm</wsa1:OIMUserId>
    <wsa1:OIMUserPassword xmlns:wsa1="http://xmlns.oracle.com/OIM/provisioning">password</wsa1:OIMUserPassword>
    </wsa1:OIMUser>
    <wsa1:lang soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsa1="http://xmlns.oracle.com/OIM/provisioning">
    <wsa1:language>en</wsa1:language>
    <wsa1:sublanguage>US</wsa1:sublanguage>
    </wsa1:lang>
    </soapenv:Header>
    <soapenv:Body>
    <m:processRequest xmlns:m="http://my.namespace/SPML_Gateway">
    <sOAPElement>
    <deleteRequest xmlns="urn:oasis:names:tc:SPML:2:0" xmlns:dsml="urn:oasis:names:tc:DSML:2:0:core">
    <psoID ID="a237c3e3-06ac-4ba5-8e6c-56ec9c4972d8" targetID="OIMProvisioning">
    </psoID>..
    </deleteRequest>
    </sOAPElement>
    </m:processRequest>
    </soapenv:Body>
    </soapenv:Envelope>HTTP/1.1 200 OK
    Date: Tue, 13 Apr 2010 00:33:51 GMT
    Content-Length: 762
    Content-Type: text/xml; charset=UTF-8
    X-ORACLE-DMS-ECID: 0000IVo_XtiFg4WFLzrI8A1BkhKJ00001I
    SOAPAction: ""
    X-Powered-By: Servlet/2.5 JSP/2.1
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <env:Header>
    <wsa:MessageID>urn:3BBF2150469411DFAF6FBF85B932D117</wsa:MessageID>
    <wsa:ReplyTo>
    <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
    </wsa:ReplyTo>
    </env:Header>
    <env:Body>
    <processRequestResponse xmlns:client="http://my.namespace/SPML_Gateway" xmlns="http://my.namespace/SPML_Gateway">
    <client:sOAPElement>
    <spml2:deleteResponse status="success" xmlns="urn:oasis:names:tc:SPML:2:0" xmlns:spml2="urn:oasis:names:tc:SPML:2:0"/>
    </client:sOAPElement>
    </processRequestResponse>
    </env:Body>
    </env:Envelope>

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Null Pointer Exception while reading inbox

    Hi Experts
    I am getting the Null Pointer Exception when I execute the following code. Can anybody please suggest where i am going wrong.
      public void readInbox( )
        //@@begin readInbox()
         while (! wdContext.nodeEmail().isEmpty()) {
              wdContext.nodeEmail().removeElement(wdContext.nodeEmail().getElementAt(0) );
         wdContext.nodeEmail().invalidate();   
         Message[] message = new Message[1000];
         IPublicEmailInteractiveFormComp.IEmailElement newEmailNodeElement;
         //Set properties
         // @TODO Enter your email server address here by replacing the text in angle brackets.
         String host = "otemail.otegroup.com";
         // @TODO Enter your email account here by replacing the text in angle brackets.
         String username = "[email protected]";
         // @TODO Enter your email account password here by replacing the text in angle brackets.
         String password = "password";
         Properties props = new Properties();     
         props.put("mail.smtp.host", host);
         //Set Session
         Session session = Session.getInstance(props, null);
         //Set the store
         try {
              Store store = session.getStore("imap");
              store.connect(host,username,password);
              //Get folder
              Folder folder = store.getFolder("INBOX");
              folder.open(Folder.READ_ONLY);
              //Get Mails
              message = folder.getMessages();
              //Fill table with mails
              for (int i = 0; i < message.length; i++)
                   if (message<i>.isSet(Flags.Flag.SEEN) == false)
                        if (message<i>.getSubject().equals("Travel Request Form"))
                             newEmailNodeElement = wdContext.createEmailElement();                 
                             newEmailNodeElement.setFrom(message<i>.getFrom()[0].toString());
                             newEmailNodeElement.setSubject(message<i>.getSubject());
                             newEmailNodeElement.setSentDate(message<i>.getSentDate().toString());
                             //Check for right Attachment
                             Object content = message<i>.getContent();
                             if ( content != null  && content instanceof Multipart)
                                  for (int j = 0 , n = ((Multipart)content).getCount(); j < n; j++)
                                       Part part = ((Multipart)content).getBodyPart(j);
                                       String disposition = part.getDisposition();
                                       if ( disposition != null && (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)))
                                            if (part.getFileName().equals("TravelRequest.pdf"))
                                                 newEmailNodeElement.setAttachment(true);
                                                 newEmailNodeElement.setContentType(part.getContentType().toString());
                                                 InputStream is = part.getInputStream();
                                                 ByteArrayOutputStream bo = new ByteArrayOutputStream();                                                                                
                                                 int c;
                                                 while ((c = is.read()) > -1) bo.write(c);
                                                 byte[] pdfSource = bo.toByteArray();
                                                 newEmailNodeElement.setPdfSource(pdfSource);
                                                 break;     
                                            else
                                                 newEmailNodeElement.setAttachment(false);     
                             wdContext.nodeEmail().addElement(newEmailNodeElement);
              //Close connection
              folder.close(true);
              store.close();          
         catch (MessagingException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
         catch (IOException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
         catch (NullPointerException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
        //@@end
    Regards
    Abdullah

    The error was caused when the subject used to return null

  • While trying to send mail getting NUll Pointer exception

    Hi,
    I am trying to send email through email notification but instance doesn't through any fault but on opmn log it sends null pointer exception and doesn't send any mail. But some other flow using same SMTP server are able to send mail.
    Exceptions:
    07/11/14 16:46:25 java.lang.NullPointerException
    07/11/14 16:46:25      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:363)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.email.EmailDriver.sendMessage(EmailDriver.java:207)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.email.EmailDriver.send(EmailDriver.java:185)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.DefaultNotificationServiceImpl.sendEmailNotification(DefaultNotificationServiceImpl.java:251)
    07/11/14 16:46:25      at oracle.tip.pc.services.notification.NotificationServiceImpl.sendEmailNotification(NotificationServiceImpl.java:271)
    07/11/14 16:46:25      at oracle.bpel.services.notification.queue.sender.MDBConsumer.deliverNotification(MDBConsumer.java:256)
    07/11/14 16:46:25      at oracle.bpel.services.notification.queue.sender.MDBConsumer.onMessage(MDBConsumer.java:137)
    07/11/14 16:46:25      at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
    07/11/14 16:46:25      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    07/11/14 16:46:25      at java.lang.reflect.Method.invoke(Method.java:585)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
    07/11/14 16:46:25      at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    07/11/14 16:46:25      at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    07/11/14 16:46:25      at com.evermind.server.ejb.MessageDrivenConsumer.onMessage(MessageDrivenConsumer.java:347)
    07/11/14 16:46:25      at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:233)
    07/11/14 16:46:25      at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
    07/11/14 16:46:25      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
    07/11/14 16:46:25      at java.lang.Thread.run(Thread.java:595)
    Any Idea?

    Hi,
    I am also trying E-mail Activity but I am not able to receive the e-mail.
    I have set the following in the ns_emails.xml
    <EmailAccount>
    <Name>Default</Name>
    <GeneralSettings>
    <FromName>Oracle BPM</FromName>
    <FromAddress>[email protected]</FromAddress>
    </GeneralSettings>
    <OutgoingServerSettings>
    <SMTPHost>Server' IPADRESS</SMTPHost>
    <SMTPPort>25</SMTPPort>
    </OutgoingServerSettings>
    <IncomingServerSettings>
    <SMTPHost>Server' IPADRESS</SMTPHost>
    <SMTPPort>25</SMTPPort>
    </IncomingServerSettings>
    In this "[email protected]" is the user configured and "Server' IPADRESS" is the IPADDRESS of the SMTP server.
    Moreover I have also have SMTP server as the incoming server.
    Now I have a simple BPEL PROCESS having Email Activity of sending a mail.
    The "To" section has "[email protected]".
    I am not able to recive the mail and I have also cheked the SMTP server there is no mail there but BPEL Process runs fine.
    I also have one Script which can send mail to the user Ihave mentioned and it works fine.So server setting seems to be fine.Are there any other setting required.
    If you are able to send the mail then can you give me your inputs on this issue.
    Regards
    Lalit

  • Muli File to File Scenario : Null Pointer Exception

    Hi All,
    I have a  FILE to FILE Scenario.  I intend to transfer Muliple Files from  one system to another.  FTP Servers are running on both the systems.
    1.  In the sender Communication channel:  I have set the name of  the Source Directory 
    2.  In the File name I set <nothing>
    3.  The advanced file selection option is ticked. 
    5. I set the Source directory name and the file mask *.txt in the table.
    all other configurations related to the FTP Server etc are done.
    When the scenario is executed, my sender communication channel shows a null pointer exception when Checked in the Runtime Workbench.
    Can anyone please help and  let me know what it is.
    Thanks,
    Abhishek

    Hi,
    This also does not help.
    One observation:
    If i set the Directory as  the real source directory
    and
    Set in the advance file selection
    The full directory name , and the Full file name for e.g XML1.txt , XML2.txt in the file mask, it works.
    But it results in a failure if I set  *.txt as the file mask.
    Thanks,
    Abhishek

  • Getting java.lang.Null pointer Exception when i close the pdf file.

    Hi,
    my application is java based thick client application.
    From my application, i am generating report file using crystal report tool.
    the report file is exported as pdf format and stored in my local macine. from this path, am displaying the report in a SWT browser.
    till now its working fine. when i close the browser, i am getting java.lang.null.pointer exception.
    i dont understand from this exception, printed in console.
    please help me.
    java.lang.NullPointerException
    at org.eclipse.swt.ole.win32.OleClientSite.onPaint(OleClientSite.java:921)
    at org.eclipse.swt.ole.win32.OleClientSite.access$2(OleClientSite.java:906)
    at org.eclipse.swt.ole.win32.OleClientSite$1.handleEvent(OleClientSite.java:131)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
    at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1424)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3842)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4541)
    at org.eclipse.swt.internal.ole.win32.COM.CoFreeUnusedLibraries(Native Method)
    at org.eclipse.swt.ole.win32.OleClientSite.releaseObjectInterfaces(OleClientSite.java:1084)
    at org.eclipse.swt.ole.win32.OleControlSite.releaseObjectInterfaces(OleControlSite.java:683)
    at org.eclipse.swt.ole.win32.OleClientSite.onDispose(OleClientSite.java:852)
    at org.eclipse.swt.ole.win32.OleClientSite.access$1(OleClientSite.java:847)
    at org.eclipse.swt.ole.win32.OleClientSite$1.handleEvent(OleClientSite.java:128)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
    at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:755)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
    at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:755)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
    at com.siemens.med.cad.hqm.reports.ReportViewer$1.widgetDisposed(ReportViewer.java:273)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
    at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:446)
    at org.eclipse.swt.widgets.Shell.dispose(Shell.java:674)
    at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308)
    at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1643)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3789)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366)
    at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366)
    at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2371)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3420)
    at com.siemens.med.cad.hqm.view.mainUI.HQMMainForm.buildMainShell(HQMMainForm.java:246)
    at com.siemens.med.cad.hqm.event.UserLoginEventHandler.loginDisplay(UserLoginEventHandler.java:240)
    at com.siemens.med.cad.hqm.event.UserLoginEventHandler.widgetSelected(UserLoginEventHandler.java:97)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
    this is the code i have written for display the report file in a browser:
    Display display = Display.getDefault() ;
         Shell shell = new Shell(display, SWT.RESIZE | SWT.CLOSE | SWT.MIN | SWT.MAX | SWT.APPLICATION_MODAL);
    shell.setText(reportTitle);
    shell.setLayout(new FillLayout());
    shell.setMaximized(false);
    shell.setSize(800, 600);
    Composite comp = new Composite(shell, SWT.NONE);
    comp.setLayout(new FillLayout());
    final Browser browser = new Browser(comp, SWT.FLAT);
    try {
    File file = new File(exportFile);
    URL url = file.toURL();
    browser.setUrl("file:" + url.getPath());
    } catch (MalformedURLException malURLEx) {
    // malURLEx.printStackTrace();
    throw new ProgrammingExceptionAdapter(malURLEx);
    shell.addDisposeListener(new DisposeListener() {
    public void widgetDisposed(DisposeEvent arg0) {
    File file = new File(exportFile);
    if (file != null && file.exists()) {
    file.delete();
    browser.dispose();
    shell.open();
    shell.setFocus()'

    TitiTruc, welcome to the forum. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • Null Pointer Exception in Bursting Engine

    Hi, I am trying the example given in XDO 5.6.2. but i am getting null pointer exception. Any help appreciated.
    1. burstCtrl.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <DATA>
    <DEPTS>
    <DEPT>
    <DEPTNO>20</DEPTNO>
    <NAME>Accounting</NAME>
    <MANAGER_EMAIL>[email protected]</MANAGER_EMAIL>
    <EMPLOYEES>
    <EMPLOYEE>
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7902</MGR>
    <HIREDATE>1980-12-17T00:00:00.000-08:00</HIREDATE>
    <SAL>800</SAL>
    <DEPTNO>20</DEPTNO>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPNO>7566</EMPNO>
    <ENAME>JONES</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>1981-04-02T00:00:00.000-08:00</HIREDATE>
    <SAL>2975</SAL>
    <DEPTNO>20</DEPTNO>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    </EMPLOYEES>
    </DEPT>
    <DEPT>
    <DEPTNO>30</DEPTNO>
    <NAME>Sales</NAME>
    <MANAGER_EMAIL>[email protected]</MANAGER_EMAIL>
    <EMPLOYEES>
    <EMPLOYEE>
    <EMPNO>7788</EMPNO>
    <ENAME>SCOTT</ENAME>
    <JOB>ANALYST</JOB>
    <MGR>7566</MGR>
    <HIREDATE>1982-12-09T00:00:00.000-08:00</HIREDATE>
    <SAL>3000</SAL>
    <DEPTNO>20</DEPTNO>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPNO>7876</EMPNO>
    <ENAME>ADAMS</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7788</MGR>
    <HIREDATE>1983-01-12T00:00:00.000-08:00</HIREDATE>
    <SAL>1100</SAL>
    <EMAIL>[email protected]</EMAIL>
    </EMPLOYEE>
    </EMPLOYEES>
    </DEPT>
    </DEPTS>
    </DATA>
    2. empData.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    <xapi:request
    select="/DATA/DEPTS/DEPT/EMPLOYEES/EMPLOYEE">
    <! - Burst on Customer element - >
    <xapi:delivery>
    <xapi:email server="xxx.server.com" port="25" from="[email protected]" reply-to=
    "">
    <xapi:message id="123" to="${EMAIL}"
    cc="[email protected]" attachment="true"
    subject="CustomerDetails">Please find the customer invoice as a attachment
    (Through Application).
    <! - Set the id for the delivery method - >
    <! - Use the Customer EMAIL element to email the document to the Customer - >
    </xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output-type="pdf" delivery="123">
    <!Specify the delivery method id to be used - >
    <xapi:template type="rtf"
    location="/home/lkkumar/Dept.rtf" />
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    3. BurstingTest.java
    import oracle.apps.xdo.batch.DocumentProcessor;
    import oracle.apps.xdo.batch.*;
    import oracle.apps.xdo.batch.object.*;
    import oracle.apps.xdo.delivery.*;
    import oracle.apps.xdo.delivery.smtp.*;
    import oracle.apps.xdo.*;
    import oracle.apps.xdo.oa.util.*;
    import java.util.*;
    import java.io.*;
    import java.io.InputStream;
    import oracle.apps.fnd.cp.request.*;
    public class BurstingTest
    public BurstingTest()
    try {
    DocumentProcessor dp = new DocumentProcessor
    ("/home/lkkumar/burstCtrl.xml","/home/lkkumar/empData.xml","/home/lkkumar");
    dp.process();
    } catch (Exception ex) {
              System.out.println(ex);
    ex.printStackTrace();
    } finally {
    public static void main(String[] args)
    BurstingTest burst1 = new BurstingTest();
    The program compiles fine. but when i execute it gives null pointer exception.
    (lkkumar) lkkumar- java BurstingTest
    java.lang.NullPointerException
    java.lang.NullPointerException
    at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:1313)
    at oracle.apps.xdo.batch.DocumentProcessor.process(DocumentProcessor.java:213)
    at BurstingTest.<init>(BurstingTest.java:19)
    at BurstingTest.main(BurstingTest.java:30)
    Message was edited by:
    user609950

    Any idea , why it failed ?
    were you able to resolve ??
    where did you deploy this java file ?
    how did you run this file ?

  • Null Pointer exception in ToplinkDataControlProvider

    Hi all,
    I'm using Jdeveloper 10.1.3.0.4 and ADF Faces with Toplink. After creating a new database diagram with new tables and creating physical tables in database, I have created POJO files from database objects. There is no problem at this point but when I want to create xml data control files for POJO files. The null pointer exception is thrown in the jdeveloper dialog window.
    thanks in advance
    --barisk                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi all,
    This time , After I removed (deleted) 2-3 POJO files (model files) which is mapped against database tables, I have tried to create POJO files again but jdeveloper IDE has shown error message via popup window. The exception message is given below:
    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:1049)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:231)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:201)
         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)
    I couldn't create POJO files and after clicking OK button in popup window; the progress indicator in another window which indicates the creation of POJO files moves continuously.... So please tell me, in where do I make mistake?
    best regards...
    --barisk                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Null pointer exception in native code. error 52 in Weblogic8.1

    Hi all,
    I'm using WLS 8.1SP5 with 1.4.2_08 and having this dump once a day, when people is working. I tryed google, but no luck. Can someone can help please?
    ===== BEGIN DUMP =============================================================
    JRockit dump produced after 5 days, 00:39:42 on Mon Oct 01 16:59:00 2007
    Additional information is available in:
    D:\web\bea\user_projects\domains\APIA_Prod\jrockit.2188.dump
    D:\web\bea\user_projects\domains\APIA_Prod\jrockit.2188.mdmp
    If you see this dump, please open a support case with BEA and
    supply as much information as you can on your system setup and
    the program you were running. You can also search for solutions
    to your problem at http://forums.bea.com in
    the forum jrockit.developer.interest.general.
    Error code: 52
    Error Message: Null pointer exception in native code
    Version : BEA WebLogic JRockit(TM) 1.4.2_08 JVM R24.5.0-61 ari-49095-20050826-1856-win-ia32
    Threads / GC : Native Threads, GC strategy: parallel
    : mmHeap->data = 0x00B60000, mmHeap->top = 0x40B60000
    : mmStartCompaction = 0x1EB60000, mmEndCompaction = 0x23B60000
    CPU : Intel Pentium 4 (HT)
    Number CPUs : 8
    Tot Phys Mem : 4025999360
    OS version : Microsoft Windows Server 2003 Service Pack 1 (Build 3790)
    State : JVM is shutting down
    Command Line : -Djava.class.path=.;C:\Program Files\Java\j2re1.4.2_05;C:\Program Files\Java\j2re1.4.2_05\lib;C:\Program Files\Java\j2re1.4.2_05\lib\tools.jar -Djrockit.launcher.type=jrockit.shipment -Xms1024m -Xmx1024m -Xgc:parallel -Xcleartype:local -Dweblogic.management.server=http://10.128.12.23:7001 -Dbea.home=D:\web\bea -Dweblogic.RootDirectory=D:\web\bea\user_projects\domains\APIA_Prod -Djava.class.path=.;D:\web\bea\jdk142_08\lib\tools.jar;D:\web\bea\WEBLOG~1\server\lib\weblogic_sp.jar;D:\web\bea\WEBLOG~1\server\lib\weblogic.jar -Djava.security.policy==D:\web\bea\WEBLOG~1\server\lib\weblogic.policy -Dweblogic.Name=Apia_Svr1 -Dweblogic.system.BootIdentityFile=D:\web\bea\WEBLOG~1\common\nodemanager\NodeManagerLogs\NodeManagerInternal\bootFile_APIA_Prod_Apia_Svr1 -Dweblogic.system.NodeManagerBoot=true -Dweblogic.system.NodeManagerAddress=null::5555 -Dweblogic.nodemanager.ServerStartTime=1190834358456 -Dweblogic.security.SSL.ignoreHostnameVerification=false -Dweblogic.ReverseDNSAllowed=false -Dsun.java.command=weblogic.Server
    Environment : JAVA_HOME=C:\Program Files\Java\j2re1.4.2_05, java.home=d:\web\bea\jrockit81sp5_142_08\jre, java.class.path=.;D:\web\bea\jdk142_08\lib\tools.jar;D:\web\bea\WEBLOG~1\server\lib\weblogic_sp.jar;D:\web\bea\WEBLOG~1\server\lib\weblogic.jar, java.library.path=d:\web\bea\jrockit81sp5_142_08\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D:\web\bea\WEBLOG~1\server\bin;D:\web\bea\jdk142_08\bin;D:\web\bea\jdk142_08\jre\bin;C:\Program Files\VERITAS\NetBackup\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\j2re1.4.2_05\bin
    C Heap : Good; no memory allocations have failed
    Registers (from context struct at 0x41D6F488/0x41D6F5A4):
    Converted EIP: 41eafe45
    EAX = 00001e90 EBX = 009db42c
    ECX = 003c1e90 EDX = 00000000
    ESI = 71c14280 EDI = 00000000
    EIP = 41eafe45 ESP = 41d6f870
    EBP = 41d6f880 EFL = 00010a03
    CS = 001b DS = 0023 ES = 0023
    SS = 0023 FS = 003b GS = 0000
    Stack:
    41d6f870 :00000000 00000000 003c95a8 003c1e90 00000000 004e91e1
    41d6f888 :0000008f 00000000 41d6f8c4 009db42c 00000001 00000000
    41d6f8a0 :41b802e0 4cfa3940 012b5068 4d87a5cc 012b5068 00000000
    41d6f8b8 :012b5068 41b81710 4ccfcdda 009b9ba8 004e9244 012b5310
    41d6f8d0 :0054deca 012b5315 4ccfc945 0000008f 50a0f1e8 009db42c
    41d6f8e8 :00000000 012b5258 4ccfcb33 012b5315 0000008f 012b5258
    41d6f900 :4ccfca44 012b525d 00000000 009b9ba8 41d6f918 41b823f8
    41d6f918 :4ccfc980 00553ff5 ffffffff 00000010 00000000 41d6f9e4
    41d6f930 :4d1126e8 009b9c34 41d6fa48 41d6f978 009b9c34 437faab0
    41d6f948 :fffffffe 00000002 fffffffe 00000000 41d6f978 00570b50
    41d6f960 :00000000 009b9ba8 00090000 009b9c34 00000001 7c8302e7
    41d6f978 :00000000 00570b50 fffffff8 00000001 0000008f 0000008c
    41d6f990 :437faaf0 00000000 00000000 00000000 00000000 41d6f918
    41d6f9a8 :41b823c0 ffffffff 437f9fc0 437faab0 009b9c34 4ccfc980
    41d6f9c0 :0000008f 41d6f918 00000001 00000001 00000010 00000000
    41d6f9d8 :00000000 41d6f918 009b9c34 009b9ba8 00533bb1 009b9c34
    41d6f9f0 :50a0f1b8 4d1126e8 00000000 41d6fa44 005539c0 41d6fa48
    41d6fa08 :009b9ba8 437f9fc0 41d6fa50 009b9c34 0059065c 50a0f1b8
    41d6fa20 :00535583 009b9c34 437faab0 00000000 41d6fa44 005539c0
    41d6fa38 :00000001 41d6fa48 00533729 41d6fa68 00000000 00000000
    41d6fa50 :0000008f 00569db2 009b9c34 437f9fd4 437faab0 0000008f
    41d6fa68 :009b9ba8 009b9c34 0000000f 00000002 00569ef7 0000008f
    41d6fa80 :009b9ba8 0056a38d 009b9ba8 009b9ba8 41d6ff80 009b9ba8
    41d6fa98 :7ffde000 009b9c34 41d6ff98 00525ca0 00572cf0 00000000
    41d6fab0 :00000000 00000000 00000000 00000000 00000000 00000000
    41d6fac8 :00000000 00000000 00000000 00000000 00000000 00000000
    41d6fae0 :00030178 00000269 00000000 00000000 00000000 00000000
    41d6faf8 :00000000 00000000 00000000 00000000 00000000 00000000
    41d6fb10 :00000000 00000000 00000000 00000000 00000000 00000000
    41d6fb28 :00000000 00000000 00037c28 00000000 00000000 00000000
    41d6fb40 :00000000 00000013 00000000 00037c20 00030168 00000042
    41d6fb58 :00037c20 00000013 00030178 00000000 00000098 00000000
    41d6fb70 :00030000 009d6850 00000210 4100fbbc 00000098 4100f980
    41d6fb88 :00380000 41d6f988 00000000 41d6fbd4 7c82f680 7c82fb28
    41d6fba0 :ffffffff 7c82fb23 7c3423aa 771f123c 00000000 00000002
    41d6fbb8 :771f0000 41d6fc10 00095e70 00000001 00000000 41d6fca8
    41d6fbd0 :771f46c9 771f1240 ffffffff 771f123c 771f11e8 771f0000
    41d6fbe8 :00000002 00000000 00000000 41d6fc10 00000001 41d6fc1c
    41d6fc00 :7c82257a 771f0000 00000001 00000000 00000001 00000000
    41d6fc18 :00097f98 00000001 00000000 41d6fcb8 7c81a81b 7c889d94
    41d6fc30 :7c81b26f 00000000 7ffdc000 00000000 00000000 00000000
    41d6fc48 :00000000 00000000 00000000 00000000 00000000 00000000
    41d6fc60 :00000000 00000024 00000001 00000000 00000000 00000070
    41d6fc78 :ffffffff ffffffff 7c81a7dc 7c81a7a4 00000000 00000000
    41d6fc90 :00097f98 771f11a0 00000418 000000f5 009dc120 41d6fecc
    41d6fca8 :7c82fda6 7c82fb23 0000040c 0000040c 009b9ba8 7c822054
    41d6fcc0 :7c81b23f 41d6fd28 00000000 009dbad8 00000000 00000000
    41d6fcd8 :00000000 00000000 00000000 00000000 00000000 00000000
    41d6fcf0 :00000000 00000000 00000000 41d6fcc4 00000000 41d6fff4
    41d6fd08 :7c82f680 009dc530 ffffffff 7c81b23f 7c8211b4 0000000c
    41d6fd20 :41d6fd28 00000001 00010017 00000000 00000000 00380178
    41d6fd38 :00000000 00000000 00000000 00000005 f7547000 0000010d
    41d6fd50 :000007ff 00000001 624e4d43 00000060 ae19faa4 009dc120
    41d6fd68 :e4d11360 e24e4d43 00000005 0000000e e310e008 ffffffff
    41d6fd80 :3b9aca07 e33dd7e8 3b9aca07 3b9aca07 00380178 1a30eb0a
    41d6fd98 :009dc538 8093d69b 009d99e8 00000000 00380178 c0000034
    41d6fdb0 :808ad480 00000000 00000038 009d99f0 00000023 00000000
    41d6fdc8 :00000000 009dbad8 00000000 00000000 0056f660 00000000
    41d6fde0 :77e6b5f3 0000001b 00000200 41d6fffc 00000023 00000698
    41d6fdf8 :0000076a e47bbbf0 00000090 00000006 00000005 f7547000
    41d6fe10 :ae19fbd4 e131ec08 ae19fbd8 d3f0fe22 d3f0fe22 000000f5
    41d6fe28 :8093cb16 e131ec08 e105bf1c 00000025 ae19fbd0 009d99f0
    41d6fe40 :e105bfb0 ae19fbd4 8093cb6e 3b9aca07 e131ec08 8083a8f5
    41d6fe58 :00000000 00000000 80a78be3 badb0d00 80010031 00000005
    41d6fe70 :009dc120 00000005 c0502000 009dccd8 77ce8221 00000083
    41d6fe88 :00000000 009dc118 ae19fba8 00000418 009dc118 009dc120
    41d6fea0 :00380178 00000001 00000418 0000ad58 00380000 41d6fcb0
    41d6feb8 :f772fa00 41d6fefc 7c82f680 7c82fb28 ffffffff 7c82fb23
    41d6fed0 :7c3416b3 00380000 00000000 7c3416b8 0000040c 00000000
    41d6fee8 :009b9ba8 ffffffff 41d6ff3c 41d6fee0 41d6ff40 41d6ff98
    41d6ff00 :7c34240d 7c37a2a8 ffffffff 7c3416b8 7c3416db 0000040c
    41d6ff18 :7c3416f8 0000040c 00000000 00504b4d 0000040c 0107e577
    41d6ff30 :41d6ff6c 0057de91 009b9ba8 009b9ba8 00003000 00000140
    41d6ff48 :41d6ff64 41d6ffa0 0056f1f9 41c70000 00003000 009b9ba8
    41d6ff60 :009db8b0 009b9ba8 0056e9c2 7c821dd4 009b9ba8 009b9ba8
    41d6ff78 :009b9ba8 00572ce9 41d6ffa0 00572ded 77e6eccd 009dbad8
    41d6ff90 :009dbad8 7ffde000 41d6ffdc 00525ca0 41d6ffec 0056f6c7
    41d6ffa8 :009b9ba8 00000000 00000000 00000740 009dbaf4 77e6608b
    41d6ffc0 :00000740 00000000 00000000 009dbad8 c9792963 41d6ffc4
    41d6ffd8 :000d4193 ffffffff 77e6b7d0 77e66098 00000000 00000000
    Code:
    41eafd45 :00000000 00000000 00000000 00000000 00000000 00000000
    41eafd5d :00000000 00000000 ff4e4be0 00ffffff 007ffdc0 00000000
    41eafd75 :34001590 0041eafd 98000000 d041eaff 0077e6b7 0077e6bb
    41eafd8d :a4000000 4241eafd 2877e6ba ff000007 00ffffff 68000000
    41eafda5 :0c41d6f8 280056e6 ff000007 0fffffff 48001d1a 8000aece
    41eafdbd :00006093 987ffda0 c0005710 98004fe0 38009da3 0041eafe
    41eafdd5 :40000000 9841eafe f8009da3 0001c83c e0000000 0001c83c
    41eafded :17000000 80004f66 38006093 3841eafe 2041eafe 00f7c4ca
    41eafe05 :da7ffda0 20004f20 c0f7c4ca 00004fe0 00000000 b5000000
    41eafe1d :98004f2e 98009da3 00009da3 9841eaff 58009da3 00303fe0
    41eafe35 :00000000 50000000 0000570b 98000000 00009da3 00000000
    41eafe4d :80000000 f5006093 388083a8 5041eafe 0000570b 98000000
    41eafe65 :31009da3 00800100 60000000 00005c0e 58000000 5041eafe
    41eafe7d :0000570b 98000000 00009da3 00000000 d0000000 00005c0e
    41eafe95 :31000000 00800100 00000000 00000000 ff000000 00ffffff
    41eafead :00000000 cc000000 0080a78b e0f7757a 78adbbab 5041eafe
    41eafec5 :0000570b 98000000 b7009da3 608083e6 2888736a 90005c0e
    41eafedd :7888736a 5041eafe 0000570b 98000000 3c009da3 0041eaff
    41eafef5 :20000000 00005c0f 80000010 f041eaff 0000572c 84000000
    41eaff0d :917c8218 ff77e41a 3cffffff 4041eaff 4041eaff 64000001
    41eaff25 :f041eaff 6c009de2 2d41eaff 0600540a 98000000 f0009da3
    41eaff3d :00009de2 40000030 64000001 a041eaff f941eaff 000056f1
    Loaded modules:
    (* denotes the module causing the exception)
    0x7c800000-0x7c8bffff C:\WINDOWS\system32\ntdll.dll
    0x77e40000-0x77f41fff C:\WINDOWS\system32\kernel32.dll
    0x77f50000-0x77febfff C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000-0x77ceefff C:\WINDOWS\system32\RPCRT4.dll
    0x77ba0000-0x77bf9fff C:\WINDOWS\system32\MSVCRT.dll
    0x00410000-0x0061afff d:\web\bea\jrockit81sp5_142_08\jre\bin\jrockit\jvm.dll
    0x76aa0000-0x76accfff C:\WINDOWS\system32\WINMM.dll
    0x77c00000-0x77c47fff C:\WINDOWS\system32\GDI32.dll
    0x77380000-0x77411fff C:\WINDOWS\system32\USER32.dll
    0x7c8d0000-0x7d0d3fff C:\WINDOWS\system32\SHELL32.dll
    0x77da0000-0x77df1fff C:\WINDOWS\system32\SHLWAPI.dll
    0x71c00000-0x71c16fff C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000-0x71bf7fff C:\WINDOWS\system32\WS2HELP.dll
    0x7c340000-0x7c395fff C:\WINDOWS\system32\MSVCR71.dll
    0x71bc0000-0x71bc7fff C:\WINDOWS\system32\rdpsnd.dll
    0x771f0000-0x77200fff C:\WINDOWS\system32\WINSTA.dll
    0x71c40000-0x71c97fff C:\WINDOWS\system32\NETAPI32.dll
    0x76b70000-0x76b7afff C:\WINDOWS\system32\PSAPI.DLL
    0x77420000-0x77522fff C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.2778_x-ww_A8F04F11\comctl32.dll
    0x76f50000-0x76f62fff C:\WINDOWS\system32\Secur32.dll
    0x00b30000-0x00b48fff d:\web\bea\jrockit81sp5_142_08\jre\bin\java.dll
    0x00b50000-0x00b5dfff d:\web\bea\jrockit81sp5_142_08\jre\bin\verify.dll
    0x71b20000-0x71b60fff C:\WINDOWS\System32\mswsock.dll
    0x76ed0000-0x76efefff C:\WINDOWS\system32\DNSAPI.dll
    0x76f80000-0x76f87fff C:\WINDOWS\system32\rasadhlp.dll
    0x42c30000-0x42c34fff D:\web\bea\weblogic81\server\bin\wlntio.dll
    0x68000000-0x6802efff C:\WINDOWS\system32\rsaenh.dll
    0x00a90000-0x00a95fff D:\web\bea\jrockit81sp5_142_08\jre\bin\ioser12.dll
    0x02800000-0x028c0fff d:\web\bea\jrockit81sp5_142_08\jre\bin\dbghelp.dll
    0x77b90000-0x77b97fff C:\WINDOWS\system32\VERSION.dll
    Java Thread ID = 0x00000100, lastJavaFrame = 0x41D6F8E0, Name = (Signal Handler)
    Thread Stack Trace:
    at _vmShutdown+225()@0x004E91E1
    at java/lang/Shutdown.halt(Native Method)@0x4CCFC910
    at java/lang/Shutdown.exit(Unknown Source)@0x4CCFCA44

    You would need to get BEA support, after verifying you are on a supported configuration (http://edocs.bea.com/jrockit/jrdocs/suppPlat/supp_142.html).
    Otherwise you may need to try update 10, or use Sun JVM.

  • Help with Null Pointer Exception

    Hi, I am working on a simple menu program. It compiles and works correctly except for one item. I am having a problem with Greying out a menu item...... Specifically, When I press the EDIT / OPTIONS / READONLY is supposed to Greyout the Save and SaveAs options. But, when I do that it displays a Null Pointer Exception error message in the command window.
    Your advice would be much appreciated!
    Now for the code
    /  FileName Menutest.java
    //  Sample Menu
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class MenuTest extends JFrame {
       private Action saveAction;
         private Action saveAsAction;
         private JCheckBoxMenuItem readOnlyItem;
       // set up GUI
       public MenuTest()
          super( "Menu Test" );
    //*   file menu and menu items
          // set up File menu and its menu items
          JMenu fileMenu = new JMenu( "File" );
          // set up New menu item
          JMenuItem newItem = fileMenu.add(new TestAction( "New" ));
          // set up Open menu item
          JMenuItem openItem = fileMenu.add(new TestAction( "Open" ));
              //  add seperator bar
              fileMenu.addSeparator();
          // set up Save menu item
          JMenuItem saveItem = fileMenu.add(new TestAction( "Save" ));
          // set up Save As menu item
          JMenuItem saveAsItem = fileMenu.add(new TestAction( "Save As" ));
              //  add seperator bar
              fileMenu.addSeparator();
              // set up Exit menu item
          JMenuItem exitItem = new JMenuItem( "Exit" );
          exitItem.setMnemonic( 'x' );
          fileMenu.add( exitItem );
          exitItem.addActionListener(
             new ActionListener() {  // anonymous inner class
                // terminate application when user clicks exitItem
                public void actionPerformed( ActionEvent event )
                   System.exit( 0 );
             }  // end anonymous inner class
          ); // end call to addActionListener
    //*   Edit menu and menu items
              // set up the Edit menu
              JMenu editMenu = new JMenu( "Edit" );
              //JMenuItem editMenu = new JMenu( "Edit" );
          // set up Cut menu item
          Action cutAction = new TestAction("Cut");
          cutAction.putValue(Action.SMALL_ICON, new ImageIcon("cut.gif"));
          // set up Copy menu item
          Action copyAction = new TestAction("Copy");
          copyAction.putValue(Action.SMALL_ICON, new ImageIcon("copy.gif") );
          // set up Paste menu item
          Action pasteAction = new TestAction("Paste");
          pasteAction.putValue(Action.SMALL_ICON, new ImageIcon("paste.gif") );
              editMenu.add(cutAction);
              editMenu.add(copyAction);
              editMenu.add(pasteAction);
          //  add seperator bar
              editMenu.addSeparator();
              // set up Options menu, and it submenus and items
              JMenu optionsMenu = new JMenu("Options");
              readOnlyItem = new JCheckBoxMenuItem("Read-only");
              readOnlyItem.addActionListener(
                   new ActionListener()
                   {  //  anonymous inner class
                        public void actionPerformed( ActionEvent event)
                          saveAction.setEnabled(!readOnlyItem.isSelected());
                          saveAsAction.setEnabled(!readOnlyItem.isSelected());
                }  // end anonymous inner class
              ); // end call to addActionListener
              optionsMenu.add(readOnlyItem);
              // add seperator bar
              optionsMenu.addSeparator();
              //  Work on Radio Buttons
              ButtonGroup textGroup = new ButtonGroup();
              JRadioButtonMenuItem insertItem = new JRadioButtonMenuItem("Insert");
              insertItem.setSelected(true);
              JRadioButtonMenuItem overTypeItem = new JRadioButtonMenuItem("Overtype");
              textGroup.add(insertItem);
              textGroup.add(overTypeItem);
              optionsMenu.add(insertItem);
              optionsMenu.add(overTypeItem);
              editMenu.add(optionsMenu);
    //*   Help menu and menu items
              // set up the Help menu
              JMenu helpMenu = new JMenu( "Help" );
              helpMenu.setMnemonic( 'H' );
          // set up index menu item
          JMenuItem indexItem = helpMenu.add(new TestAction( "Index" ));
          indexItem.setMnemonic( 'I' );
          helpMenu.add( indexItem );
              // set up About menu item
          JMenuItem aboutItem = new JMenuItem( "About" );
          aboutItem.setMnemonic( 'A' );
          helpMenu.add( aboutItem );
          aboutItem.addActionListener(
             new ActionListener() {  // anonymous inner class
                // display message dialog when user selects Open
                public void actionPerformed( ActionEvent event )
                   JOptionPane.showMessageDialog( MenuTest.this,
                      "This is MenuTest.java \nVersion 1.0 \nMarch 15, 2004",
                      "About", JOptionPane.PLAIN_MESSAGE );
             }  // end anonymous inner class
          ); // end call to addActionListener
          // create menu bar and attach it to MenuTest window
          JMenuBar bar = new JMenuBar();
          setJMenuBar( bar );
          bar.add( fileMenu );
              bar.add( editMenu );
              bar.add( helpMenu );
          setSize( 500, 200 );
          setVisible( true );
       } // end constructor
       public static void main( String args[] )
          MenuTest application = new MenuTest();
          application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
       // inner class to handle action events from menu items
       private class ItemHandler implements ActionListener {
          // process color and font selections
          public void actionPerformed( ActionEvent event )
           repaint();
          } // end method actionPerformed
       } // end class ItemHandler
       //  Prints to action name to System.out
      class TestAction extends AbstractAction
              public TestAction(String name) { super(name); }
          public void actionPerformed( ActionEvent event )
             System.out.println(getValue(Action.NAME) + " selected." );
       } // end class TestAction
    } // end class MenuTest

    alan, I've been trying to figure out a solution.
    You can initialize it like this
    private Action saveAction= new Action();
         private Action saveAsAction=new Action();
    THE ABOVE WILL NOT WORK.
    because Action is an interface. An interface does not have constructors. However, interface references are used for polymorphic purposes.
    Anyway, all you have to do is find some class that implemets Action interface.... I cant seem to find one. Or maybe this is not how its supposed to be done?
    Hopefully, someone can shed some light on this issue.
    FYI,
    http://java.sun.com/products/jfc/swingdoc-api-1.1/javax/swing/Action.html

  • WPUMFactory.getUserFactory() throws null pointer exception

    Hi,
    I am trying to use KM API's to read files from KM repository. I am using the below code as mentioned in the blog: How to download KM documents using Web Dynpro Java
    Below is my code:
    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
    com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
    IUser epUser = WPUMFactory.getUserFactory().getEP5User(sapUser);
    However the line WPUMFactory.getUserFactory() throws null pointer exception. Can some one please help on why these happens as these seems to be the standard code to read a file from KM.
    Thanks.
    Regards,
    Ponraj M

    Hi Ponraj ,
    Instead of fetching the current logged on user , use the below line to set the resource context and see if it helps .
    com.sapportals.wcm.repository.IResourceContext resourceContext = ResourceFactory.getInstance().getServiceContext("cmadmin_service");
    cmadmin_service is a existing user that can be used to access KM resources .
    Regards
    Mayank

  • Returning vector and null pointer exception

    Hi, I'm writing a mailing program which so far is working fine, but I have now run into a problem which is completely throwing me. My mailer needs to be able to load multiple attachments - and also to be able to deal with an HTML text which contains multiple images. In each case, what I'm trying to do is to put the attachments and the images into separate vectors and process them through an iterator. The logic, at least, I hope is correct.
    I can get my code to compile but it keeps throwing a null pointer exception a runtime. Somehow, I just can't get it to pass the vector from one part of the code to another.
    Can anyone help me? I've tried various things, none of which seem to work. My code, as it stands, is posted in a skeletal form below.
    Thanks for any ideas:
    public class MailSender
       // declare various variables, including:   
         Vector embeddedImages;
         String HTMLString;
        public MailSender()
            setup();
        private void setup()
         //this part of the program sets up the various parts of the mail  (to, from, body etc)    
          HTMLString = "blah blah blah";  //sample HTMLString   
           Vector embeddedImages = null; //is this correct?
            if (HTMLString.length() > 0)
                processHTMLString(HTMLString);
         private String procesHTMLString(String htmlText)
            Vector embeddedImages = new Vector(); // I construct my vector here, is this correct?
            //Here I process the HTML string to extract the images
            //get the file path of the image and pass it to the vector
            addToVector(imageFile);
            return HTMLString;
        public Vector addToVector(String imageFile)
            embeddedImages.add(imageFile);
            return embeddedImages;
        private void send()
            //this part does the sending of the mail
            //at some part in this method I need to get at the contents of the vector:
            //but this part isn't working, I keep getting a null pointer exception
            Iterator singleImage = embeddedImages.iterator();
            while (singleImage.hasNext())
        public static void main(String[] args)
            MailSender ms = new MailSender();
            ms.send();
            System.out.println("MailSender is done ");
    }

    >>>>while they don't have a clue on how the language and/or programming in general works.
    Thank you, salpeter, for your esteemed estimation of my programming competence.
    >>>What I'm wondering is: how come people always start building applications... blah blah
    The reason being, is that it happens to be my job.
    OK, I'm perhaps slower than most and there are things I don't yet understand but I get paid probably about a tenth of what you do (and maybe even less). I regard it as a kind of apprenticeship which, after a past life having spent twenty years packing crates in a warehouse, is worth the sacrifice. Six months ago I'd never written a line of code in my life and everything I've learned since has been from books, the good people in these forums, and a lot of patient trial and error. It's hard work, but I'll get there.
    I say this, only as encouragement to anyone else who is trying to learn java and hasn't had the benefit of IT training at school and a four year computing course at university paid for by the parents, and for whom the prohibitive cost (in both time and money) of most java courses would never allow them to get on this ladder.
    Excuse my somewhat acerbic posting, but comments such as yours tend to provoke...
    Thank you EverNewJoy for explaining this to me. I haven't had time yet to try it out, but at least the concept now is clear to me.

  • Jbo null pointer exception whilst creating an AM

    Hello,
    I am trying to create some EO's,VO's and associated AM. At the end of the creation, I tend to get the following error
    Load Error
    Exception: oracle.jbo.dt.objects.JboException(java.lang.NullPointerException).
    The creation of EO's runs smooth, but if I decide to create the associated VO's and the AM, the application hangs, and I have to kill it before I can move forward.
    Please guide me

    I am sorry I was ambiguous in my previous post.
    I am trying to create a EO/VO/AM triplet for a host of tables using JDev 11g, and the tables under the 'mct' database.
    I followed the following steps to create my triplet.
    1. Using the EO wizard, I selected a host of tables, for instance, MCT_CONFIG_CONTACT_CENTER_VL from the MCT db
    2. Following the usual steps, I tend to get the null pointer exception, with a 'load error' for one of the classes contained in a zip file, which I do not think I'm using, in the creation of the EO.
    In the light of the above scenario, can you please guide me?

Maybe you are looking for