Null pointer exec. in Runtime.execute()

Hello,
I have a very simple shell script in /tmp directory which I want to execute, so I do
Runtime.getRuntime.execute(String "scriptname",String [] null, File "/tmp");
and it gives me nullpointer exception, any clue what I am missing...
thanks,

Your params to pass to the execute should look like
Runtime.getRuntime.execute("ksh -c /tmp/scriptname");
where ksh is your shell and -c is the parm to pass to execute a script.
or use this class
as
SysCommands sysc = new SysCommands();
String[] value_returned = sysc.execute(sysc.setCommand("/tmp/myscript");
import java.io.*;
import java.util.Vector;
public class SysCommands {
private static int osname = 0;
public SysCommands() {
getSystem();
public String getSystem(){
String OS = System.getProperty("os.name");
if(OS.equals("Windows 2000")){
osname = 1;
} else if(OS.equals("AIX")){
osname = 2;
} else if(OS.equals("Windows XP")){
osname = 3;
} else if(OS.equals("Linux")){
osname = 4;
} else {
osname = 0;
// Add any other OS you may need.
return OS;
public String[] setCommand(String cmd){
String[] command = new String[3];
switch(osname){
case 1:
command[0] = "cmd.exe";
command[1] = "/c";
command[2] = cmd;
break;
case 2:
command[0] = "ksh";
command[1] = "-c";
command[2] = cmd;
break;
case 3:
command[0] = "cmd.exe";
command[1] = "/c";
command[2] = cmd;
break;
case 4:
command[0] = "bash";
command[1] = "-c";
command[2] = cmd;
break;
case 0:
break;
return command;
public String[] execute(String[] command){
Vector v = new Vector();
try {
Process p2 = Runtime.getRuntime().exec(command);
BufferedReader br2 = new BufferedReader(new InputStreamReader(p2.getInputStream()));
String line = br2.readLine();
v.addElement(line);
for(int t=0; line != null; t++){
line = br2.readLine();
v.addElement(line);
br2.close();
} catch(Exception e){
// Enter your own error logging.
//Log log = new Log();
//log.createLog("Execution.err", "Error in execution." + e.getMessage() + " - " + e.toString());
int LENGTH = v.size() -1;
String[] returnArray = new String[LENGTH];
for(int i=0; i < LENGTH; i++){
returnArray[i] = "" + v.elementAt(i);
return returnArray;

Similar Messages

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

  • 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

  • Null pointer exception when running OAF page

    Hi
    I am getting null pointer exception when i execute the code below.
    OAApplicationModule am = oapagecontext.getRootApplicationModule();
    OAApplicationModuleImpl childam = (OAApplicationModuleImpl)am.findApplicationModule("QuestAnswerAM");
    oapagecontext.putDialogMessage(new OAException("PER", "XXOM_APPR_OVR_NULL_MSG"+am+childam, null, OAException.ERROR, null));
    OAViewObjectImpl VO= (OAViewObjectImpl)childam.findViewObject("QuestDetailsVO") ;
    OAViewRowImpl Dff1Row = (OAViewRowImpl)VO.getCurrentRow();
    quest = Dff1Row.getAttribute("LastUpdateDate");
    I later commented out the last 3 lines and used the code below to track the application module name.
    OAApplicationModule am = oapagecontext.getRootApplicationModule();
    OAApplicationModuleImpl childam = (OAApplicationModuleImpl)am.findApplicationModule("QuestAnswerAM");
    oapagecontext.putDialogMessage(new OAException("PER", "XXOM_APPR_OVR_NULL_MSG"+am+childam, null, OAException.ERROR, null));
    When i run the page i am getting this error:
    Message not found. Application: PER, Message Name: XXOM_APPR_OVR_NULL_MSGoracle.apps.per.selfservice.appraisals.server.AppraisalsAMImpl@2982bfnull.
    the above error indicates that the Root application module is AppraisalsAMImpl.
    But the view i need that is QuestDetailsVO exists in a child AM that is QuestAnswerAM. However in the above diag message as you can see it returns child AM to be null.
    When i click on About this page it clearly says that the QuestDetailsVO exists in QuestAnswerAM
    Please help
    Thanks
    Ashish

    Hi
    Thanks for the quick response.
    I am fine with the error message:
    Message not found. Application: PER, Message Name: XXOM_APPR_OVR_NULL_MSGoracle.apps.per.selfservice.appraisals.server.AppraisalsAMImpl@2982bfnull.
    I am getting message not found becos I have registered only XXOM_APPR_OVR_NULL_MSG and am displaying '+am+childam' also in the exception which is not associated with the registered message.
    See below.
    oapagecontext.putDialogMessage(new OAException("PER", "XXOM_APPR_OVR_NULL_MSG"+am+childam, null, OAException.ERROR, null));
    I am fine with that. My concern is in the error above for 'am' part i am getting the root appl module name. but for childam i am getting null
    Message not found. Application: PER, Message Name: XXOM_APPR_OVR_NULL_MSGoracle.apps.per.selfservice.appraisals.server.AppraisalsAMImpl@2982bf*null*.
    See the high lighted.
    I will look into the current row returning -1 issue and get back to you./
    Thanks
    Ashish

  • Null pointer exception while executing a scenario from cloned work repo

    Hi,
    I have involved in ODI 10g to 11g migration activity.
    For doing that activity, i cloned the existing master and work repositories into some intermediate master and work schemas.
    Created new configuration settings for pointing the odi 10g to the intermediate master and work repositories.
    Everything is fine till this, but while executing any interface or package anything from intermediate work repo designer, am facing error as below
    "Cannot start the execution, Null pointer exception"
    java.lang.NullPointerException
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.prepare(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.t(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.dbobj.SnpSession.localExecute(SnpSession.java)
         at com.sunopsis.graphical.l.or.e(or.java)
         at com.sunopsis.graphical.r.z.actionPerformed(z.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Note: My previous and cloned Master's work's repository id are same
    Could anyone pls help on this.
    Thanks in advance..

    The error is resolved by following the below solution
    If you receive an error in ODI 10g like;
    java.lang.Exception: Error during Session launching
    at com.sunopsis.dwg.dbobj.SnpSession.remoteExecute
    or
    java.lang.NullPointerException
    at com.sunopsis.dwg.cmd.DwgCommandBase.prepare(DwgCommandBase.java)
    1.First check whether your agents are working and test connection to repositories. If everything ok, you might have changed your repository name recently.
    2.When you export your work and master repository and import to another schema or database and whether you connect to your imported repository, you change your repository name in your first environment.
    3.Correct order is first rename your Master Repository name, log off / log on and change your Work Repository name and check below fields in both your Master and Work Repositories in both environments.
    Master Repository : SNP_REM_REP
    Work Repository : SNP_LOC_REPW
    REP_NAME column of MASTER_REP.SNP_REM_REP should be equal to REP_NAME column in WORK_REP.SNP_LOC_REPW.
    You cannot see WORK_REP.SNP_LOC_REPW value in ODI Topology Manager and if you are changing your repository name you need to update value from database.
    Change the value from DB, loggoff and logon the user and connect the designer again.
    Regards

  • JRC (upg. to CR4E) - Report w Subreport - Oracle DB -  Null Pointer Excepti

    Hi
    We have a Crystal Designer/Developer Version 11.5.10.1263. We develop reports using this.
    Most of the reports have SQL Command mode design with JNDI/JDBC connection. It gets deployed with our Web application. And during runtime, when users access these reports from our web application, we typically use Java Reporting Component with Crystal Report Viewer SDK to open and display the report to the user.
    Besides other issues, current problem I am having is:
    I have a sub-report in my report. I am connecting to Oracle database. If this sub-report does not return any rows, I was getting a Null Pointer Exception. This seems to be a known bug. This happened to us when we had just the above mentioned components.
    We recently upgraded just the JAR libraries to the ones packaged in CR4E (Crystal Reports For Eclipse) - initially to get more exporting capability.This upgrade gets us past the Null Pointer Exception issue.
    Now, I am getting an error like "Unexpected database connector error". Please see the exception stack trace below if needed. Since we are a product and this display is specific to one out of about 100 different clients; with all the time we spent on making this report stuff work against this oracle DB client, we had finally ended up creating the display in JSP into our general product just for one of about 100 clients. Client must be the Lucky one...As a developer, I felt really frustrated.
    One note:- SQL Server DB works perfect.
    Other thing - Do we need to change any API calls after upgrading the JARS from standard JRC/Viewer to CR4E package?
    11:46:57,540 INFO  [STDOUT] 11:46:57,540 ERROR [JRCCommunicationAdapter]  detected an exception: Unexpected database connector error
         at com.crystaldecisions.reports.datafoundation.DFQuery.for(SourceFile:632)
         at com.crystaldecisions.reports.datalayer.a.do(SourceFile:1621)
         at com.crystaldecisions.reports.datalayer.a.a(SourceFile:1404)
         at com.crystaldecisions.reports.dataengine.m.b(SourceFile:334)
         at com.crystaldecisions.reports.dataengine.j.b(SourceFile:515)
         at com.crystaldecisions.reports.dataengine.m.o(SourceFile:408)
         at com.crystaldecisions.reports.dataengine.m.a(SourceFile:173)
         at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:114)
         at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:95)
         at com.crystaldecisions.reports.dataengine.j.case(SourceFile:1080)
         at com.crystaldecisions.reports.dataengine.h.<init>(SourceFile:108)
         at com.crystaldecisions.reports.dataengine.DataContext.a(SourceFile:254)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4660)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4574)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.new(SourceFile:2652)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.byte(SourceFile:2610)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.try(SourceFile:2282)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.int(SourceFile:2442)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.I(SourceFile:1013)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.if(SourceFile:4816)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:2020)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:309)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:250)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.a(SourceFile:922)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.e(SourceFile:784)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.for(SourceFile:242)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:243)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:210)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.v.a(SourceFile:185)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.v.a(SourceFile:230)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:359)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:133)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ColumnFormatter.for(SourceFile:120)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.a(SourceFile:511)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.a(SourceFile:452)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.a(SourceFile:369)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ah.a(SourceFile:72)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ReportColumnFormatter.a(SourceFile:86)
         at com.crystaldecisions.reports.formatter.formatter.paginator.SinglePageFormatter.a(SourceFile:332)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:359)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:133)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ColumnFormatter.for(SourceFile:120)
         at com.crystaldecisions.reports.formatter.formatter.paginator.SinglePageFormatter.for(SourceFile:177)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
         at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.do(SourceFile:737)
         at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.formatPage(SourceFile:236)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.byte(SourceFile:219)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1909)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:167)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:529)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:527)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:525)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:424)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:352)
         at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
         at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
         at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(SourceFile:767)
         at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(SourceFile:324)
         at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.getPage(SourceFile:149)
         at com.businessobjects.report.web.event.s.a(SourceFile:158)
         at com.businessobjects.report.web.event.s.a(SourceFile:127)
         at com.businessobjects.report.web.event.bt.a(SourceFile:47)
         at com.businessobjects.report.web.event.bw.broadcast(SourceFile:93)
         at com.businessobjects.report.web.event.am.a(SourceFile:53)
         at com.businessobjects.report.web.a.t.if(SourceFile:2104)
         at com.businessobjects.report.web.e.a(SourceFile:300)
         at com.businessobjects.report.web.e.a(SourceFile:202)
         at com.businessobjects.report.web.e.a(SourceFile:135)
         at com.crystaldecisions.report.web.ServerControl.a(SourceFile:607)
         at com.crystaldecisions.report.web.ServerControl.processHttpRequest(SourceFile:342)
         at org.apache.jsp.ipalHistoryReportViewer_jsp._jspService(org.apache.jsp.ipalHistoryReportViewer_jsp:201)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.Standar
    11:46:57,540 INFO  [STDOUT] dEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    11:46:57,634 INFO  [STDOUT]  CustomReports - finally Calling CrystalReportViewer dispose ...

    I have exactly the same problem. Had posted it on the forum last week, but haven't received any response yet. I just file a single support case ($195) with SAP.  If I hear anything useful back, will keep you posted. Please let me know if you are able to resolve the problem.
    In my case, I can get my report to work with a single subreport.  When I put multiple subreports, I get the same error as you are currently getting.
    Check if your report has any special section formatting (conditional suppression etc).  Try to remove those to see if it helps at all.

  • 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

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

  • Why am I receiving Null pointer Exception Error.

    why am I receiving Null pointer Exception Error.
    Hi I am developing a code for login screen. There is no syntex error as such ut I am receving the aove mentioned error. Can some one please help me ??
    ------------ Main.java------------------
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Main implements ActionListener
    Frame mainf;
    MenuBar mb;
    MenuItem List,admitform,inquiry,exit,helpn;
    Menu newm,update,help;
    Inquiry iq;
    Admit ad;
    // HosHelp hp;
    Howuse hu;
    Register reg;
    Main()
    mainf=new Frame(" Engg College V/S Mumbai University ");
         mb=new MenuBar();
         newm=new Menu(" New ");
         update=new Menu(" Update ");
         help=new Menu(" Help ");
         List=new MenuItem("List");
         admitform=new MenuItem("Admit");
         inquiry=new MenuItem("Inquiry");
         exit=new MenuItem("Exit");
         helpn=new MenuItem("How to Use?");
    newm.add(List);
                   newm.add(admitform);
    newm.add(inquiry);
                   newm.add(exit);
         help.add(helpn);
              mb.add(newm);
              mb.add(update);
              mb.add(help);
    mainf.setMenuBar(mb);
                   exit.addActionListener(this);
                   List.addActionListener(this);
         inquiry.addActionListener(this);
         admitform.addActionListener(this);
    helpn.addActionListener(this);
         mainf.setSize(400,300);
         mainf.setVisible(true);
    public void actionPerformed(ActionEvent ae)
    if (ae.getSource()==List)
              reg=new Register();
         if(ae.getSource()==inquiry)
         iq=new Inquiry();
    if(ae.getSource()==admitform)
         ad=new Admit();
              if(ae.getSource()==helpn)
              hu=new Howuse();
              if(ae.getSource()==exit)
         mainf.setVisible(false);
    public static void main(String args[])
              new Main();
    -------------Register.java---------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Register implements ActionListener//,ItemListener
    Label id,name,login,pass,repass;
    Button ok,newu,cancel,check;
    Button vok,iok,lok,mok,sok; //buttons for dialog boxes
    TextField idf,namef,loginf,passf,repassf;
    Dialog valid,invlog,less,mismat,acucreat;
    Frame regis;
    Checkbox admin,limit;
    CheckboxGroup type;
    DBconnect db;
    Register()
         db=new DBconnect();
    regis=new Frame("Registeration Form");
              type=new CheckboxGroup();
              admin=new Checkbox("Administrator",type,true);
              limit=new Checkbox("Limited",type,false);
              id=new Label("ID :");
    name=new Label("Name :");
         login=new Label("Login :");
         pass=new Label("Password :");
         repass=new Label("Retype :");
    idf =new TextField(20); idf.setEnabled(false);
         namef=new TextField(30); namef.setEnabled(false);
    loginf=new TextField(30); loginf.setEnabled(false);
         passf=new TextField(30); passf.setEnabled(false);
         repassf=new TextField(30); repassf.setEnabled(false);
    ok=new Button("OK"); ok.setEnabled(false);
         newu=new Button("NEW");
    cancel=new Button("Cancel");
         check=new Button("Check Login"); check.setEnabled(false);
    vok=new Button("OK");
         iok=new Button("OK");
              lok=new Button("OK");
              mok=new Button("OK");
              sok=new Button("OK");
    valid=new Dialog(regis,"Login name is valid !");
         invlog=new Dialog(regis,"Login name already exist!");
         less=new Dialog(regis,"Password is less than six characters !");
    mismat=new Dialog(regis,"password & retyped are not matching !");
    acucreat=new Dialog(regis,"You have registered successfully !");
         regis.setLayout(null);
    //     regis.setBackground(Color.orange);
    valid.setLayout(new FlowLayout());
         invlog.setLayout(new FlowLayout());
         less.setLayout(new FlowLayout());
         mismat.setLayout(new FlowLayout());
    acucreat.setLayout(new FlowLayout());
    id.setBounds(35,50,80,25); //(left,top,width,hight)
    idf.setBounds(125,50,40,25);
    name.setBounds(35,85,70,25);
    namef.setBounds(125,85,150,25);
    login.setBounds(35,120,80,25);
    loginf.setBounds(125,120,80,25);
    check.setBounds(215,120,85,25);
         pass.setBounds(35,155,80,25);
    passf.setBounds(125,155,80,25);
    repass.setBounds(35,190,80,25);
    repassf.setBounds(125,190,80,25);
    admin.setBounds(35,225,100,25);
    limit.setBounds(145,225,100,25);
              ok.setBounds(45,265,70,25);
         newu.setBounds(135,265,70,25);
    cancel.setBounds(225,265,70,25);
         passf.setEchoChar('*');
    repassf.setEchoChar('*');
         regis.add(id);
         regis.add(idf);
    regis.add(name);
         regis.add(namef);
         regis.add(login);
         regis.add(loginf);
         regis.add(check);
    regis.add(pass);
         regis.add(passf);
    regis.add(repass);
         regis.add(repassf);
         regis.add(ok);
         regis.add(newu);
         regis.add(cancel);
    regis.add(admin);
         regis.add(limit);
    valid.add(vok);
         invlog.add(iok);     
         less.add(lok);
         mismat.add(mok);
    acucreat.add(sok);
    ok.addActionListener(this);
         newu.addActionListener(this);
    check.addActionListener(this);
    cancel.addActionListener(this);
         // limit.addItemListener(this);
         //admin.addItemListener(this);
              vok.addActionListener(this);
              iok.addActionListener(this);
         lok.addActionListener(this);
         mok.addActionListener(this);
         sok.addActionListener(this);
    regis.setLocation(250,150);
    regis.setSize(310,300);
    regis.setVisible(true);
         public void actionPerformed(ActionEvent ae)
         if(ae.getSource()==check)
              try{
                   String s2=loginf.getText();
    ResultSet rs=db.s.executeQuery("select* from List");
                        while(rs.next())
                   if(s2.equals(rs.getString(2).trim()))
    //                    invlog.setBackground(Color.orange);
                             invlog.setLocation(250,150);
                             invlog.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                        invlog.setVisible(true);
                             break;
                        else
                        //     valid.setBackground(Color.orange);
                             valid.setLocation(250,150);
                             valid.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                   valid.setVisible(true);
                        }catch(Exception e)
                   e.printStackTrace();
    if(ae.getSource()==newu)
         try{
              ResultSet rs=db.s.executeQuery("select max(ID) from List");
         while(rs.next())
    String s1=rs.getString(1).trim();
                   int i=Integer.parseInt(s1);
    i++;
                   String s2=""+i;
    idf.setText(s2);
                   newu.setEnabled(false);
                   namef.setText(""); namef.setEnabled(true);
              loginf.setText(""); loginf.setEnabled(true);
              passf.setText(""); passf.setEnabled(true);
              repassf.setText(""); repassf.setEnabled(true);
              ok.setEnabled(true);
                   check.setEnabled(true);
                   }catch(Exception e)
              e.printStackTrace();
         if(ae.getSource()==ok)
              try
              String s1=idf.getText();
              String s2=loginf.getText();
              String s3=passf.getText();
         String s4=repassf.getText();
         int x=Integer.parseInt(s1);
         int t;
         if(type.getSelectedCheckbox()==admin)
              t=1;
              else
              t=0;
    ResultSet rs=db.s1.executeQuery("select* from List");
                   while(rs.next())
                   if(s2.equals(rs.getString(2).trim()))
                        invlog.setBackground(Color.orange);
                        invlog.setLocation(250,150);
                        invlog.setSize(300,100);
                   cancel.setEnabled(false);
    ok.setEnabled(false);
    check.setEnabled(false);
                        invlog.setVisible(true);
                        break;
                   else
                        if (s3.length()<6)
                        less.setBackground(Color.orange);
                             less.setLocation(250,150);
                             less.setSize(300,100);
                   ok.setEnabled(false);
                        cancel.setEnabled(false);
                        check.setEnabled(false);
                        less.setVisible(true);
    else if(!(s3.equals(s4)))
                        mismat.setBackground(Color.orange);
                        mismat.setLocation(250,150);
                        mismat.setSize(300,100);
                        ok.setEnabled(false);
                        cancel.setEnabled(false);
                        check.setEnabled(false);
                        mismat.setVisible(true);
                        else
    db.s1.execute("insert into User values("+x+",'"+s2+"','"+s3+"',"+t+")");
                        acucreat.setBackground(Color.orange);
                        acucreat.setLocation(250,150);
                        acucreat.setSize(300,100);
                        regis.setVisible(false);
                        acucreat.setVisible(true);
                   }//else
              }//while
                   } //try
              catch(Exception e1)
              // e1.printStackTrace();
              if (ae.getSource()==cancel)
              regis.setVisible(false);
              if (ae.getSource()==vok)
              ok.setEnabled(true);
                   cancel.setEnabled(true);
    check.setEnabled(true);
                   valid.setVisible(false);
              if (ae.getSource()==iok)
              ok.setEnabled(true);
                   cancel.setEnabled(true);
    check.setEnabled(true);
                   invlog.setVisible(false);
              if (ae.getSource()==lok)
              less.setVisible(false);
                   cancel.setEnabled(true);
    ok.setEnabled(true);
    check.setEnabled(true);
              if (ae.getSource()==mok)
              mismat.setVisible(false);
                   cancel.setEnabled(true);
    ok.setEnabled(true);
    check.setEnabled(true);
    if (ae.getSource()==sok)
              acucreat.setVisible(false);
              ok.setEnabled(false);
                   newu.setEnabled(true);
                   regis.setVisible(true);
         public static void main(String args[])
         new Register();
    -----------DBConnect.java------------------------------------
    import java.sql.*;
    public class DBconnect
    Statement s,s1;
    Connection c;
    public DBconnect()
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              c=DriverManager.getConnection("jdbc:odbc:Sonal");
              s=c.createStatement();
    s1=c.createStatement();
         catch(Exception e)
         e.printStackTrace();
    ----------Login.java----------------
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class Login implements ActionListener
    Frame log;
    Label login,pass;
    TextField loginf,passf;
    Button ok,cancel;
    Dialog invalid;
    Button iok;
    Register reg;
    DBconnect db;
    Main m;
    Login()
    db=new DBconnect();
         log=new Frame();
         log.setLocation(250,210);
         login=new Label("Login :");
    pass=new Label("Password :");
         loginf=new TextField(20);
         passf=new TextField(20);
         passf.setEchoChar('*');
         ok=new Button("OK");
         // newu=new Button("New User");
         cancel=new Button("CANCEL");
         iok=new Button(" OK ");
    invalid=new Dialog(log,"Invalid User!");
    //log.setBackground(Color.cyan);
    //log.setForeground(Color.black);
         log.setLayout(null);
         // iok.setBackground(Color.gray);
         invalid.setLayout(new FlowLayout());
         login.setBounds(35,50,70,25); //(left,top,width,hight)
         loginf.setBounds(105,50,100,25);
         pass.setBounds(35,85,70,25);
         passf.setBounds(105,85,70,25);
         ok.setBounds(55,130,70,25);
    // newu.setBounds(85,120,80,25);
    cancel.setBounds(145,130,70,25);
    log.add(login);
    log.add(loginf);
    log.add(pass);
    log.add(passf);
    log.add(ok);
    // log.add(newu);
    log.add(cancel);
         invalid.add(iok);//,BorderLayout.CENTER);
    ok.addActionListener(this);
    // newu.addActionListener(this);
    cancel.addActionListener(this);
         iok.addActionListener(this);
    log.setSize(300,170);
    log.setVisible(true);
    public void actionPerformed(ActionEvent a)
    if(a.getSource()==ok)
         try{
              String l=loginf.getText();
              String p=passf.getText();
              ResultSet rs=db.s.executeQuery("select * from List");
              while(rs.next())
              if(l.equals(rs.getString(2).trim())&& p.equals(rs.getString(3).trim()))
                        String tp=rs.getString(4).trim();
                             int tp1=Integer.parseInt(tp);
    log.setVisible(false);
    if(tp1==1)
                             m=new Main();
                        // m.List.setEnabled(true);
                             else
                             m=new Main();
                             m.List.setEnabled(false);
                        break;
    else
                   invalid.setBackground(Color.orange);
                   invalid.setSize(300,100);
                   invalid.setLocation(250,210);
                   cancel.setEnabled(false);
              ok.setEnabled(false);
                   invalid.setVisible(true);
                   }catch(Exception e1)
                   e1.printStackTrace();
         if (a.getSource()==cancel)
         log.setVisible(false);
         if (a.getSource()==iok)
         invalid.setVisible(false);
         loginf.setText("");
         passf.setText("");
         cancel.setEnabled(true);
    ok.setEnabled(true);
         public static void main(String[] args)
         new Login();
    -------------inquiry.java---------------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.Date;
    import java.text.*;
    import java.sql.*;
    public class Inquiry implements ActionListener
    Frame inqry;
    Label name,addr;
    TextField namef,addrf;
    Button ok,cancel,dok;
    Dialog invalid;
    Frame result; //Result of the inquiry....
    Label lrname,lraddr,lward,lrdate,lcdate;
    TextField rname,raddr,ward,rdate,cdate;
    Date d;
    DateFormat df;
    Button rok,rcancel;
    Dialog success;
    Button rdok;
    DBconnect db;
    Inquiry()
              db=new DBconnect();
              inqry=new Frame("Inquiry Form");
              inqry.setLayout(null);
    inqry.setBackground(Color.cyan);
              name=new Label(" NAME ");
              addr=new Label("ADDRESS");
              namef=new TextField(20);
              addrf=new TextField(20);
              ok=new Button("OK");
              cancel=new Button("CANCEL");
              dok=new Button("OK");
              invalid=new Dialog(inqry,"Invalid Name or Address !");
              invalid.setSize(300,100);
         invalid.setLocation(300,180);
              invalid.setBackground(Color.orange);
              invalid.setLayout(new FlowLayout());
    result=new Frame(" INQUIRY RESULT "); //Result Window......
    result.setLayout(null);
    result.setBackground(Color.cyan);
    lcdate=new Label(" DATE ");
         lrname=new Label(" NAME ");
    lraddr=new Label(" ADDRESS ");
         lward=new Label(" WARD ");
         lrdate=new Label(" ADMIT-DATE ");
    cdate=new TextField(10);
         rname=new TextField(20);
    rname.setEnabled(false);
         raddr=new TextField(20);
         raddr.setEnabled(false);
         ward=new TextField(20);
         ward.setEnabled(false);
         rdate=new TextField(10);
         rdate.setEnabled(false);
         cdate=new TextField(20);
         d=new Date();
         df=DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.KOREA);
         cdate.setText(df.format(d));
         cdate.setEnabled(false);
    rok=new Button(" OK ");
         rcancel=new Button("CANCEL");
              name.setBounds(40,50,50,25);
    namef.setBounds(120,50,130,25);
    addr.setBounds(40,100,60,25);
    addrf.setBounds(120,100,80,25);
    ok.setBounds(60,145,70,25);
              cancel.setBounds(140,145,70,25);
              lcdate.setBounds(200,50,60,25); //Result Window......
    cdate.setBounds(270,50,80,25);      
    lrname.setBounds(35,85,70,25);
    rname.setBounds(140,85,180,25);
    lraddr.setBounds(35,120,80,25);
         raddr.setBounds(140,120,100,25);
    lward.setBounds(35,155,80,25);
    ward.setBounds(140,155,100,25);
    lrdate.setBounds(30,190,80,25);
    rdate.setBounds(140,190,80,25);
    rok.setBounds(70,240,70,25);
    rcancel.setBounds(170,240,70,25);
              inqry.add(name);
              inqry.add(namef);
              inqry.add(addr);
              inqry.add(addrf);
              inqry.add(ok);
              inqry.add(cancel);
    invalid.add(dok);
         result.add(lcdate); //Result Window......
         result.add(cdate);
              result.add(lrname);
              result.add(rname);
              result.add(lraddr);
              result.add(raddr);
              result.add(lward);
              result.add(ward);
              result.add(lrdate);
              result.add(rdate);
              result.add(rok);
              result.add(rcancel);
         ok.addActionListener(this);
         cancel.addActionListener(this);
         dok.addActionListener(this);
    rok.addActionListener(this); //Result Window......
         rcancel.addActionListener(this);
         inqry.setSize(280,180);
         inqry.setLocation(300,180);
         inqry.setVisible(true);
              result.setSize(400,280); //Result Window......
         result.setLocation(200,150);
         result.setVisible(false);
              public void actionPerformed(ActionEvent ae)
                   if(ae.getSource()==ok)
                   try
                             String nm=namef.getText();
                             String ad=addrf.getText();
                             inqry.setVisible(false);
                             ResultSet rs=db.s.executeQuery("select * from Billinformation");
                             while(rs.next())
                                  String nm1=rs.getString(2).trim();
                                  String ad1=rs.getString(3).trim();
                                  int k=0;
                                  if((nm1.equals(nm))&&(ad1.equals(ad)))
                             String adm=rs.getString(5).trim();
                             String wr=rs.getString(6).trim();
                             String bd=rs.getString(8).trim();
                                  String wrb=wr+"-"+bd;
    result.setVisible(true);
                                  rname.setText(nm1);
                             raddr.setText(ad1);
                             ward.setText(wrb);
                             rdate.setText(adm);
    k=1;
                                  break;
                                  }//if
                             else if(k==1)
                             invalid.setVisible(true);
                             }//while
    }//try
                             catch(Exception e)
                             e.printStackTrace();
                        } //getsource ==ok
                   if(ae.getSource()==cancel)
    inqry.setVisible(false);
                        if(ae.getSource()==rok) //Result Window......
                        namef.setText("");
                             addrf.setText("");
                             result.setVisible(false);
                        inqry.setVisible(true);
    if(ae.getSource()==rcancel)
    result.setVisible(false);
                        if(ae.getSource()==dok)
                        namef.setText("");
                             addrf.setText("");
                             invalid.setVisible(false);
                             inqry.setVisible(true);
         public static void main(String args[])
              new Inquiry();
    PLease Help me !!
    I need this urgently.

    can you explain what your program tries to do... and
    at where it went wrong..Sir,
    We are trying to make an project where we can make a person register in our data base & after which he/she can search for other user.
    The logged in user can modify his/her own data but can view other ppl's data.
    We are in a phase of registering the user & that's where we are stuck. The problem is that after the login screen when we hit register (OK- button) the data are not getting entered in the data base.
    Can u please help me??
    I am using "jdk1.3' - studnet's edition.
    I am waiting for your reply.
    Thanks in advance & yr interest.

  • Null Pointer Exception and Illegal Arguement when ran with Wireless Toolkit

    The following code throws a null pointer exception after it tried to initialize the textBox. I am not sure if there is something I am not importing, or if it's just because I'm sick and my head is cloudy. :-}.
    I am using Wireless Toolkit 2.2 and Java 5.0
    Anyhelp would be appreicated. Thank You.
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class TacticalTestMain extends MIDlet implements CommandListener {
         private Display display;
         private Form formMain;
         private TextBox tbHelp;          //Text Box for help Command
         private Command cmExit;          //A button to exit midLet
         private Command cmBack;          //Go "back" to main form
         private Command cmHelp;          //Ask for help
         public TacticalTestMain()
              display = Display.getDisplay(this);
              formMain = new Form("Tactical Survey Program");
              cmExit = new Command("Exit", Command.SCREEN, 1);
              cmBack = new Command("Back", Command.BACK, 1);
              cmHelp = new Command("Help", Command.HELP, 1);
              formMain.addCommand(cmExit);
              formMain.addCommand(cmBack);
              formMain.addCommand(cmHelp);
              formMain.setCommandListener(this);
              System.out.println("Before Create Text Box");
              //Create the help textBox with a max of 25 charecters
              tbHelp = new TextBox("HeLp", "You can press the back button", 25, 0);
              tbHelp.addCommand(cmBack);
              tbHelp.setCommandListener(this);
              System.out.println("AfTER Create Text Box");               
         }//end constructor
         public void startApp()
              System.out.println("Inside StartApp()");
              display.setCurrent(formMain);
         }//end startApp()
         public void pauseApp()
         }//end pauseApp
         public void destroyApp(boolean unconditional)
              notifyDestroyed();
         }//end destroyApp()
         //Check to see if the exit button was selected
         public void commandAction(Command c, Displayable d)
              System.out.println("Inside commandAction()");
              String sLabel = c.getLabel();
              if(sLabel.equals("Exit"))
                   destroyApp(true);
    Errors from the KToolbar:
    Running with storage root DefaultColorPhone
    Before Create Text Box
    Unable to create MIDlet TacticalTestMain
    java.lang.IllegalArgumentException
         at javax.microedition.lcdui.TextField.setChars(+105)
         at javax.microedition.lcdui.TextField.setString(+27)
         at javax.microedition.lcdui.TextField.<init>(+134)
         at javax.microedition.lcdui.TextBox.<init>(+74)
         at TacticalTestMain.<init>(+134)
         at java.lang.Class.runCustomCode(+0)
         at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
         at com.sun.midp.midlet.Selector.run(+22)
    Execution completed.
    743701 bytecodes executed
    23 thread switches
    741 classes in the system (including system classes)
    4071 dynamic objects allocated (120440 bytes)
    2 garbage collections (91412 bytes collected)

    Hi zoya,
    Here is the problem:
    tbHelp = new TextBox("HeLp", "You can press the back button", 25, 0);
    This line declares a maximum textbox size of 25 but in reality he is declaring a textbox of size 29.
    Thats why it is throwing the illegal argument.
    happy coding :)

  • Using ExecuteWithParams and getting a null pointer error

    I'm new to Webcenter and have a question about using ExecuteWithParams. I want to know if anyone experienced a null pointer exception when using it. I was using the example from the followng page to create a parameter form to filter an adf table.
    http://www.oracle.com/technology/products/jdev/tips/muench/screencasts/threesearchpages/threesearchforms_partthree.html?_template=/ocom/technology/content/print
    I created the named bind variable in the View Object editor, changed the query and dragged the ExecuteWithParams Operation onto my page. However, when I go to run the page I get the following error:
    javax.faces.el.EvaluationException: java.lang.NullPointerException     at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:190)     at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:143)     at oracle.adf.view.faces.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:55)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.LabelAndMessageRenderer.getLabel(LabelAndMessageRenderer.java:618)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.LabelAndMessageRenderer.encodeAll(LabelAndMessageRenderer.java:157)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.InputLabelAndMessageRenderer.encodeAll(InputLabelAndMessageRenderer.java:94)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:169)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:246)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer.encodeColumnChild(PanelFormRenderer.java:275)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer.renderColumn(PanelFormRenderer.java:251)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer._renderColumns(PanelFormRenderer.java:545)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer._encodeChildren(PanelFormRenderer.java:153)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelFormRenderer.encodeAll(PanelFormRenderer.java:69)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:169)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:317)     at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262)     at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:239)     at oracle.adfinternal.view.faces.ui.composite.ContextPoppingUINode$ContextPoppingRenderer.render(ContextPoppingUINode.java:224)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:412)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderNamedChild(BaseRenderer.java:384)     at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer.renderContent(PageHeaderLayoutRenderer.java:259)     at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:69)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:412)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:330)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:222)     at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer.java:129)     at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)     at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:69)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)     at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)     at oracle.adfinternal.view.faces.ui.composite.UINodeRenderer.renderWithNode(UINodeRenderer.java:90)     at oracle.adfinternal.view.faces.ui.composite.UINodeRenderer.render(UINodeRenderer.java:36)     at oracle.adfinternal.view.faces.ui.laf.oracle.desktop.PageLayoutRenderer.render(PageLayoutRenderer.java:76)     at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177)     at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at oracle.adfinternal.view.faces.renderkit.RenderUtils.encodeRecursive(RenderUtils.java:54)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:242)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeAllChildren(CoreRenderer.java:265)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:65)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:117)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:147)     at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:60)     at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:169)     at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)     at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:645)     at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:568)     at oracle.adf.view.faces.webapp.UIXComponentTag.doEndTag(UIXComponentTag.java:100)     at mdssys.viewcontroller._public__html._SoluminaOrderStatus_jspx._jspService(_SoluminaOrderStatus_jspx.java:943)     [SRC:/mdssys/ViewController/public_html/SoluminaOrderStatus.jspx:4]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:724)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:414)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.mds.jsp.MDSJSPFilter.doFilter(Unknown Source)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:287)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)     at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)     at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)Caused by: java.lang.NullPointerException     at oracle.adf.model.binding.DCVariableImpl.resolveSourceVariable(DCVariableImpl.java:64)     at oracle.adf.model.binding.DCVariableImpl.resolveResourceProperty(DCVariableImpl.java:142)     at oracle.jbo.common.VariableImpl.getLabel(VariableImpl.java:800)     at oracle.jbo.uicli.binding.JUCtrlValueBinding.getLabel(JUCtrlValueBinding.java:1384)     at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:1726)     at oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding.internalGet(FacesCtrlAttrsBinding.java:156)     at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:649)     at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)     at oracle.adfinternal.view.faces.model.FacesPropertyResolver.getValue(FacesPropertyResolver.java:92)     at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)     at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)     at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)     at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)     ... 97 more
    Can anyone help me with this?

    Please, post your question on JDeveloper forum (JDeveloper and ADF

  • JAX-WS Client throws NULL Pointer Exception in NW 7.1 SP3 and higher

    All,
    My JAX-WS client is throwing an exception when attempting to create a client to connect to the calculation service. The exception is coming out of the core JAX-WS classes that are part of NetWeaver. (see exception below)
    Caused by: java.lang.NullPointerException
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatchContextExistingPort(SAPServiceDelegate.java:440)
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatchContext(SAPServiceDelegate.java:475)
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatch(SAPServiceDelegate.java:492)
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatch(SAPServiceDelegate.java:484)
         at javax.xml.ws.Service.createDispatch(Service.java:166)
    I have done some research and it appears that as of NetWeaver 7.1 SP3 SAP stopped using the SUN JAX-WS runtime and implemented their own SAP JAX-WS runtime. I also took the time to decompile the jar file that contained the SAPServiceDelegate class which is throwing the null pointer exception. (see method from SAPServiceDelegate below)
        private ClientConfigurationContext createDispatchContextExistingPort(QName portName, JAXBContext jaxbContext)
            BindingData bindingData;
            InterfaceMapping interfaceMap;
            InterfaceData interfaceData;
            bindingData = clientServiceCtx.getServiceData().getBindingData(portName);
            if(bindingData == null)
                throw new WebServiceException((new StringBuilder()).append("Binding data '").append(portName.toString()).append("' is missing!").toString());
            QName bindingQName = new QName(bindingData.getBindingNamespace(), bindingData.getBindingName());
            interfaceMap = getInterfaceMapping(bindingQName, clientServiceCtx);
            interfaceData = getInterfaceData(interfaceMap.getPortType());
            ClientConfigurationContext result = DynamicServiceImpl.createClientConfiguration(bindingData, interfaceData, interfaceMap, null, jaxbContext, getClass().getClassLoader(), clientServiceCtx, new SOAPTransportBinding(), false, 1);
            return result;
            WebserviceClientException x;
            x;
            throw new WebServiceException(x);
    The exception is being throw on the line where the interfaceMap.getPortType() is being passed into the getInterfaceData method. I checked the getInterfaceMapping method which returns the interfaceMap (line above the line throwing the exception). This method returns NULL if an interface cannot be found. (see getInterfaceMapping method  below)
       public static InterfaceMapping getInterfaceMapping(QName bindingQName, ClientServiceContext context)
            InterfaceMapping interfaces[] = context.getMappingRules().getInterface();
            for(int i = 0; i < interfaces.length; i++)
                if(bindingQName.equals(interfaces<i>.getBindingQName()))
                    return interfaces<i>;
            return null;
    What appears to be happening is that the getInterfaceMapping method returns NULL then the next line in the createDispatchContextExistingPort method attempts to call the getPortType() method on a NULL and throws the Null Pointer Exception.
    I have included the code we use to create a client below. It works fine on all the platforms we support with the exception of NetWeaver 7.1 SP3 and higher (I already checked SP5 as well)
          //Create URL for service WSDL
          URL serviceURL = new URL(null, wsEndpointWSDL);
          //create service qname
          QName serviceQName = new QName(targetNamespace, "WSService");
          //create port qname
          QName portQName = new QName(targetNamespace, "WSPortName");
          //create service
          Service service = Service.create(serviceURL, serviceQName);
          //create dispatch on port
          serviceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
    What do I need to change in order to create a JAX-WS dispatch client on top of the SAP JAX-WS runtime?

    Hi Guys,
    I am getting the same error. Any resolution or updates on this.
    Were you able to fix this error.
    Thanks,
    Yomesh

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

  • EvaluatingTteststand 4.2.1: Null pointer access violation (error 17502) when attempting to use a mixed-mode std::map / boost shared_ptr class contained in a DLL through an interface from a different DLL

    Hi there.
    I have been working on a test system which will potentially have TestStand at its core, and downloaded/installed the 4.2.1 evaluation. Current details from the information dialog are:
    TestStand Engine version 4.2.1 (4.2.1.83)
    Sequence Editor Verison 4.2.1.83
    The system will drive mobile radio devices using RS232 serial interfaces, usnig a variety of serial protocols (Hayes, and a couple of proprietary binary protocols for other work).
    We already have in existence a soak tester, written in VS2005 with MFC unmanaged DLLs and also managed DLLs, which are mixed up together to provide different aspects of the functionality required for the binary protocols.
    I have created:
    1. a "master wrapper" DLL for the constellation of other DLLs - this offers up a simple C-API interface which I hope TestStand will use. It's called "SerialSessionMgr.dll""
    2. a mixed managed / unmanaged "IJW" (it just works) DLL which wraps up the binary logging protocol control interfaces, which are entirely in managed C++/CLI: the "master wrapper" DLL calls into this through an unmanaged interface to create instances of the CLI-compiled class which interfaces to the underlying managed DLLs imlpementing the logging protocol. This is called "WinTseInterface.dll".
    Before I started evaluating TestStand, I knocked up a test harness using CPPUnit / MFC, with which I was able to test SerialSessionMgr.dll and its' use of WinTseInterface.dll and verify they worked. The harness loads the DLL dynamically at run-time using AfxLoadLibrary() to try to emulate the way TestStand uses it.
    When we open a
    TSE session:
    The SerialSessionManager makes a call to the
    WinTseInterface.dll to "create" a logging instance. The instance is
    created in a std::map which is held by the CWinApp derived class, this map
    contains boost::shared_ptr of the class which works with a managed class. So we
    have a call trace: Client
    app->SerialSessionManager{TseStartSession()}->WinTseInterface{WINTSE_GetWinTseBridge()} - WINTSE_GetWinTseBridge()
    just creates a new instance of the unmanaged class which interfaces through to
    the managed CLI/C++ class beneath, and returns the address to the
    SerialSessionManager, which stores it.
    The SerialSessioManager actually initialises the WinTseBridge using a method of a C++ pure virtual interface class to the class in the std::map in the WinTseInterface DLL
    implements. The initialise call passes miscellaneous details and actually calls
    "gcnew" to create the managed class which interfaces to the
    underlying managed DLLs which implement the logging protocol.
    My logs of the DLL loading as seen in VS2005 debug output are attached this message as PDFs
    While trying to fix this, I have tried:
    Enhancing the WinTseInterface DLL so it manually loads all the other assemblies in the logging system, including the managed portion of WinTseInterface itself (no effect)
    All the different options for the way the C DLL adapter loads and unloads the DLL in the DLL adapter steptype in TestStand
    I've even tried calling directly into the WinTseInterface DLL before trying any SerialSessionManager DLL calls to try to load the WinTseInterface DLL completely beforehand
    and I cannot stop this exception.
    It seems like the object is created in the WinTseInterface DLL OK (I have debugged the creation step which runs for WINTSE_GetWinTseBridge() and the object is created OK) when the SerialSessionManager makes the call, but when it calls the first managed function, which creates the managed object, the DLL is reloaded as managed - I suspect this causes the object to be destroyed or overwritten, and thus the call to initialise bombs with null pointer violation.
    Have I done something obviously wrong, and what other approaches can I take? 
    Does TestStand 4.2.1 have issues with driving DLLs which use managed/unmanaged DLLs beneath them?
    My nuclear option is to throw the WinTseInterface DLL out completely and wrap up the managed C++ CLI code in a new interface, entirely managed, and use the TestStand ".Net" adaptor to drive that, creating my step library to run to that directly. This isn't ideal as I have some co-ordination of the protocols which is implemented in the SerialSessionMgr DLL.
    I hope someone can help. This one's low level, dirty and a stumper to me.
    Many thanks to the NI community. This is my first posting!
    Solved!
    Go to Solution.
    Attachments:
    CPPUnit Test Harness DLL load debug output.pdf ‏18 KB
    TestStand DLL load & crash debug output.pdf ‏43 KB

    Hi there Ray.
    First - many thanks for engaging with this thorny problem. Love the avatar BTW.
    I've been using the C/C++ DLL adapter: the original premise of the Serial Session Manager DLL was to provide a simple C type functional interface, using simple data types, so that TestStand would be able to drive the underlying functionality easily through a single DLL.
    Seeing as you've been kind enough to respond, I should explain the makeup of the DLLs a little more, I think.
    The SerialSessionManager (SSMgr) DLL uses C++ and MFC internally. This is the DLL which TestStand calls into directly through the C/C++ adapter. This DLL does have one odd feature though - because the it uses the Windows Multimedia Timer (implemented in WinMM.dll) I had to artificially create a scenario where it would load the .Net mscoree DLL _before_ it loads WinMM.dll - (http://connect.microsoft.com/VisualStudio/feedback/details/329819/freelibrary-in-the-winmm-dlls-modu...), basically WinMM.dll's init code gets rather upset when .Net DLLs load, which causes the entire executable to be unloaded with subsequent crashes.
    To work around this crash, the SSMgr has a single, completely empty, file which is compiled for CLR, effectively forcing a dependency into the DLL on the .Net subsystems and turning the DLL into a "IJW" binary. The resulting DLL doesn't actually have any executable managed .Net assemblies, but I'm guessing that it does contain enough .Net related stubs and information that when the DLL is loaded, mscoree.dll loads before WinMM.dll - and this means the system doesn't crash.
    Now, on to the WinTseInterface DLL. My initial description of this little software system was done in something of a hurry.
    This DLL is the C++/CLI "IJW" DLL which actually contains managed and unmanaged code. Underneath the WinTseInterface DLL is another system of (this time exclusively C++/CLI) DLL assemblies which implement the TSE protocol interpretation system.
    When the SSMgr DLL needs to start a TSE protocol session, it calls a C-API function in the WinTseInterface which creates a new CWinTseBridge class. Here's the steps in a little more detail:
    SSMgr DLL calls WINTSE_GetWinTseBridge(), passing in the name of the device which needs it (this is used to put the new WinTseBridge into a std::map in the WinTseInterface DLL) - this call runs just fine, and returns the address of the CWinTseBridge C++ object. This is stored in the SSMgr, because the CWinTseBridge class implements a pure virtual interface which is used by the SSMgr as a way of accessing the CWinTseBridge methods. 
    We now use the address from (1) to make a call to CWinTseBridge::Initialise(), passing some basic configuration details.
    I've run VS2005 debug on the Sequence Editor when running the test, and done F11 step-throughs of the code loading each parameter in the Initialise() call onto the stack, and what appears to happen is that when the call is made, the whole lot steps off into oblivion (a reference to 0x00000000 is made, I think).
    Do you think it's worth trying to get this approach to work? It would be useful to retain the control surface in the top of the SSMgr as there is co-ordination of the protocols within the logic of that component. If I move the Wintse control out into a separate managed DLL I may not have that co-ordination (this might be overcome with some design, as I've confirmed that it is possible to "reach into" the WinTseInterface DLL with TestStand and create and use managed objects from assemblies contained within).
    Are there any known issues with this version of TestStand using C/C++ CLI IJW DLLs? I haven't found much out there on the web.
    Attachments:
    Tse_Test.seq ‏7 KB

  • Can't Find Null Pointer Exception

    Hey, guys! I've spent a couple of hours trying to figure this out, and I've been unable. When I run my program, I get a long list of errors that basically says I have a NullPointerException at Line 160 in LevelRenderer. I can't figure out what is null after tons of analyzing and experimenting, so I was wondering if one of you could assist me with this.
    First, here is the runtime error code:
    Game Update Error: java.lang.NullPointerException
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at LevelRenderer.paint(LevelRenderer.java:160)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
            at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
            at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:6
    93)
            at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
    EventQueueUtilities.java:125)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
            at java.awt.EventQueue.access$000(EventQueue.java:84)
            at java.awt.EventQueue$1.run(EventQueue.java:602)
            at java.awt.EventQueue$1.run(EventQueue.java:600)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
    ntrolContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Here's the code for the classes that are relevant to the issue. The runtime code is pointing me to the paint method's call of myLevel.drawLevel(gr, 0, 0):
    Here's the class that is giving me the error:
    /* This class's job is to render a level object.
    * The class will keep track of the top left coordinate of the space in which the player is moving
    * and how far the right side of the screen is. It will then draw the player always in the center
    * of the screen and allow the player to move the character. The character will animate with calls
    * to the Player class and also detect collision against the character. If there are collisions, then the
    * player will either fall or be unable to move. It will keep the screen image a little bit rendered
    * beyond the screen so that when the player moves, it will be able to still be visible until the next tile
    * is reached. It will update the screen every time the player moves and reference the level's collision
    * map for all of the collisions.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.JFrame;
    import javax.swing.*;
    import java.util.Random;
    import java.awt.Color;
    public class LevelRenderer extends JFrame
        // CONSTANTS
        private final int TILE_SIZE = 14;
        private final int SCREEN_WIDTH = 1280;
        private final int SCREEN_HEIGHT = 768;
        // END OF CONSTANTS
        // will be used as a buffer before everything is drawn to the screen
        private BufferedImage buffer;
        // character object
        private Player myPlayer;
        // level object
        private Level myLevel;
        // screen object
        private Screen s;
        // graphics object of the buffer
        private Graphics gr;
        // boolean to determine when to end the game
        private boolean endGame;
        // CONSTRUCTOR
        public LevelRenderer()
            setPreferredSize(new Dimension(1280, 768));
            setFocusable(true);
            requestFocus();
            setResizable(false);
            addKeyListener( new KeyAdapter()
                public void keyPressed(KeyEvent e)
                    processKey(e); 
                public void keyReleased(KeyEvent e)
                    processRelease(e);
            buffer = new BufferedImage(1280, 768, BufferedImage.TYPE_INT_ARGB);
            buffer.createGraphics();
            gr = buffer.getGraphics();
            myPlayer = new Player();
            Level myLevel = new Level("obstaclemap");
            endGame = false;
        // method to simply load an image from a path
        public static BufferedImage loadImage(String ref)
            BufferedImage bimg = null;
            try
               bimg = ImageIO.read(new File(ref));
            catch (Exception e)
                e.printStackTrace();
            return bimg;
        // Run method for class
        public void run(DisplayMode dm)
            setBackground(Color.WHITE);
              s = new Screen();
            try
                s.setFullScreen(dm, this);
            catch (Exception ex)
                System.out.println("Error creating rendered tiles!");
              while (!endGame)
                try
                    Thread.sleep(2);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
                try
                    myPlayer.animatePlayer();
                    myLevel.renderLevel();
                catch (NullPointerException ex)
                    System.err.println("Game Update Error: " + ex);
                try
                    repaint();
                catch (Exception ex)
                    System.err.println("Repaint Error: " + ex);
              s.restoreScreen();
        // method to draw the tiles on the screen
        public void paint(Graphics g)
            // draw the level and then the player
            myLevel.drawLevel(gr, 0, 0); 
            myPlayer.drawPlayer(gr, (SCREEN_WIDTH / 2) - TILE_SIZE / 2, (SCREEN_HEIGHT / 2) - TILE_SIZE);
            g.drawImage(buffer, 0, 0, null);
        // method to handle inputs and adjust the player accordingly
        public void processKey(KeyEvent e)
            int keyCode = e.getKeyCode();
            boolean moved = false;
            int xDisplace, yDisplace;
            // termination key
            if (keyCode == KeyEvent.VK_ESCAPE)
                endGame = true;
            // 1 - up
            // 2 - left
            // 3 - right
            // 4 - down
            // 5 - jump
            if (keyCode == KeyEvent.VK_UP)
                try
                    myPlayer.updatePlayer(0);
                    myLevel.updateLevel(0);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_LEFT)
                try
                    myPlayer.updatePlayer(1);
                    myLevel.updateLevel(1);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_RIGHT)
                try
                    myPlayer.updatePlayer(2);
                    myLevel.updateLevel(2);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_DOWN)
                try
                    myPlayer.updatePlayer(3);
                    myLevel.updateLevel(3);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_SPACE)
                try
                    myPlayer.updatePlayer(4);
                    myLevel.updateLevel(4);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
        // method to handle inputs and adjust the player accordingly
        public void processRelease(KeyEvent e)
            int keyCode = e.getKeyCode();
            boolean moved = false;
            int xDisplace, yDisplace;
            // 1 - up
            // 2 - left
            // 3 - right
            // 4 - down
            // 5 - jump
            if (keyCode == KeyEvent.VK_UP)
                try
                    myPlayer.updatePlayer(0);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_LEFT)
                try
                    myPlayer.updatePlayer(5);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_RIGHT)
                try
                    myPlayer.updatePlayer(6);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_DOWN)
                try
                    myPlayer.updatePlayer(3);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
            if (keyCode == KeyEvent.VK_SPACE)
                try
                    myPlayer.updatePlayer(4);
                catch (Exception ex)
                    System.err.println("Error: " + ex);
    }And then here's the other class that is calling the drawLevel method that the compiler is pointing me in the direction of (where it's saying the NullPointerException is stemming from):
    /* The purpose of this class will be to load and manage a level, including its camera. */
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import java.awt.*;
    public class Level
        // CONSTANTS
        private final int TILE_SIZE = 14;
        private final int SCREEN_WIDTH = 1280;
        private final int SCREEN_HEIGHT = 768;
        // END OF CONSTANTS
        // stores the pixel image of the current level
        private BufferedImage levelImage;
        // stores the width and height of the level
        private int width, height;
        // stores the name of the level
        private String levelName;
        // stores collision map for level
        private LevelCollisions myCollisions;
        // stores the tile types in an array as assigned by colors
        private int levelTiles[][];
        // image used as the sheet for the level's tiles
        private BufferedImage tileSheet;
        // image array used to store the different tiles
        private BufferedImage[] tiles;
        // the image which represents the current view of the level
        private BufferedImage cameraImage;
        // Graphics context of the camera image
        private Graphics cameraG;
        // variables to represent the level's offset from the top left corner while moving
        private int offsetX, offsetY;
        // variables to represent the level's pixel map coordinate
        private int coordX, coordY;
        // STATIC COLOR VARIABLES
        private static final int SPACE_COLOR = 0xFF000000;
        private static final int WALL_COLOR = 0xFFFFFFFF;
        // END OF STATIC COLOR VARIABLES
        // CONSTRUCTOR
        public Level(String level)
            // load level image and collision map
            levelName = level;
            levelImage = loadImage(level + ".png");
            myCollisions = new LevelCollisions(level + "Collision");
            levelTiles = loadLevel();  
            // create blank camera canvas
            cameraImage = new BufferedImage(1280, 768, BufferedImage.TYPE_INT_ARGB);
            cameraImage.createGraphics();
            cameraG = cameraImage.getGraphics();
            // offsets start at 0
            offsetX = offsetY = 0;
            // coordinate starts at bottom right
            coordX = 700;
            coordY = 400;
            // fill tile images
            tileSheet = loadImage("obstacletiles.png");
            tiles = splitImage(tileSheet, 1, 2);
            this.renderLevel();
        // method to load the color values into an array
        public int[][] loadLevel()
            height = levelImage.getHeight();
            width = levelImage.getWidth();
            int levelValues[][] = new int[width][height];
            // fill array with color values layer by layer
            for (int y = 0; y < height; y++)
                for (int x = 0; x < width; x++)
                    levelValues[x][y] = levelImage.getRGB(x, y);
            return levelValues;
        // method to get the tile color from a given tile
        public int getTile(int x, int y)
            return levelTiles[x][y];
        // method to draw the current camera view of the level on the screen
        public void drawLevel(Graphics gr, int x, int y)
            gr.drawImage(cameraImage, x, y, null);
        // method to render the actual image before drawing it
        public void renderLevel()
            // keeps track of graphics coordinate
            int x, y;
            // keeps track of tile to draw
            int tileX, tileY;
            tileY = coordY;
            // draw all the tiles based on offsets, layer by layer
            for (y = offsetY; y < SCREEN_HEIGHT + offsetY; y += TILE_SIZE)
                tileX = coordX;
                for (x = offsetX; x < SCREEN_WIDTH + offsetX; x += TILE_SIZE)
                    // determine which tile to draw based on tile color in array
                    switch (this.getTile(tileX, tileY))
                        case SPACE_COLOR:
                            cameraG.drawImage(tiles[0], x, y, null);
                            break;
                        case WALL_COLOR:
                            cameraG.drawImage(tiles[1], x, y, null);
                            break;
                    tileX++;
            // steps to take in case of an offset
            if (offsetX > 0)
            if (offsetX < 0)
            if (offsetY < 0)
            if (offsetY > 0)
        // method to update the level's current position for the camera
        public void updateLevel(int input)
            switch (input)
                // up
                case 0:
                    break;
                // left
                case 1:
                    // update offset to the left if not too far left
                    if (coordX > 30)
                        offsetX--;
                    // if a tile has been moved, then offset becomes 0 and coordX is decreased
                    if (offsetX <= -TILE_SIZE)
                        offsetX = 0;
                        coordX--;
                    break;
                // right
                case 2:
                    // update offset to the right if not too far right
                    if (coordX < width - 30)
                        offsetX++;
                    // if a tile has been moved, then offset becomes 0 and coordX is increased
                    if (offsetX >= TILE_SIZE)
                        offsetX = 0;
                        coordX++;
                    break;
                // down
                case 3:
                    break;
                // jump
                case 4:
                    break;
        // method to simply load an image from a path
        public static BufferedImage loadImage(String ref)
            BufferedImage bimg = null;
            try
               bimg = ImageIO.read(new File(ref));
            catch (Exception e)
                e.printStackTrace();
            return bimg;
        // method to create a tile array for tile sets
        public static BufferedImage[] splitImage(BufferedImage img, int cols, int rows)
            int w = img.getWidth() / cols;
            int h = img.getHeight() / rows;
            int num = 0;
            BufferedImage imgs[] = new BufferedImage[w * h];
            for (int y = 0; y < rows; y++)
                for (int x = 0; x < cols; x++)
                    imgs[num] = new BufferedImage(w, h, img.getType());
                    Graphics2D g = imgs[num].createGraphics();
                    g.drawImage(img, 0, 0, w, h, w * x, h * y, w * x + w, h * y + h, null);
                    g.dispose();
                    num++;
            return imgs;
        // image-loading method that will also alpha the color key for each tile
        public static BufferedImage makeColorTransparent(String ref, int color)
            BufferedImage image = loadImage(ref);
            BufferedImage dimg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = dimg.createGraphics();
            g.setComposite(AlphaComposite.Src);
            g.drawImage(image, null, 0, 0);
            g.dispose();
            for (int i = 0; i < dimg.getHeight(); i++)
                for (int j = 0; j < dimg.getWidth(); j++)
                    if (dimg.getRGB(j, i) == color)
                        dimg.setRGB(j, i, 0x8F1C1C);
            return dimg;
    }Sorry for the long post, but since there are several objects involved in what could be the error, I didn't want to leave anything out of this one. Help is greatly appreciated! Thank you guys very much.
    Colton
    Edited by: coltonoscopy on Oct 2, 2011 11:57 PM

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at LevelRenderer.paint(LevelRenderer.java:160)
    // method to draw the tiles on the screen
    public void paint(Graphics g)
    // draw the level and then the player
    myLevel.drawLevel(gr, 0, 0); 
    myPlayer.drawPlayer(gr, (SCREEN_WIDTH / 2) - TILE_SIZE / 2, (SCREEN_HEIGHT / 2) - TILE_SIZE);
    g.drawImage(buffer, 0, 0, null);
    }So one of those three lines is line 160, and whichever line it is, is dereferencing a null pointer. So one of 'myLevel', 'myPlayer', or 'g' is null. Probably not 'g' as you received it as a parameter from Swing. Pretty much cuts it down.
    There's nothing here you couldn't have worked out for yourself. The line number was all you needed.

Maybe you are looking for

  • How do i find my airport extreme's ip address

    How do I find the ip address for my AirPort Extreme?

  • No 1680x1050 Resolution for External Monitor?

    Hello, forum friends! So after getting a very nice 22"-ish Envision Monitor connected via VGA to my 2011 Macbook Pro, it appears that there is no option for the monitor's recommended resolution, which is 1680x1050! The highest level resolution is 160

  • Printing pdf exported from InDesign

    When I print a pdf that I've exported from InDesign some of the graphic boxes or even text boxes that have effects, show up. They appear as a box with a subtle color a bit lighter than the background color of my design. These boxes do not show up on

  • Crystal Reports & PHP

    Post Author: abarone CA Forum: Other Hi everybody,I would like to know if it's possible to use Crystal Reports with PHP.If it's possible, can you please provide me a sample code that shows how to pass parameters from the PHP page to my report.Thanks

  • No Sound iPod fifth generation

    I have a 30GB fifth generation classic iPod. I was having the 'no sound' issue, that many others have been experiencing. Through a community thread, I noticed that Apple was replacing the iPods under warranty even though the warranty period had expir