-->
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: NullPointerException in Websphere
PostPosted: Wed Feb 16, 2005 6:23 am 
Beginner
Beginner

Joined: Tue Feb 15, 2005 8:14 am
Posts: 32
Hibernate version:

2.1

Mapping documents:

<?xml version="1.0" encoding="UTF-8"?>

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

<hibernate-mapping
>
<class
name="dk.te.deb.pojo.Team"
table="TEAM"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>

<id
name="team_id"
column="TEAM_ID"
type="java.lang.Long"
>
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Team.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<set
name="players"
table="Player"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="unsorted"
>

<key
column="TEAM_ID"
>
</key>

<one-to-many
class="dk.te.deb.pojo.Player"
/>

</set>

<property
name="city"
type="string"
update="true"
insert="true"
access="property"
column="CITY"
length="20"
not-null="false"
unique="false"
/>

<property
name="team_name"
type="string"
update="true"
insert="true"
access="property"
column="TEAM_NAME"
length="20"
not-null="false"
unique="false"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Team.xml
containing the additional properties and place it in your merge dir.
-->

</class>

<query name="findIdByTeamName"><![CDATA[
select team.team_id from dk.te.deb.pojo.Team team where team.team_name = :teamName
]]></query>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Query query = session.getNamedQuery("findIdByTeamName");
if (query != null) {
query.setString("teamName", teamName);
System.out.println("QueryString = " + query.getQueryString());
list = query.list();
size = list.size();
}

Full stack trace of any exception that occurs:

[16-02-05 11:05:25:374 CET] 5bc26e12 SystemOut O QueryString =
select team.team_id from dk.te.deb.pojo.Team team where team.team_name = :teamName

[16-02-05 11:05:25:374 CET] 5bc26e12 SystemOut O Hibernate: select team0_.TEAM_ID as x0_0_ from TEAM team0_ where (team0_.TEAM_NAME=? )
[16-02-05 11:05:25:384 CET] 5bc26e12 SecretServlet E dk.te.deb.servlets.SecretServlet Could not get players for team Angels
[16-02-05 11:05:25:384 CET] 5bc26e12 SecretServlet E dk.te.deb.servlets.SecretServlet TRAS0014I: The following exception was logged java.lang.NullPointerException
at java.io.File.getPath(File.java(Inlined Compiled Code))
at com.ibm.ws.classloader.SinglePathClassProvider.getRealResourcePath(SinglePathClassProvider.java(Compiled Code))
at com.ibm.ws.classloader.SinglePathClassProvider$1.run(SinglePathClassProvider.java(Compiled Code))
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.classloader.SinglePathClassProvider.getClassBytesFromDir(SinglePathClassProvider.java(Inlined Compiled Code))
at com.ibm.ws.classloader.SinglePathClassProvider.getClassBytes(SinglePathClassProvider.java(Inlined Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.initParameterVariables(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.prepareStatement(Unknown Source)
at com.ibm.ws.rsadapter.spi.WSStatementCache.reallyPrepareStatement(WSStatementCache.java:360)
at com.ibm.ws.rsadapter.spi.WSStatementCache.getPreparedStatement(WSStatementCache.java:145)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.getPreparedStatement(WSRdbManagedConnectionImpl.java:1157)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatementCommon(WSJdbcConnection.java:1414)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:1363)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:263)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:236)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:67)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:784)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
at net.sf.hibernate.loader.Loader.list(Loader.java:1054)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
at dk.te.deb.servlets.SecretServlet.doPost(SecretServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:187)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))


Name and version of the database you are using:

DB2 version 8.2

The generated SQL (show_sql=true):



Debug level Hibernate log excerpt:


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.