NullPointer problem

Hi, I was wondering if anyone out there could help, (and hope this is in the appropriate forum, I'm very new to this).
I'm creating a null pointer exception that I can't seem to get rid of.
1) I set a load of variables on an actionPerformed event in my GUI.
2) then I instantiate buyer1 (buyer1 is an instance variable in my code)
3) code] NaiiveBuyerTactic nbt1 =new NaiiveBuyerTactic();buyer1 is a class which creates a new tactic as an instance variable.
Below is the code which is causing problems:
setMaxPrice();
     NaiiveBuyer buyer1= new NaiiveBuyer(getMaxPrice(), getMinPrice(), getMaxTime(), getBeta());
     // the buyer then creates a tactic, note we now need to pass the tactic these values
     buyer1.nbt1.setPmax(getMaxPrice());
System.out.println("Buyer1s name: " + buyer1.getName()); // here it prints "buyer1s name: null" on the terminal...
     Mediator m1 = new Mediator(buyer1);// then pass another class the buyer1
     System.out.println("Nbt vals: "+buyer1.nbt1.pmax); // here it correctly prints all the new values to the terminalthen in the mediator class I have an instance variable for the buyer and an instance variable for its tactic.
I instantiate it like:
public Mediator(NaiiveBuyer buyer) {     
          NaiiveBuyer b1=buyer;
          NaiiveBuyer nbt1 = buyer.nbt1;
          Seller s1 = new Seller(150, 50, 10000, 0.7);
     When i use the line below I get a null pointer exception. I still have references to the buyer, so I don't think it has become ready for garbage collection.
Double iWrapCurr = new Double(b1.nbt1.bidGenerator(counter));Any help anyone could give would be gratefully received. Many thanks!

I know that the buyer is null, but I want to know why?
And it is this line that creates the exception as I have a test class, which sucessfully prints it all to the terminal.
public static void main(String[] args) {
NaiiveBuyerTactic bt = new NaiiveBuyerTactic();
bt.setPmax(100);
for (int z=0; z<50; z++){
bt.bidGenerator(z);     }
Double iWrapCurr = new
Double(b1.nbt1.bidGenerator(counter));
Well, either b1 or nbt1 are null (assuming that this
is the line that really creates the exception, and
not something in bidGenerator().

Similar Messages

  • NullPointer Problems in Array

    I'm trying to create two different hash tables, and put the hased data into each one using linear probing. I'm using an array, but I'm having a little problem (mainly with the circular array part, I think). I've posted what I've got below. Every time I try to test it, I get a NullPointerException. I know the code is a little (a lot) sloppy, but I just sat down and wrote it right now, so take it easy :P
    import java.util.Scanner;
    import java.io.*;
    public class HashingTable {
         private static HashObject[] array1;
         private static HashObject[] array2;
         private static int collision1, collision2;
         public HashingTable() {
              HashObject[] array1 = new HashObject[145];
              HashObject[] array2 = new HashObject[415];
              collision1 = collision2 = 0;
         public static void fillHashTable(String fileName) throws IOException {
            Scanner scan = new Scanner(new File(fileName));
            while(scan.hasNext()) {
                HashObject hashObject1, hashObject2;
               String word = scan.next().toUpperCase();
                        int total = 0;
                        for(int i=0; i < word.length(); i++) {
                             char c = word.charAt(i);
                             if(Character.isLetterOrDigit(c))
                                  total += (int)c;
                             if(c == '-')
                                  total += (int)c;
                             if(c == '/')
                                  total += (int)c;
                        int hashedInt_1 = total%135;
                        hashObject1 = new HashObject(word, hashedInt_1);
                        int hashedInt_2 = total%401;
                        hashObject2 = new HashObject(word, hashedInt_2);
                        for(int j=0; j < array1.length; j++) {
                             if(j == hashedInt_1)
                                  if(array1[j] == null)
                                       array1[j] = hashObject1;
                                  else
                                       while(array1[j] != null) {
                                       j++;
                                       collision1++;
                                            if(j+1 > array1.length)
                                            j = 0;
                        for(int k=0; k < array2.length; k++) {
                             if(k == hashedInt_2)
                                  if(array2[k] == null)
                                       array2[k] = hashObject2;
                                  else
                                       while(array2[k] != null) {
                                       k++;
                                       collision2++;
                                            if(k+1 > array2.length)
                                                 k = 0;
      private static class HashObject {
                protected String hashedWord;
              protected int hashedValue;
              public HashObject(){}
              public HashObject(String s, int n) {
                   hashedWord = s;
                   hashedValue = n;
    }Also, it made me mark my instance variables as static, why is that?

    Wait a minute... I just realized that several things are awkward in your code. For example, why do you loop until you find k to be equal to the other number? Here is a revision:
                                  if(array1[hashedInt_1] == null)
                                       array1[hashedInt_1] = hashObject1;
                                  else
                                       for(int j = 0; the thing doesn't equal null; j++) {
                                       collision1++;
                                            if(j+1 == array1.length)
                                                j = -1;
                                                             //check if the array1[j] is null. If it is, then change it and break the loop
                                                             }I think the error in the circle is that you have 2 loops for no reason, and the inner loop is not doing anything - it's value doesn't reset.
    Edited by: Student_Coder on Dec 4, 2007 8:13 PM

  • Nullpointer in 'weblogic.transaction.internal.CoordinatorImpl

              I am using Weblogic 6.1 SP4 on JDK 1.3.1 on AIX.
              My server has a transacted EJB which accesses Oracle and DB2 databases. I have
              been running my application for several months.
              Suddenly, yesterday it starting spitting out these exceptions a few times a minute.
              I cannot find the configuration change I made that would have caused this to
              suddenly start appearing. My code has not changed in 2 weeks.
              Has anyone seen this error before? Does anyone know what causes this, so that
              I can narrow my search?
              Thanks for your help,
              Tania
              ####<Mar 4, 2003 12:35:48 PM CST> <Warning> <Dispatcher> <ksp12025> <cuAS01> <ExecuteThread:
              '5' for queue: 'default'> <system> <> <000000> <RuntimeException thrown by rmi
              server: 'weblogic.rmi.internal.BasicServerRef@105 - jvmid: '-4285102758410085945S:10.1.21.21:[18120,18120,18121,18121,18120,18121,-1]:qdomain4:cuAS01',
              oid: '261', implementation: 'weblogic.transaction.internal.CoordinatorImpl@311671da''>
              java.lang.NullPointerException
              at weblogic.transaction.internal.ServerResourceInfo.isAccessibleAtAndAssignableTo(ServerResourceInfo.java(Compiled
              Code))
              at weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(ServerTransactionImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(ServerTransactionImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.ServerTransactionImpl.localCommit(ServerTransactionImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.SubCoordinatorImpl.startCommit(SubCoordinatorImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.CoordinatorImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java(Compiled
              Code))
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java(Compiled
              Code))
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java(Compiled
              Code))
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

              Thanks,
              The problem did clear up when the Unix server had to get bounced. I believe it
              was bounced for an unrelated issue.
              The one thing I noticed was that there were a couple of copies of my EJBs in the
              wlnotdelete directory that the server had been previously compliaining about.
              They went away after the Unix server was restarted and the NullPointer problem
              went away.
              We plan to upgrade to 7.1 soon, but will try to move to SP5 if we need to sooner.
              Thanks for your help.
              Tania Rhinehart
              Rajesh Mirchandani <[email protected]> wrote:
              >This is fixed in SP5. Open a case with [email protected] and reference
              >CR092301.
              >
              >Slava Imeshev wrote:
              >
              >> Hi Tania,
              >>
              >> I think you need to contact BEA support at [email protected]
              >>
              >> Regards,
              >>
              >> Slava Imeshev
              >>
              >> "Tania Rhinehart" <[email protected]> wrote in message
              >> news:[email protected]...
              >> >
              >> > I am using Weblogic 6.1 SP4 on JDK 1.3.1 on AIX.
              >> > My server has a transacted EJB which accesses Oracle and DB2 databases.
              > I
              >> have
              >> > been running my application for several months.
              >> > Suddenly, yesterday it starting spitting out these exceptions a few
              >times
              >> a minute.
              >> > I cannot find the configuration change I made that would have caused
              >this
              >> to
              >> > suddenly start appearing. My code has not changed in 2 weeks.
              >> >
              >> > Has anyone seen this error before? Does anyone know what causes
              >this, so
              >> that
              >> > I can narrow my search?
              >> >
              >> > Thanks for your help,
              >> > Tania
              >> >
              >> > ####<Mar 4, 2003 12:35:48 PM CST> <Warning> <Dispatcher> <ksp12025>
              >> <cuAS01> <ExecuteThread:
              >> > '5' for queue: 'default'> <system> <> <000000> <RuntimeException
              >thrown by
              >> rmi
              >> > server: 'weblogic.rmi.internal.BasicServerRef@105 - jvmid:
              >> '-4285102758410085945S:10.1.21.21:[18120,18120,18121,18121,18120,18121,-1]:q
              >> domain4:cuAS01',
              >> > oid: '261', implementation:
              >> 'weblogic.transaction.internal.CoordinatorImpl@311671da''>
              >> >
              >> > java.lang.NullPointerException
              >> > at
              >> weblogic.transaction.internal.ServerResourceInfo.isAccessibleAtAndAssignable
              >> To(ServerResourceInfo.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(Se
              >> rverTransactionImpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(Se
              >> rverTransactionImpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.ServerTransactionImpl.localCommit(ServerTransa
              >> ctionImpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.SubCoordinatorImpl.startCommit(SubCoordinatorI
              >> mpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.CoordinatorImpl_WLSkel.invoke(Unknown
              >> > Source)
              >> > at
              >> weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java(Compi
              >> led
              >> > Code))
              >> > at
              >> weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java(C
              >> ompiled
              >> > Code))
              >> > at
              >> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
              >> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >> >
              >
              >--
              >Rajesh Mirchandani
              >Developer Relations Engineer
              >BEA Support
              >
              >
              

  • NullPointer in invoking JNI function

    Hi everybody.
    I have small problem. I'm trying to call dll (jnidll) function (f1) from java that calls function (f2) in another dll (that is not jni - actually is 3rd party so I cannot change it).
    I have no problem calling function f1 from my java application, and I have no problem calling function f2 from another C++ test application. But I have problem calling f1 that calls f2.
    I get NullPointerException to my java application.
    Does anybody have an idea how to solve it?
    I tried also to use jawin.dll for calling that non-jni dll but had the same (NullPointer) problem.

    Ok, first I wanted only quick answer, if anybody had the same problem. Now I will post my code here, because I didn't solved the problem yet.
    Let's suppose that the name of the jni dll I'm trying to create is myjnidll.dll. It's header file has jni.h included and e.g. two following lines:
    JNIEXPORT jint JNICALL Java_JniPosApi00_MbtConnect (JNIEnv *, jobject, jstring);
    JNIEXPORT jint JNICALL Java_JniPosApi00_MbtDisconnect (JNIEnv *, jobject);Source file of my dll has following definitions of that functions. Name of called 3rd party dll is 3rdparty.dll and it has functions Connect and Disconnect exported with the following names _Connect@4 and _Disconnect@0.
    #include <windows.h>
    #include <jni.h>
    #include "myjnidll.h"
    typedef long (__stdcall *INTxVOID)();
    typedef long (__stdcall *INTxSTR)(LPCTSTR);
    JNIEXPORT jint JNICALL Java_JniPosApi00_mConnect
      (JNIEnv * jEnv, jobject jObj, jstring jszSubSystem) {
        LPCTSTR szSubSystem = jEnv->GetStringUTFChars(jszSubSystem, 0);
        long result = 1;
        INTxSTR ProcAdd;
        HINSTANCE hinstLib = LoadLibrary("3rdparty.dll");
        if (hinstLib != NULL) {
            ProcAdd = (INTxSTR) GetProcAddress(hinstLib, "_Connect@4");
            if (ProcAdd != NULL)
                res = (ProcAdd)("SUBSYSTEM1");
        jEnv->ReleaseStringUTFChars(jszSubSystem, szSubSystem);
        FreeLibrary(hinstLib);
        return res;
    JNIEXPORT jint JNICALL Java_JniPosApi00_mDisconnect
      (JNIEnv * jEnv, jobject jObj) {
        long res = 1;
        INTxVOID ProcAdd;
        HINSTANCE hinstLib =  = LoadLibrary("3rdparty.dll");
        if (hinstLib != NULL) {
            ProcAdd = (INTxVOID) GetProcAddress(hinstLib, "_Disconnect@0");
            if (ProcAdd != NULL)
                res = (ProcAdd)();
        FreeLibrary(hinstLib);
        return res;
    }I'm sure, that the 3rdparty.dll library is in the system path.
    Parameters of functions in 3rd party dll are (from the description that I have):
    Connect(UCHAR FAR*)
    Disconnect(void)Both functions return int. I think there will be no problem with parameters.
    My java program that is calling myjnidll is
    public class MyJavaCallingJniDll {
        public native int mConnect (String szSubSystem);
        public native int mDisconnect ();
        static {
            System.loadLibrary("myjnidll");
        public MyJavaCallingJniDll() {
        public int myConnect (String szSubSystem) {
            return mConnect (szSubSystem);
        public int myDisconnect (){
            return mDisconnect ();
    }and I'm calling this from another java class, but there is no problem for sure.
    So I did som tests and the result is, that when calling from java I get NullPointerException when I'm trying to call mConnect() (or mDisconnect()).
    When I try to call from C++ I get "Unhandled exception, blabla Access violation" at the line where I'm trying to invoke functions from 3rd party dll.
    I have no idea, where's the problem. Thanks anybody, who's trying to help me.

  • One VO used on two pages creating problem.-Nullpointer error

    Hello All,
    I have extended one VO on one page "ponAwardByQuotePG". I am done with that. But this VO is used on second next page as well.
    After pressing one "AWARD" button on 1st page , it goes to 2nd page "ponAwardQuotePG". Both these pages use same VO which i have extended. Whenever I press Save Award GO button on second page, it throws NULLPOINTER exception error attached herewith. I have also attached the flow of steps along with corresponding VO and AM code.
    I found following thing in 2nd page's CO even though my VO is extended as "XXEGAAwardByQuoteVOEx" , its showing following in CO:
    AwardByQuoteVO awardbyquotevo = (AwardByQuoteVO)awardbyquoteam.findViewObject("AwardByQuoteVO");
    Please guide what could be the reason (Contact me at [email protected] so that i can send you some more document as attachment.)
    Following is the error stack:
    "java.lang.NullPointerException<br /><br /> at oracle.apps.pon.award.creation.webui.AwardQuoteCO.processFormRequest(AwardQuoteCO.java:1710)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)<br /><br /> at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)<br /><br /> at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)<br /><br /> at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)<br /><br /> at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)<br /><br /> at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)<br /><br /> at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2676)<br /><br /> at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1683)<br /><br /> at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)<br /><br /> at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)<br /><br /> at _oa__html._OA._jspService(_OA.java:84)<br /><br /> at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)<br /><br /> at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)<br /><br /> at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)<br /><br /> at oracle.jsp.JspServlet.internalService(JspServlet.java:186)<br /><br /> at oracle.jsp.JspServlet.service(JspServlet.java:156)<br /><br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)<br /><br /> at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)<br /><br /> at org.apache.jserv.JServConnection.run(JServConnection.java:294)<br /><br /> at java.lang.Thread.run(Thread.java:619)"

    I found following thing in 2nd page's CO even though my VO is extended as "XXEGAAwardByQuoteVOEx" , its showing following in CO:
    AwardByQuoteVO awardbyquotevo = (AwardByQuoteVO)awardbyquoteam.findViewObject("AwardByQuoteVO");controller code won't change when you substitute the VO. You will see it only at the runtime.
    And to verify the substitution at the run time, select the "About this Page" link and expand the "Business Component References Details".
    And to debug the error in the standard controller, you need to decompile the controller file and include it in your project.
    This will show you the exact problem from where you can proceed further. You can use jad tool for decompilation.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help!  problem with getElementById - nullpointer

    I keep getting a nullpointer exception when i use getElementById in attempt to get the text of the element which is contained by the element with a specific ID. help! im going nuts
    String firstAtt = document.getElementById("A100").getElementsByTagName("first_name").item(0).getFirstChild().getNodeValue();
    System.out.println("first_name for A1000 found " + firstAtt);             DTD:
    <!ELEMENT family_tree (family_member)*>
    <!ELEMENT family_member (first_name,last_name,comments,birth_date,birth_location,img_file_name,(spouse)*,(child)*)>
    <!ATTLIST family_member pid ID #REQUIRED>
    <!ELEMENT first_name (#PCDATA)>
    <!ELEMENT last_name (#PCDATA)>
    <!ELEMENT comments (#PCDATA)>
    <!ELEMENT birth_date (#PCDATA)>
    <!ELEMENT birth_location (#PCDATA)>
    <!ELEMENT img_file_name (#PCDATA)>
    <!ELEMENT spouse EMPTY>
    <!ATTLIST spouse pidref IDREF #REQUIRED>
    <!ELEMENT child EMPTY>
    <!ATTLIST child pidref IDREF #REQUIRED>xml:
    <!DOCTYPE family_tree SYSTEM "family.dtd">
    <family_tree>
    <family_member pid="A1000">
    <first_name>fred</first_name>
    <last_name>smith</last_name>
    <comments>here are some comments</comments>
    <birth_date>10-24-1974</birth_date>
    <birth_location>tulsa,ok</birth_location>
    <img_file_name>"fred_smith123.jpg"</img_file_name>
    <spouse pidref="A1004"/>
    <child pidref="A1005"/>
    </family_member>
    <family_member pid="A1005">
    <first_name>john</first_name>
    <last_name>smith</last_name>
    <comments>bla bla</comments>
    <birth_date>10-24-1996</birth_date>
    <birth_location>tulsa,ok</birth_location>
    <img_file_name>"john_smith123.jpg"</img_file_name>
    </family_member>
    <family_member pid="A1004">
    <first_name>suzy</first_name>
    <last_name>smith</last_name>
    <comments>bla bla</comments>
    <birth_date>10-24-1998</birth_date>
    <birth_location>tulsa,ok</birth_location>
    <img_file_name>"suzy_smith123.jpg"</img_file_name>
    </family_member>
    </family_tree>

    sorry for posting this so quick, its obvious now what my problem is...its A1000 not A100, silly mistake

  • EntityManager problem (nullPointer exception)

    Hello,
    I need help.
    I have created Entity from Table (table Users) from MySQL database.
    I'm using JPA.
    @Entity
    @NamedQueries( { @NamedQuery(name = "Users.findAll", query = "select o from Users o"),
                     @NamedQuery(name = "Users.findByUsername", query = "SELECT o FROM Users o WHERE o.username = :username")})
    @Table(name = "\"users\"")
    public class Users implements Serializable {
        @SuppressWarnings("compatibility:-1756790181151554415")
        private static final long serialVersionUID = 1L;
        @Column(name = "address", nullable = false)
        private String address;
        @Column(name = "city", nullable = false)
        private String city;
        @Column(name = "email", nullable = false)
        private String email;
        @Column(name = "firstPassword", nullable = false)
        private String firstPassword;
        @Column(name = "firstname", nullable = false)
        private String firstname;
        @Column(name = "lastname", nullable = false)
        private String lastname;
        @Column(name = "rank", nullable = false)
        private int rank;
        @Temporal(TemporalType.DATE)
        @Column(name = "regdate", nullable = false)
        private Date regdate;
        @Id
        @Column(name = "user_id", nullable = false)
        private long user_id;
        @Column(name = "username", nullable = false)
        private String username;
        public Users() {
        public Users(String address, String city, String email, String firstPassword, String firstname, String lastname,
                     int rank, Date regdate, long user_id, String username) {
            this.address = address;
            this.city = city;
            this.email = email;
            this.firstPassword = firstPassword;
            this.firstname = firstname;
            this.lastname = lastname;
            this.rank = rank;
            this.regdate = regdate;
            this.user_id = user_id;
            this.username = username;
        public String getAddress() {
            return address;
        public void setAddress(String address) {
            this.address = address;
        public String getCity() {
            return city;
        public void setCity(String city) {
            this.city = city;
        public String getEmail() {
            return email;
        public void setEmail(String email) {
            this.email = email;
        public String getFirstPassword() {
            return firstPassword;
        public void setFirstPassword(String firstPassword) {
            this.firstPassword = firstPassword;
        public String getFirstname() {
            return firstname;
        public void setFirstname(String firstname) {
            this.firstname = firstname;
        public String getLastname() {
            return lastname;
        public void setLastname(String lastname) {
            this.lastname = lastname;
        public int getRank() {
            return rank;
        public void setRank(int rank) {
            this.rank = rank;
        public Date getRegdate() {
            return regdate;
        public void setRegdate(Date regdate) {
            this.regdate = regdate;
        public long getUser_id() {
            return user_id;
        public void setUser_id(long user_id) {
            this.user_id = user_id;
        public String getUsername() {
            return username;
        public void setUsername(String username) {
            this.username = username;
    }and I have created ManagedBean LoginUser. In this class is method getUser().
            private Users getUser() {
                System.out.println("Username: " +username);
                try{
                    Users userr = (Users) entManager.createNamedQuery("Users.findByUsername").setParameter("username", username).getSingleResult();
                    loginUser.user = userr;
                    System.out.println("USER---- " +userr);
                    return userr;
                }catch(NoResultException nre){
                    System.out.println(nre.getMessage());
                    return null;
            }I have problem with entity manager because this row: Users userr = (Users) entManager.createNamedQuery("Users.findByUsername").setParameter("username", username).getSingleResult();* causes exception:
    Caused by: java.lang.NullPointerException
         at view.loginUser.getUser(loginUser.java:74)
            .I don't know why. This code is from my previous project from netbeans and there wasn't a problem.
    I don't see a problem.
    Can you help me ?
    Sorry for my English.
    Thanks.

    Does the persistence.xml define the persistence-unit ViewController? What is the persistence provider? Hibernate or Eclipselink? Is a datasource with MySQL deifned?
    With the EclipseLink provider the persistence.xml should be similar to the following.
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0"
         xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
    http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
         <persistence-unit name="ViewController" transaction-type="JTA">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <jta-data-source>java:jboss/datasources/MySQLDS</jta-data-source>
              <class>packagename.Users</class>
              <properties>
                   <property name="eclipselink.target-server" value="WebLogic_10"/>
                   <property name="eclipselink.target-database" value="MySQL"/>
                   <property name="eclipselink.ddl-generation" value="create-tables"/>
                   <property name="eclipselink.logging.level" value="FINEST"/>
                   <property name="eclipselink.dialect" value="org.hibernate.dialect.MySQLDialect" />
              </properties>
         </persistence-unit>
    </persistence>
    Edited by: dvohra16 on Feb 25, 2013 9:36 AM

  • Recursive & Loadable WD-Tree-Tutorial: Problems with parameters; NullPointe

    Hello all, it's me again
    This time I have a problem with the Tutorial called "Constructing a Recursive and Loadable WD-Tree". I followed each step in detail, but when I deploy it all I see several errors/mistakes in my resulting App:
    1. I can click on the "directories" in this example and the directory-text is displayed in the InputForm. Normally it should only display "filenames", not directory-names... I checked the bool-properties in the addChildren-method and they are set as it's said in the tut.
    2. When I try to expand any of the two nodes (C or Games; D is already expanded and includes "Games") I get a NullPointerException for the addChildren()-method in the first line (parent.nodeChildNode();). So the parameter "parent" is null or does at least not contain what it's expected to.
    3. I have some Warnings: "TreeNodeType 'onAction.onAction': Parameters of action 'Select' and event 'onAction' are not compatible" and the same again for the second action (LoadChildren). So perhaps problem 2 can be solved by solving no 3?!
    I'm stuck. Can anyone help me please?
    I doublechecked that everything is as said in the tutorial.
    Regards
    Michael

    Hi
    I realized I had an "Warning"-Message at my View-Context-Root-Node, where it said "Migrate Context". After I did this I get an "internal server error", Failed to process request.
    Hmm, it seems as if there were a lot of changes from NW2004 to NW7.1, cause when I try to deploy the ready-to-deploy-tutorial (downloadable along with the Initial project template from SDN) I get deployment errors.
    So I'll stop it now or perhaps try my own implementation (with java.io.File and recursive methods and loadable tree) to get familiar with the tree-thing in WD/Java
    Thanks so far for the help, it's greatly appreciated.
    Michael

  • NullPointer exception in request.getParameter().indexof(.....) only in 6.1

    Hi
    I have one full working application (containing WAR + JAR) files.
    Right now this application is working absolutely fine in weblogic 6.0 sp1 on
    WINNT & Solaris.
    In this application, we accept events to save data from external
    applications like excel files.
    Now code in JSP is -->
    Line 1: String Data = request.getParameter("data");
    Line 2: Data.indexof(........);
    Now in case of weblogic 6.1, i am getting NullPointer Exception in line 2,
    but I am NOT getting any exception in case of weblogic 6.0sp1.
    To my surprise, I am also printing request obj parameters values, whenever
    jsp get called from external source, there it is printing value of "data".
    I am totally clueless!!
    Any idea plz?
    Ashish Jain

    Looking very closely at request object contents..
    Wht i am sending (posting) from excel file-->
    xmlData=<?xml version="1.0" encoding="UTF-8"?><reportSheet bu="SHKXXX"
    report="PBrandContr" sheet=
    "PBrandContr" year="2002" coType="A" status="0" brId="PIC" act_brId="PIC"
    opt="P" ></reportSheet>
    But 6.1 interprets like this ---->
    key is --------> xmlData=<?xml version="1.0" encoding="UTF-8"?><reportSheet
    bu="SHKXXX" report="PBrandContr" sheet=
    "PBrandContr" year="2002" coType="A" status="0" brId="PIC" act_brId
    And Value is -------> "PIC" opt="P" ></reportSheet>
    This thing is causing all problems.
    I am not observing this kinda behaviour in 6.0sp1.
    Thanks
    Ashish Jain
    "Ashish Jain" <[email protected]> wrote in message
    news:[email protected]..
    Hi
    I have one full working application (containing WAR + JAR) files.
    Right now this application is working absolutely fine in weblogic 6.0 sp1on
    WINNT & Solaris.
    In this application, we accept events to save data from external
    applications like excel files.
    Now code in JSP is -->
    Line 1: String Data = request.getParameter("data");
    Line 2: Data.indexof(........);
    Now in case of weblogic 6.1, i am getting NullPointer Exception in line 2,
    but I am NOT getting any exception in case of weblogic 6.0sp1.
    To my surprise, I am also printing request obj parameters values,whenever
    jsp get called from external source, there it is printing value of "data".
    I am totally clueless!!
    Any idea plz?
    Ashish Jain

  • Nullpointer exception... any help would be appreciated

    In advance, I apologize for any ignorance which I may obviously have... I'm in the process of learning Java, and am used to C/C++... In any case, I'm running into a nullpointer exception while 'compiling', which I'm having trouble figuring out... I'll list everything below, but this message will be rather long, as I will try to include everything I can. For this reason, I will ask my questions here, at the top:
    1) A null pointer exception, I believe, is generated when something is being referenced which is currently null, for example "a=null; a.b;" yields a null pointer exception. However, is there any other way that one is generated?
    2) Are there methods to figure out what/why something is null other than simply looking at it? As shown below, it seems that just looking at it runs you in a circle from line to line, file to file, which leads you back to the beginning where nothing is actually null... (I'm probably just not seeing it, but that seems to be what's happening to me)
    So now, on to the actual code:
    The following is a printout of the debugging info:
    ~/bin/jdk*/bin/java -classpath classes jamie.Main
    java.lang.NullPointerException
    at jamie.Main.Sys_Log(Main.java:110)
    at jamie.Main.Setup(Main.java:142)
    at jamie.Main.main(Main.java:54)
    Exception in thread "main" java.lang.NullPointerException
    at jamie.Main.Sys_Log(Main.java:110)
    at jamie.Main.Shutdown(Main.java:182)
    at jamie.Main.main(Main.java:92)And a short excerpt of each. (*) indicates line which error originates:
    20    )   private static Log                sys_log;
    108  )   static void Sys_Log(String msg)
    109  )   {
    110*)        sys_log.Log(msg);
    111  )   }
    142*)   Sys_Log("Server warming up...");
    182*)   Sys_Log("Server shutting down...");
    50  )     public static void main(String[] args)
    51  )     {
    52  )          try
    53  )          {
    54*)                Setup();
    85  )     catch(Exception e)
    86  )     {
    87  )          e.printStackTrace(System.out);
    88  )          err_log.Log(e.toString());
    89  )     }
    90  )     finally
    91  )     {
    92*)            Shutdown();
    93  )      }Now, various things that I have tried, and their result (you can probably skip this section, as these were mostly futile efforts):
    What seems odd to me is that the initial error is on line 110, which is the logging function Sys_Log. Since it's a null pointer exception, I would assume that sys_log is null? and thus in calling Log we're generating that error... I'm not entirely sure that that makes sense, though. Additionally, and what I find odd, is that if I change it to what I will list below, I get a slew of other seemingly unrelated problems:
    20    )   private static Log                sys_log;
    108  )   static void Sys_Log(String msg)
    109  )   {
    110#)        if (sys_log!=null)
    111  )        sys_log.Log(msg);
    112  )   }This results in a problem with function Err_Log, which I change the same way, resulting in the following:
    java.lang.NullPointerException
            at jamie.Area_LUL.Load(Area_LUL.java:23)
            at jamie.Main.Setup(Main.java:161)
            at jamie.Main.main(Main.java:55)
    Exception in thread "main" java.lang.NullPointerException
            at jamie.Main.Shutdown(Main.java:186)
            at jamie.Main.main(Main.java:93)In Main.java the following lines are generating the error:
    160  )   lul = new Area_LUL();
    161*)   lul.Load();And in Area_LUL.java I also have the following:
    14  )class Area_LUL implements LoaderUnloader
    15  ){
    16  )    public void Load()
    17  )    {
    18  )        try
    19  )        {
    20  )            areadir = new File("./areas/");
    21  )            SAXParser p = SAXParserFactory.newInstance().newSAXParser();
    22  )
    23*)            for(File curr : areadir.listFiles(new Area_Filter()))
    24  )            {
    25  )                p.parse(curr, new XMLParser());
    26  )            }
    27  )        }Where in the above, the for statement is generating the null pointer exception... which would tell me that areadir is null, however it is defined as new File("./areas/"); Also, lul (defined as new Area_LUL(); is generating the same error, though it is clearly defined in Area_LUL.java at the top of the last excerpt.
    Also, LoaderUnloader is defined in another file as follows:
    interface LoaderUnloader
        void Load();
        void Unload();
    }which are defined in Area_LUL in Area_LUL.java .
    A major theory which I currently have is that the compiler is beginning with my main.java file, and not seeing the class definition in another file, and thus attributing the class obj I create as null, which is causing the error, but I also am not sure if this is possible...
    My imports for Main.java are as follows:
    package jamie;
    import java.io.*;
    import java.util.*;I'm not entirely sure what the package is including, however I do have a jamie.jar file in another directory (../../dist) (could be referencing that?). Also, to compile the source I am using the following command:
    ~/bin/jdk*/bin/java -classpath classes jamie.MainHowever my classpath (I believe) isn't set to include all my files in the given directory. I wouldn't believe that this would be an issue, however if it could possibly be causing this, I can figure out how to set it properly. Also, this should mean I'm starting with Main.java, and perhaps I am right in concluding that it isn't referencing Area_LUL in another file properly, which is setting it as null?
    In any case... Any help would be greatly appreciated. This has been a bit of a struggle for about a month now, trying various resources, moving things around, etc... Thanks so much for your time in reading,
    -Jess

    I'm not able to follow the program flow from your post. Please create a small standalone program that exhibits the problem and post that back here.
    Your assumption re a NPE is correct, that's the only way they're generated.
    There are no "canned" methods to resolve NPEs. The best solution is to put System.out.println statements for all of the involved objects and variables immediately preceeding the error line (in this case, 110) and something will show null. Usually that's enough info to backtrace to the real cause.

  • Performance problem creating rows on viewobject

    Hi,
    When a user pushes a button in my Oracle ADF 11.1.1.3.0 GUI,
    he triggers a method in my backing bean.
    This method is called insertNewForecastTable, that takes a (Tree)Map called forecastMap as input. (see below)
    ( The key of this map is a Timestamp,
    the value of this map is an object ForecastEntry.
    A ForecastEntry consists out of 10 ForecastParts, and each Forecastpart contains 4 long values. )
    private void insertNewForecastTable(Map forecastMap) {
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    DCIteratorBinding ForecastIter = bc.findIteratorBinding("ForecastViewIterator");
    DCDataControl dc = ForecastIter.getDataControl();
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    ViewObject forecastVO = am.findViewObject("ForecastView");
    Set keys = forecastMap.keySet();
    Iterator keyIter = keys.iterator();
    RowSetIterator it = ForecastIter.getRowSetIterator();
    while (keyIter.hasNext()) {
    Long timestamp = (Long)keyIter.next();
    Timestamp ts = new Timestamp(timestamp);
    Row r = it.createRow();
    r.setAttribute(0, ts);
    ForecastEntry forecastentry = (ForecastEntry)forecastMap.get(timestamp);
    int j = 1;
    for (int i=0;i<10;i++) {
    ForecastPart forecastPart = forecastentry.getForecastPart(i);
    r.setAttribute(j,forecastPart.getHistory());
    j++;
    r.setAttribute(j,forecastPart.getForecast());
    j++;
    r.setAttribute(j,forecastPart.getTrend());
    j++;
    r.setAttribute(j,forecastPart.getLimit());
    j++;
    forecastVO.insertRow(r);
    am.getTransaction().commit();
    Configuration.releaseRootApplicationModule(am,true);
    Problem is : for 3360 entries in this table or viewobject, it takes 10 minutes (!!!) to complete this code.
    Bottleneck is the for-loop and the forecastVO.insertRow(r);
    Both timings are rising from 15 msec in the beginning to 500 msec at the end.
    Anyone has some ideas how to improve my performance ?
    Am I doing something wrong trying to create and insert 3360 rows in this table ?
    Thanks.

    Ok,
    My binding is back ok, so the nullpointer is gone.
    But the speed of processing 1000+ inserts into a table is still very poor.
    This is my code at the moment :
      +private void insertNewForecastTable(Map forecastMap) {+
        +DCBindingContainer bc = (DCBindingContainer)getBindings();+
        +DCIteratorBinding ForecastIter = bc.findIteratorBinding("ForecastViewIterator");+
        +DCDataControl dc  = ForecastIter.getDataControl();+
        +ApplicationModule am = (ApplicationModule)dc.getDataProvider();+
        +ViewObject forecastVO = am.findViewObject("ForecastView");+ 
        +RowSetIterator it = ForecastIter.getRowSetIterator();+
        +Set keys = forecastMap.keySet();+        
        +Iterator keyIter = keys.iterator();+
        +List nameList = new ArrayList();+
        +nameList.add("Timestamp");+
        +for (int i=1 ; i<=10; i ++) {+
          +String H = "H"+i;+
          +String F = "F"+i;+
          +String T = "T"+i;+
          +String L = "L"+i;+
          +nameList.add(H);+
          +nameList.add(F);+
          +nameList.add(T);+
          +nameList.add(L);+
        +}+
        +long time_begin = System.currentTimeMillis();+
        +int counter = 0;+
        +// for each timestamp+
        +while (keyIter.hasNext()) {+
          +// Get the timestamp.+
           +Long timestamp = (Long)keyIter.next();+
           +// convert long to timestamp+
           +Timestamp ts = new Timestamp(timestamp);+
           +// create new row in table+
           +Row r = it.createRow();+
          +List valueList = new ArrayList();+
          +valueList.add(ts);+
          +ForecastEntry forecastentry = (ForecastEntry)forecastMap.get(timestamp);+
          +for (int i=0;i<10;i++) {+
              +ForecastPart forecastPart = forecastentry.getForecastPart(i);+
              +valueList.add(forecastPart.getHistory());+
              +valueList.add(forecastPart.getForecast());+
              +valueList.add(forecastPart.getTrend());+
              +valueList.add(forecastPart.getLimit());+
          +}+
          +r.setAttributeValues(nameList, valueList);+
          +forecastVO.insertRow(r);+
          +counter++;+
          +if (counter % 100 == 0) {+
            +am.getTransaction().commit();+
            +System.out.println("Committing rows " + (counter-100) + " to " + counter );+
          +}+
        +}+
        +long time_end = System.currentTimeMillis();+
        +// commit+
        +am.getTransaction().commit();+
       +// Configuration.releaseRootApplicationModule(am,true);+
        +System.out.println("Total time to insert all rows : " + (time_end-time_begin ));+
      +}+It takes up to 500 seconds to insert 3000 rows !
    I also changed the update batch value from 100 to 5, but no difference.
    I'm now also committing every 100 rows.
    And at the end, I get a nullpointer exception at RowDataManager.getRowIndex(RowDataManager.java:191)
    All help welcome.

  • File not refreshing and error problem

    well i have 2 problems..
    first:
    i dont know why a jsp file does not reload to the edited version
    meaning lets say I have a jsp file doing something it loads up fine and does I edit the file and try reloading the old copy keeps on coming back..
    there are times when the new copy loads up but that is rare..
    second can anyone tell me what is wrong with this code.. I cant figure out what is wrong with it.. only in the <form></form> tags
    because rest of the code is fine
    i keep on getting nullpointerexception i dont understand why
    <%@ page import="java.io.*"%>
    <%@ taglib uri="taglibdb.tld" prefix="sql" %>
    <html>
    <head>Admin Property</head>
    <body>
         <form name="addproperty" method="post" action="../servlet/PropertyServlet">
         <% if (request.getParameter("action").equalsIgnoreCase("edit")){
         %>
              <input type="text" name="val" value="<%=request.getParameter("val")%>">
              <input type="text" name="property" value="<%=request.getParameter("property")%>">
              <input type="submit" name="editproperty">
         <% } else { %>
         <input type="text" name="property">
         <input type="submit" value="addprop">
         <% } %>
    </form>
    <sql:openConnection driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" user="guest" password="guest" id="A" />
    <sql:ifError id="A">
    <br>Could not connect to database
    </sql:ifError>
    <sql:setQuery id="A" query="select * from PROPERTY" res="B"/>
    <table>
    <sql:forEachRow res="B">
    <tr>
         <td><sql:getColumn position="1" res="B"/></td>
         <td><sql:getColumn position="2" res="B"/></td>
         <td>">Delete...</a></td>
         <td><a href="../jsp/property.jsp?action=edit&val=<sql:getColumn position="1" res="B"/>&property=<sql:getColumn position="2" res="B"/>">Edit...</a></td>
    </tr>
    </sql:forEachRow>
    </table>
    <sql:closeConnection id="A"/>
    </body>
    </html>
    if i change the form part to:
    <form name="addproperty" method="post" action="../servlet/PropertyServlet">
         <input type="text" name="property">
         <input type="submit" value="addprop">
    </form>
    it works fine the way it is suppose to

    In case you are running Tomcat 4.1 the java file and class file of your jsp is located in Tomcat 4.1/work/standalone/.. and your file should be named something like MyJspPage_jsp.java (try search for it).
    About your nullpointer, you should check your spelling when requesting parameters,
    request.getParameter("action") is not the same as request.getParameter("Action") etc.
    Good luck.
    Johan

  • URGENT please !!! Problem with XML Publisher , OAF Integration

    Hi,
    I am trying to integrate an XML Publisher Report into OA Framework but running into issues.
    If you could help me or give any pointers I would greatly appreciate it.
    When run the report through Concurrent Manager, it runs without any problem. But, when I run
    it from OAF, nullpointer exception is raised at this statement i.e. datatemplate.processData();
    I did go through many threads related to this topic, but couldn't get any help.
    This is what I have done
    ========================
    1. Wrote a PLSQL package to generate XML output.
    BEGIN
    open c_person;
    fetch c_person into v_last_name;
    close c_person;
    fnd_file.put_line(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="UTF-8"?>');
    fnd_file.put_line(FND_FILE.OUTPUT,'<QUALIFICATION_REPORT>');
    fnd_file.put_line(FND_FILE.OUTPUT,'<CANDIDATE>');
    fnd_file.put_line(FND_FILE.OUTPUT,'<CANDIDATE_NAME>'||v_last_name||'</CANDIDATE_NAME>');
    fnd_file.put_line(FND_FILE.OUTPUT,'<QUALIFICATIONS_LIST>');
    FOR c1_Rec IN c_qual LOOP
    fnd_file.put_line(FND_FILE.OUTPUT , '<QUALIFICATION>');
    WritetoXMLForRTF('NAME' , c1_rec.name);
    WritetoXMLForRTF('CATEGORY' , c1_rec.category);
    WritetoXMLForRTF('START_DATE' , c1_rec.start_date);
    WritetoXMLForRTF('END_DATE' , c1_rec.end_date);
    WritetoXMLForRTF('SUBJECT' , c1_rec.subject_meaning);
    WritetoXMLForRTF('GRADE_ATTAINED' , c1_rec.grade_attained);
    WritetoXMLForRTF('HQ_STATUS' , c1_rec.hq_status);
    fnd_file.put_line(FND_FILE.OUTPUT , '</QUALIFICATION>');
    END LOOP;
    fnd_file.put_line(FND_FILE.OUTPUT,'</QUALIFICATIONS_LIST>');
    fnd_file.put_line(FND_FILE.OUTPUT,'</CANDIDATE>');
    fnd_file.put_line(FND_FILE.OUTPUT,'</QUALIFICATION_REPORT>');
    retcode := 0;
    END;
    2. Defined a concurrent program to call this PLSQL package/procedure.
    3. Defined a RTF template.
    4. Registered both the data definition and report template using XML Publisher Admin.
    5. Within OA Framework, I have coded as follows.
    Controller
    Process Form Request
    Added a button to invoke the report.
    if (pageContext.getParameter("AddlQualRptBtn") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    String p1 = "17965";
    String TemplateApplicationShortName = "CPC";
    String TemplateCode = "CPC_QUAL_RPT" ;
    BlobDomain result = (BlobDomain) getXMLData(p1,pageContext,webBean);
    Properties prop = new Properties();
    prop.put("html-image-dir",pageContext.getTemporaryImageLocation());
    prop.put("html-image-base-uri",pageContext.getTemporaryImageLocation());
    try {
    DocumentHelper.exportDocument( pageContext,
    TemplateApplicationShortName,
    TemplateCode,
    "en" , //Language
    "US" , //Territory
    result.getInputStream(),
    Template.TEMPLATE_TYPE_RTF, //OutputType,
    prop);
    } catch (Exception e)
    throw new OAException("Exception" + e.getMessage(),OAException.ERROR);
    getXMLData
    public BlobDomain getXMLData(String pPersonId, OAPageContext pageContext, OAWebBean webBean)
    BlobDomain blobDomain = new BlobDomain();
    OAApplicationModule oaapplicationmodule = pageContext.getApplicationModule(webBean);
    OADBTransaction oadbtransaction = oaapplicationmodule.getOADBTransaction();
    try
    String dataDefCode = "CPC_IREC_QUALIFICATION_RPT" ;
    String dataDefApp = "CPC";
    DataTemplate datatemplate = new DataTemplate(((OADBTransactionImpl)oaapplicationmodule.getOADBTransaction()).getAppsContext(), dataDefApp,dataDefCode );
    Hashtable parameters = new Hashtable();
    parameters.put("p_person_id",pPersonId);
    datatemplate.setParameters(parameters);
    datatemplate.setOutput(blobDomain.getBinaryOutputStream());
    datatemplate.processData();
    catch(SQLException e)
    throw new OAException("SQL Error=" + e.getMessage(),OAException.ERROR);
    catch (XDOException e)
    throw new OAException("XDOException" + e.getMessage(),OAException.ERROR);
    catch(Exception e)
    throw new OAException("Exception" + e.getMessage(),OAException.ERROR);
    return blobDomain;
    6. When I run the report from OAF the statement "datatemplate.processData();" generates Null Pointer Exception error.

    Hi TyskJohan,
    Thanks a lot for your reply, I appreciate it !!
    Here is the full error stack. I added many debug statements and identified that it exactly fails at datatemplate.processData();
    I did run the PLSQL procedure and it does creates the XML output properly. Also, the report works fine if I run it through Concurrent Manager. Is there any other way I can check from within OA Framework?
    Thanks again.
    [031108_031818343][][EXCEPTION] java.lang.NullPointerException
         at oracle.apps.xdo.dataengine.DataTemplateParser.GetNodeNumChildren(DataTemplateParser.java:345)
         at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(DataTemplateParser.java:277)
         at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(XMLPGEN.java:599)
         at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(DataProcessor.java:193)
         at oracle.apps.xdo.oa.util.DataTemplate.<init>(DataTemplate.java:136)
         at pgcps.oracle.apps.per.irc.selfservice.webui.pgcpsIrcAddlQualRptCO.getXMLData(pgcpsIrcAddlQualRptCO.java:114)
         at pgcps.oracle.apps.per.irc.selfservice.webui.pgcpsIrcAddlQualRptCO.processFormRequest(pgcpsIrcAddlQualRptCO.java:81)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processFormRequest(OAHeaderBean.java:408)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormRequest(OAStackLayoutBean.java:370)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:988)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2675)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at OA.jspService(OA.jsp:34)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    --------------------------------------------------------------------------------------------------------------------

  • Calendar Month View problem.

    Hi everyone.
    Has anyone used the CalendarMonthView UI element.
    After placing it in a normal view, all I get is a NullPointer Exception in the WD code.
    Does anyone know what properties are obligatory?
    Thanks in advance.
    George Daloukov

    I don't think that's a problem of coding.
    I have just added the calendarMonthView in the Web DynPro perspective and bound the needed properties to a context. That's it...
    I cannot see the calendar in the Design Time also...
    it says: CalendarMonthView: rendering problem: null.
    That's why I was asking if someone knew what properties are obligatory for the correct initialisation of that specific UI element.
    regards,
    George.

  • Having problems with new WebLogic MS SQL driver WLS 8.1

    Hi,
    We've recently migrated our application from WLS 6.1 to WLS 8.1. We use an MS SQL database. In 6.1 we used the (now deprecated) weblogic.jdbc.mssqlserver4.Driver driver. In 8.1 we now use the new weblogic.jdbc.sqlserver.SQLServerDriver driver. We now are seeing NullPointerExceptions with the new driver that we never saw when running in 6.1 (with the old driver). The exception is occuring at the driver level. I'll paste some of the stack traces below but here is a quick synopsis of our usage pattern:
    -standard get-use-close pattern on the connection for each request (connection is closed in finally block).
    -pool size: min 1, max 7, increment 5
    -test on reserver enabled
    -we are simply reading data (no updates)
    -we use a single thread that hits the database so there is only ever one active application thread hitting the DB.
    -we are using a stored proc.
    -we setTimeout on the statement (initial testing seems to indicate that query timeout seems to be at the root of the problem)
    The problem seems to occur when statement timeouts occur. I can recreate the problem by setting the statement timeout to 1 sec and throwing a lot data at the DB. What seems to occur is a query hits the timeout and a SocketException is thrown, subsequent queries then throw a NullPointer in the driver layer. Again, this is the behavior under WLS 8.1 with the new weblogic.jdbc.sqlserver.SQLServerDriver driver. If I use the old driver (weblogic.jdbc.mssqlserver4.Driver) under WLS 8.1 all I get is the SocketException (which is what I want). This application ran under WLS 6.1 with the old driver processing millions of queries without any problems.
    We are wondering:
    (1) Is this a known problem?
    (2) Is there a recommended workaround?
    Cheers, and as always thanks in advance for any help.
    Stack traces follow.
    Thank,
    Mich
    Here are some failure traces from the WLS 8.1 new driver:
    java.sql.SQLException: [BEA][SQLServer JDBC Driver]Execution timeout expired.
         at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.postProcessExceptionFromCommonExecute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:124)
         at com.our.QueryHandler.execute(QueryHandler.java:79)
    THEN WHEN A SUBSEQUENT QUERY IS MADE:
    java.lang.NullPointerException
         at weblogic.jdbc.sqlserver.tds.TDSRequest.switchColumnDescriptions(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRequest.processRow(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRPCNonCursorExecuteRequest.submitPrepare(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRPCExecuteRequest.doPrepExec(Unknown Source)
         at weblogic.jdbc.sqlserver.tds.TDSRPCExecuteRequest.execute(Unknown Source)
         at weblogic.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:124)
         at com.our.QueryHandler.execute(QueryHandler.java:79)
    Just to be complete here is the stacktrace generated by a timeout using the old driver on WLS 8.1 (again, this one behaves as expected):
    weblogic.jdbc.mssqlserver4.TdsException: I/O exception while talking to the server, java.net.SocketTimeoutException: Read timed out
         at weblogic.jdbc.mssqlserver4.TdsStatement.getMoreResults(TdsStatement.java:813)
         at weblogic.jdbc.mssqlserver4.TdsStatement.execute(TdsStatement.java:210)
         at weblogic.jdbc.mssqlserver4.TdsStatement.executeQuery(TdsStatement.java:54)
         at weblogic.jdbc.mssqlserver4.TdsStatement.executeQuery(TdsStatement.java:1424)
         at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:124)

    Michel Crichton wrote:
    Hi,
    Thanks for the prompt reply. In answer to your questions:
    What I would like to know is the exact code/sequence that causes the subsequent exception. See the sequence of calls at the end of this reply.
    Is this in the same thread in the very next call?
    I replicated the problem by going through the Web container (5 clients) therefore WebLogic threads are used in this case. I see from the logs 4-5 different execute threads at work (ex. ExecuteThread: '10' for queue: 'weblogic.kernel.Default').
    Does it happen all the time?
    Although it is tough to tell for sure, once it starts happening it seems to happen most if not all the time.
    Is it an attempted re-use of the same statement, or trying to use a different statement?
    We do a connection.prepareStatement(QUERY_STRING) call everytime (there is only one per request/response cycle). I believe WLS caches statements behind the scenes though so I suspect at that level there is reuse. There is only one stored proc used (we vary the params per call).
    Please show me your pool definition from the config.xml
    file, and I will send you instructions to produce some
    debug info that will get us to the heart of this matter.
    <JDBCConnectionPool
    DriverName="weblogic.jdbc.sqlserver.SQLServerDriver"
    MaxCapacity="5" Name="THE POOL"
    PasswordEncrypted="XXX"
    Properties="user=XXX;portNumber=XXX;databaseName=XX;serverName=X.X.X.X"
    Targets="Server"
    TestConnectionsOnReserve="true" TestTableName="TEST_TABLE" URL="jdbc:bea:sqlserver://X.X.X.X:XXX"/>Ok, do these things:
    1 - Add our spy attribute to your pool definition, like this:
    <JDBCConnectionPool
    DriverName="weblogic.jdbc.sqlserver.SQLServerDriver"
    MaxCapacity="5" Name="THE POOL"
    PasswordEncrypted="XXX"
    Properties="user=XXX;portNumber=XXX;databaseName=XX;serverName=X.X.X.X"
    Targets="Server"
    TestConnectionsOnReserve="true"
    TestTableName="TEST_TABLE"
    URL="jdbc:bea:sqlserver://X.X.X.X:XXX;spyAttributes=(log=(file)spy.log;timestamp=yes)"/>
    2 - Edit the start-weblogic script to add the spy jar (wlspy.jar) to the
    classpath that the script creates for the server, eg:
    set CLASSPATH=%WL_HOME%\server\lib\wlspy.jar;%CLASSPATH%
    3 - Reboot and duplicate the problem as briefly as possible.
    4 - In the same directory where you start the server, you will
    now find a file named 'spy.log'. Please send it to me. ( j o e AT b e a DOT c o m )
    I will try to reproduce the problem.
    5 - Ask BEA support for the latest BEA driver package and install it according to
    their instructions. Let me know asap if the probem is still there.
    thanks
    Joe
    >
    Also, I forgot to post in the original message some of the WLS stdout related logging we see. Here it is (sorry, it's a little messy):
    11:38:37 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '11' for queue: 'weblogic.kernel.Default'> <> <BEA-001131> <Received an exception when closing a cached statement for the pool " THE POOL": java.sql.SQLException: [BEA][SQLServer JDBC Driver]The operation was cancelled at the user's request..>
    11:38:37 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '13' for queue: 'weblogic.kernel.Default'> <> <BEA-001131> <Received an exception when closing a cached statement for the pool " THE POOL": java.sql.SQLException: [BEA][SQLServer JDBC Driver]The operation was cancelled at the user's request..>
    11:38:37 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '10' for queue: 'weblogic.kernel.Default'> <> <BEA-001131> <Received an exception when closing a cached statement for the pool " THE POOL": java.sql.SQLException: [BEA][SQLServer JDBC Driver]The operation was cancelled at the user's request..>
    11:38:38 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <> <BEA-001112> <Test "select count(*) from TEST_TABLE" set up for pool " THE POOL" failed with exception: "java.sql.SQLException: [BEA][SQLServer JDBC Driver]A problem occurred when attempting to contact the server (Server returned: Connection reset). Please ensure that the server parameters passed to the driver are correct and that the server is running. Also ensure that the maximum number of connections
    have not been exceeded for this server.".>
    11:38:38 o'clock AM EST> <Info> <JDBC> <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <> <BEA-001128> <Connection for pool " THE POOL" closed.>
    11:38:38 o'clock AM EST> <Info> <JDBC> <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <> <BEA-001067> <Connection for pool " THE POOL" refreshed.>
    11:38:40 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '10' for queue: 'weblogic.kernel.Default'> <> <BEA-001112> <Test "select count(*) from TEST_TABLE" set up for pool " THE POOL" failed with exception: "java.sql.SQLException: [BEA][SQLServer JDBC Driver]A problem occurred when attempting to contact the server (Server returned: Connection reset). Please ensure that the server parameters passed to the driver are correct and that the server is running. Also ensure that the maximum number of connections
    have not been exceeded for this server.".>
    11:38:40 o'clock AM EST> <Info> <JDBC> <ExecuteThread: '10' for queue: 'weblogic.kernel.Default'> <> <BEA-001128> <Connection for pool " THE POOL" closed.>
    11:38:40 o'clock AM EST> <Info> <JDBC> <ExecuteThread: '10' for queue: 'weblogic.kernel.Default'> <> <BEA-001067> <Connection for pool " THE POOL" refreshed.>
    11:38:41 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '13' for queue: 'weblogic.kernel.Default'> <> <BEA-001131> <Received an exception when closing a cached statement for the pool " THE POOL": java.sql.SQLException: [BEA][SQLServer JDBC Driver]The operation was cancelled at the user's request..>
    11:38:41 o'clock AM EST> <Error> <JDBC> <ExecuteThread: '10' for queue: 'weblogic.kernel.Default'> <> <BEA-001131> <Received an exception when closing a cached statement for the pool " THE POOL": java.sql.SQLException: [BEA][SQLServer JDBC Driver]The operation was cancelled at the user's request..>
    Here is the sequence of calls we make (notice the statement is closed outside the finally however we assume the connection.close should close associated resources):
    PreparedStatement statement = null;
    try {
    connection = dataSource.getConnection();
    statement = connection.prepareStatement(QUERY_STRING);
    statement.setString(1, name1);
    statement.setString(2, name2);
    statement.setQueryTimeout(timeout);
    ResultSet resultSet = statement.executeQuery();     
    //iterate over result set
    statement.close();
    return result;               
    } catch (SQLException e1) {
    //log
    } finally {
    try {
    if(connection != null)
    connection.close();
    } catch (SQLException e2) {
    //log
    Thanks again,
    Mich

Maybe you are looking for

  • IPod no longer connecting to the car

    My iPod touch has stopped connecting to the car. It says it does not support this accessory, the car says no audio files. It has been fine for months. I have reset and restarted the iPod. I've tried my iPad with the car and that's still fine so it mu

  • No Recovery - Mountain Lion won't install but Lion Recovery worked (until Mountain Lion messed it up).

    When I tried to install Mountain Lion it gave me the "this disk does not support some features, like FileVault or Recovery Mode..." message.  However, my Lion install at that point had a working Recovery Partition (I confirmed it after I got this fir

  • In PowerPoint I Have Shockwave ActiveX Control - How do I Get Shockwave Flash Object?

    I'm running the latest versions of Windows 7 and PowerPoint via Parallels on my Mac. I want to insert a Flash movie into a PowerPoint slide. The instructions I've found tell me to look in Developer section->More Controls, find Shockwave Flash Object,

  • Add (+) clause in View Criteria

    Hi Everyone, I have a problem with a View Object. This is the query that I want to execute in my VO: SELECT * FROM DRG_VISIT_STEPS DrgVisitSteps, DRG_L_PROCESS_STEPS DrgLProcessSteps, DRG_VISIT_PROCESS_DEFS DrgVisitsProcessDef WHERE (DrgVisitSteps.PR

  • SC-PO-Confirmation

    Dear Expert, Anyone know how to link SC-PO-Confirmation using table?? Thanks and Regards, Yusup