-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Need help - Error when loading an Object equal to null
PostPosted: Wed Jan 26, 2005 9:49 am 
Beginner
Beginner

Joined: Fri Jan 07, 2005 2:47 pm
Posts: 45
My question:

I need to load data through a request object. The request object initialiaze other objects like practitioner object. My problem is if the pratictioner is null I got this error (java.lang.NullPointerExceptionntestLoadUserDetail: java.lang.NullPointerException) explain below if the pratictioner contains data, the data is loaded as it should be.

The only way I can handle that matter is if I control the object issue with a if else condition (see code below in the FollowupTest.java.

How can I control this problem if I am using this method proposed by the Hibernate CaveatEmptor (public Object getItemById(String id, boolean lock) throws Infrast...) Full method is described below?

Hope this time my question contains all needed details.

thanks


Hibernate version:
Hibernate2

Mapping documents:

Partial code of my main class:
mport SAP.Utility.InfrastructureException;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import SAP.BusinessObjects.DrugProduct.DrugSpecification;
import SAP.DAOObjects.RequestDAO;

public class Request {
private int id;
private int RequestID;
private String textid;
private String priority;
private String poNumber;
private DrugSpecification drugSpecification = new DrugSpecification();
private DrugSpecification clonedSpecification = new DrugSpecification();
private Site site = new Site();
private Set patients= new HashSet();
private Patient patient = new Patient();
private User practitioner = new User();
private RequestDAO requestDAO= new RequestDAO();


// ***METHODS**************************************************
public Request getItemById(String id, boolean lock) throws InfrastructureException {
//Load a Request based on it's id
return (Request) requestDAO.getItemById(id, lock);
}
public DrugSpecification getDrugSpecification() {
return drugSpecification;
}

public void setDrugSpecification(DrugSpecification drugSpecification) {
this.drugSpecification= drugSpecification;
}
public User getPractitioner() {
return practitioner;
}
public void setPractitioner(User practitioner) {
this.practitioner= practitioner;
}

Partial code of the practitioner class (user class)

package SAP.BusinessObjects;


import SAP.DAOObjects.UserDAO;
import SAP.Utility.CalendarUtil;
import Security.PasswordValidation;
import Security.SecurityServices;
import Security.LoginException;
import java.util.*;

public class User {
private String userid;
private int userRoleID;
private String firstname;
private String lastname;
private String middlename;
private String title;
private String description;
private String licence;
private String languagePreference;
private Date currentdate;
private Address address;
private Site site;
private Password pswd;
private boolean active;
private boolean authenticated;
private boolean isExist;
private boolean isRepeated;
private UserDAO dao;
//private PasswordValidation validpassword;

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;
}
Code between sessionFactory.openSession() and session.close():

public Object getItemById(String id, boolean lock) throws InfrastructureException {
Session session= HibernateUtil.getSession();
Request Request= null;
try {
if (lock) {
Request= (Request) session.load(Request.class, id, LockMode.UPGRADE);
} else {
Request= (Request) session.load(Request.class, id);
}
HibernateUtil.commitTransaction();
} catch (HibernateException ex) {
System.out.println(errorString + ".GetItemByID: " + ex);
throw new InfrastructureException(ex);
} finally {
HibernateUtil.closeSession();
}
return Request;
}

To test my function I am using Junit. Here is the code:

import SAP.BusinessObjects.Request;

public class FollowUpTest extends TestCase {

public FollowUpTest(String arg0) {
super(arg0);
}

public void testLoadRequestById() throws Exception{

try {
Request request = new Request();
request = request.getItemById("2004-09-29--65_1", false);
System.out.println("\n\ntestLoadUserDetail");
//System.out.println(request.toString());
//System.out.println(request.getPoNumber());
if (request.getPractitioner()!=null){
System.out.println(request.getPractitioner ().getDescription().toString());
System.out.println(request.getPractitioner().getAddress().getPhone().toString());
System.out.println(request.getPractitioner().getAddress().getFax().toString());
}
if (request.getSite()!=null){
System.out.println(request.getSite().getSitename().toString());
System.out.println(request.getSite().getAddress().getAddress1());
System.out.println(request.getSite().getAddress().getAddress2());
System.out.println(request.getSite().getAddress().getCity());
System.out.println(request.getSite().getAddress().getProvinceID());
System.out.println(request.getSite().getAddress().getPostalCode());
System.out.println(request.getSite().getContactname());
System.out.println(request.getSite().getAddress().getPhone().toString());
System.out.println(request.getSite().getAddress().getFax().toString());
}
System.out.println('\n');

} catch (Exception ex) {
System.out.println(ex + "ntestLoadUserDetail: " + ex);
throw new Exception(ex);
} finally {
//save to db
//HibernateUtil.closeSession();
}
}

My xml file:

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping >

<class name="SAP.BusinessObjects.Request"
table="SAMPLES">

<id name="textid"
type="java.lang.String"
column="TEXT_ID"
length="30">
<generator class="SAP.DAOObjects.SeqGeneratorDrug"/>
</id>

<property name="priority"
type="java.lang.String"
length="50"
column="PRIORITY"/>

<property name="poNumber"
type="java.lang.String"
length="50"
column="X_MFG_PO"/>

<many-to-one name="practitioner"
class="SAP.BusinessObjects.User"
column= "X_REQ_ID" />


<component name="site" class="SAP.BusinessObjects.Site">
<property name="sitename"
type="java.lang.String"
length="20"
not-null="false"
column="X_REQ_COMPANY"/>
<property name="contactname"
type="java.lang.String"
length="50"
column="X_REQ_CONTACT"/>

<component name="address" class="SAP.BusinessObjects.Address">
<property name="Address1"
type="java.lang.String"
length="50"
column="X_REQ_ADDRESS1"/>
<property name="Address2"
type="java.lang.String"
length="50"
column="X_REQ_ADDRESS2"/>
<property name="City"
type="java.lang.String"
length="50"
column="X_REQ_CITY"/>
<property name="provinceID"
type="java.lang.String"
length="50"
column="X_REQ_PROVINCE"/>
<property name="PostalCode"
type="java.lang.String"
length="50"
column="X_REQ_POSTCODE"/>
<property name="Phone"
type="java.lang.String"
length="18"
column="X_REQ_PHONE"/>
<property name="Fax"
type="java.lang.String"
length="18"
column="X_REQ_FAX"/>
</component>

</component>

<component name="drugSpecification" class="SAP.BusinessObjects.DrugProduct.DrugSpecification">


<component name="drug" class="SAP.BusinessObjects.DrugProduct.Drug">
<property name="tradeName"
type="java.lang.String"
length="50"
column="X_DRUG_BRAND_NAME"/>

</component>

<component name="manufacturer" class="SAP.BusinessObjects.DrugProduct.Manufacturer">
<property name="name"
type="java.lang.String"
length="254"
column="X_MFG_NAME"/>

</component>

<component name="admroute" class="SAP.BusinessObjects.DrugProduct.RouteOfAdministration">
<property name="frenchName"
type="java.lang.String"
length="50"
column="X_DRUG_ROUTE"/>

</component>

<component name="phform" class="SAP.BusinessObjects.DrugProduct.PharmeceuticalForm">
<property name="englishName"
type="java.lang.String"
length="50"
column="X_DRUG_FORM"/>
</component>
</component>



</class>

</hibernate-mapping>

Full stack trace of any exception that occurs:

Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.6
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.max_fetch_depth=1, hibernate.cglib.use_reflection_optimizer=true, hibernate.jdbc.use_streams_for_binary=true, hibernate.connection.pool_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'}
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\Patient.hbm.xml
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.Patient -> SAR_PATIENT
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\Drug.hbm.xml
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.Drug -> DRUG
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\Manufacturer.hbm.xml
Jan 26, 2005 8:21:42 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.Manufacturer -> DRUG_MANUFACTURER
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\DrugSpecification.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.DrugSpecification -> DRUG_SPECIFICATION
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\PharmeceuticalForm.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.PharmeceuticalForm -> DRUG_FORM
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\RouteOfAdministration.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.RouteOfAdministration -> DRUG_ROUTE
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\DrugStrength.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.DrugStrength -> DRUG_STRENGTH
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\DrugConcentration.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.DrugConcentration -> DRUG_CONCENTRATION
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\DrugProduct\DrugIndication.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.DrugProduct.DrugIndication -> DRUG_INDICATION
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\User.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.User -> X_REQUESTORS
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\Site.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.Site -> X_SITES
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\Password.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.Password -> PASSWORD_HISTORYS
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\TextList.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.TextList -> LIST_ENTRYS
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: SAP\BusinessObjects\SAR.hbm.xml
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: SAP.BusinessObjects.Request -> SAMPLES
Jan 26, 2005 8:21:43 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.Site, InvocationTargetException: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.Drug, InvocationTargetException: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.Manufacturer, InvocationTargetException: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.RouteOfAdministration, InvocationTargetException: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.PharmeceuticalForm, InvocationTargetException: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.DrugSpecification, InvocationTargetException: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: SAP.BusinessObjects.DrugProduct.Drug.specifications -> DRUG_SPECIFICATION
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Jan 26, 2005 8:21:43 AM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.Oracle9Dialect
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximim outer join fetch depth: 1
Jan 26, 2005 8:21:43 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: true
Jan 26, 2005 8:21:43 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Jan 26, 2005 8:21:43 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 0
Jan 26, 2005 8:21:43 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@oimt_oracle_dev:1526:dev1
Jan 26, 2005 8:21:43 AM net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=sapadm, password=fidsap}
Jan 26, 2005 8:21:43 AM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: echoing all SQL to stdout
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
Jan 26, 2005 8:21:44 AM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Jan 26, 2005 8:21:44 AM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.Drug, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.DrugConcentration, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.Patient, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.TextList, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.DrugSpecification, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.Manufacturer, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.RouteOfAdministration, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.Site, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.PharmeceuticalForm, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.DrugIndication, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.Request, InvocationTargetException: null
Jan 26, 2005 8:21:44 AM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: SAP.BusinessObjects.DrugProduct.DrugStrength, InvocationTargetException: null
Jan 26, 2005 8:21:45 AM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Hibernate: select request0_.TEXT_ID as TEXT_ID1_, request0_.PRIORITY as PRIORITY1_, request0_.X_MFG_PO as X_MFG_PO1_, request0_.X_REQ_ID as X_REQ_ID1_, request0_.X_REQ_COMPANY as X_REQ_CO5_1_, request0_.X_REQ_CONTACT as X_REQ_CO6_1_, request0_.X_REQ_ADDRESS1 as X_REQ_AD7_1_, request0_.X_REQ_ADDRESS2 as X_REQ_AD8_1_, request0_.X_REQ_CITY as X_REQ_CITY1_, request0_.X_REQ_PROVINCE as X_REQ_P10_1_, request0_.X_REQ_POSTCODE as X_REQ_P11_1_, request0_.X_REQ_PHONE as X_REQ_P12_1_, request0_.X_REQ_FAX as X_REQ_FAX1_, request0_.X_DRUG_BRAND_NAME as X_DRUG_14_1_, request0_.X_MFG_NAME as X_MFG_NAME1_, request0_.X_DRUG_ROUTE as X_DRUG_16_1_, request0_.X_DRUG_FORM as X_DRUG_17_1_, user1_.REQ_ID as REQ_ID0_, user1_.LAST_NAME as LAST_NAME0_, user1_.DESCRIPTION as DESCRIPT3_0_, user1_.FIRST_NAME as FIRST_NAME0_, user1_.MIDDLE_NAME as MIDDLE_N5_0_, user1_.TITLE as TITLE0_, user1_.CHANGED_ON as CHANGED_ON0_, user1_.ACTIVE as ACTIVE0_, user1_.PSWD as PSWD0_, user1_.SALT as SALT0_, user1_.USERNAME as USERNAME0_, user1_.EXPIRED as EXPIRED0_, user1_.PHONE as PHONE0_, user1_.FAX as FAX0_, user1_.EMAIL as EMAIL0_, user1_.PRIM_LOC as PRIM_LOC0_ from SAMPLES request0_ left outer join X_REQUESTORS user1_ on request0_.X_REQ_ID=user1_.REQ_ID where request0_.TEXT_ID=?


testLoadUserDetail
java.lang.NullPointerExceptionntestLoadUserDetail: java.lang.NullPointerException



Name and version of the database you are using:
Oracle9

The generated SQL (show_sql=true):
Yes here is the sql generated by hibernate

Hibernate: select request0_.TEXT_ID as TEXT_ID1_, request0_.PRIORITY as PRIORITY1_, request0_.X_MFG_PO as X_MFG_PO1_, request0_.X_REQ_ID as X_REQ_ID1_, request0_.X_REQ_COMPANY as X_REQ_CO5_1_, request0_.X_REQ_CONTACT as X_REQ_CO6_1_, request0_.X_REQ_ADDRESS1 as X_REQ_AD7_1_, request0_.X_REQ_ADDRESS2 as X_REQ_AD8_1_, request0_.X_REQ_CITY as X_REQ_CITY1_, request0_.X_REQ_PROVINCE as X_REQ_P10_1_, request0_.X_REQ_POSTCODE as X_REQ_P11_1_, request0_.X_REQ_PHONE as X_REQ_P12_1_, request0_.X_REQ_FAX as X_REQ_FAX1_, request0_.X_DRUG_BRAND_NAME as X_DRUG_14_1_, request0_.X_MFG_NAME as X_MFG_NAME1_, request0_.X_DRUG_ROUTE as X_DRUG_16_1_, request0_.X_DRUG_FORM as X_DRUG_17_1_, user1_.REQ_ID as REQ_ID0_, user1_.LAST_NAME as LAST_NAME0_, user1_.DESCRIPTION as DESCRIPT3_0_, user1_.FIRST_NAME as FIRST_NAME0_, user1_.MIDDLE_NAME as MIDDLE_N5_0_, user1_.TITLE as TITLE0_, user1_.CHANGED_ON as CHANGED_ON0_, user1_.ACTIVE as ACTIVE0_, user1_.PSWD as PSWD0_, user1_.SALT as SALT0_, user1_.USERNAME as USERNAME0_, user1_.EXPIRED as EXPIRED0_, user1_.PHONE as PHONE0_, user1_.FAX as FAX0_, user1_.EMAIL as EMAIL0_, user1_.PRIM_LOC as PRIM_LOC0_ from SAMPLES request0_ left outer join X_REQUESTORS user1_ on request0_.X_REQ_ID=user1_.REQ_ID where request0_.TEXT_ID=?


Debug level Hibernate log excerpt:
java.lang.NullPointerExceptionntestLoadUserDetail: java.lang.NullPointerException

This exception is cause by the fact that the practioner object is equal to null.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.