-->
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.  [ 5 posts ] 
Author Message
 Post subject: null after lookup in jboss4.0.2
PostPosted: Tue May 17, 2005 7:45 am 
Newbie

Joined: Mon May 16, 2005 2:55 am
Posts: 6
Hi,
I am getting the simiklar kind of error. Can anybody help me in this?

java.lang.NullPointerException
at org.jboss.hibernate.session.HibernateContext.getSession(HibernateContext.java:79)
at login.ConnectionFactory.getSession(ConnectionFactory.java:45)
at login.ItemService.addUser(ItemService.java:77)
at login.LoginAction.execute(LoginAction.java:37)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

The above error i am getting . I tried the same suing Initialcontext also
Which is also giving the same error.

And also I found this log message before above error
16:58:49,187 WARN [SessionFactoryObjectFactory] Not found: 4028810903ea680b0103ea680fb00000


But when deploying which is giving the following success message

16:56:58,000 INFO [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/SessionFactory]

It seemz JNDI name is not lookup to the SessionFactory .

Can anybody help me in this . how to processed.

Vasu...


Top
 Profile  
 
 Post subject: null after lookup in jboss4.0.2
PostPosted: Tue May 17, 2005 12:32 pm 
Newbie

Joined: Mon May 16, 2005 2:55 am
Posts: 6
Hi ,
I am providing some detailed information on the same issue.


The following is the log messag which i got . Can anyone helps me
In this issue?

I am giving my Folder structure here.

My ear file contans

1)cdviewer.war
2)cdviewer.har
3)jboss-app.xml
4)application.xml

My ear file doesn't have any ejbs.

The following is the code i am using to get sessionfactory.

InitialContext ctx= new InitialContext();
SessionFactory sessionFactory=(SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
System.out.println("sessionFactory :===============>"+sessionFactory);

Anyone please help me . What could be the problem? I guess SessionFactory is not binding with jndi. But while deploying which gave
the following message .

INFO [SessionFactoryImpl] Checking 0 named queries
INFO [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/SessionFactory]



Vasu.



21:40:33,703 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 9.2.0.5.0
21:40:33,781 INFO [Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
21:40:33,968 INFO [SettingsFactory] JDBC batch size: 15
21:40:33,968 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
21:40:33,984 INFO [SettingsFactory] Scrollable result sets: enabled
21:40:33,984 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
21:40:33,984 INFO [SettingsFactory] Aggressive release : enabled
21:40:33,984 INFO [SettingsFactory] Default batch fetch size: 1
21:40:33,984 INFO [SettingsFactory] Generate SQL with comments: disabled
21:40:33,984 INFO [SettingsFactory] Order SQL updates by primary key: disabled
21:40:34,000 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
21:40:34,015 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
21:40:34,015 INFO [SettingsFactory] Query language substitutions: {}
21:40:34,015 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JTATransactionFactory
21:40:34,046 INFO [NamingHelper] JNDI InitialContext properties:{}
21:40:34,062 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransa
21:40:34,078 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
21:40:34,078 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransa
21:40:34,093 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
21:40:34,093 INFO [SettingsFactory] Automatic flush during beforeCompletion(): enabled
21:40:34,093 INFO [SettingsFactory] Automatic session close at end of transaction: enabled
21:40:34,093 INFO [SettingsFactory] Second-level cache: enabled
21:40:34,093 INFO [SettingsFactory] Query cache: disabled
21:40:34,093 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
21:40:34,109 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
21:40:34,140 INFO [SettingsFactory] Structured second-level cache entries: enabled
21:40:34,156 INFO [SettingsFactory] Echoing all SQL to stdout
21:40:34,156 INFO [SettingsFactory] Statistics: disabled
21:40:34,156 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
21:40:34,171 INFO [SettingsFactory] Default entity-mode: pojo
21:40:34,734 INFO [SessionFactoryImpl] building session factory
21:40:35,812 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
21:40:35,859 INFO [NamingHelper] JNDI InitialContext properties:{}
21:40:35,859 INFO [SessionFactoryImpl] Checking 0 named queries
21:40:35,859 INFO [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/SessionFactory]
21:40:35,906 INFO [TomcatDeployer] deploy, ctxPath=/cdviewer, warUrl=file:/D:/jboss-4.0.2/server/default/tmp/deploy/tmp4990cdview
21:40:38,359 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
21:40:38,359 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
21:40:39,687 INFO [PropertyMessageResources] Initializing, config='MessageResources', returnNull=true
21:40:39,828 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validator-rules.xml'
21:40:40,359 INFO [ValidatorPlugIn] Loading validation rules file from '/WEB-INF/validation.xml'
21:40:40,562 INFO [EARDeployer] Started J2EE application: file:/D:/jboss-4.0.2/server/default/deploy/cdviewer.ear
21:40:40,875 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
21:40:41,062 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
21:40:41,234 INFO [JkMain] Jk running ID=0 time=0/203 config=null
21:40:41,250 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 2m:2s:672ms
21:41:43,609 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
21:41:43,734 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
21:41:43,796 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
21:41:43,906 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
21:41:44,031 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnNull=true
21:41:44,328 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
21:41:44,328 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
21:41:44,406 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
21:41:52,312 INFO [STDOUT] Get CurrentDate :
21:41:52,328 INFO [STDOUT] Get CurrentDate Time Stamp :2005-05-17 21:41:52.312
21:41:52,640 WARN [SessionFactoryObjectFactory] Not found: 4028810903eb6bb60103eb6bbb850000
21:41:52,640 INFO [STDOUT] sessionFactory :===============>null
21:41:52,671 WARN [RequestProcessor] Unhandled Exception thrown: class java.lang.NullPointerException
21:41:52,671 ERROR [[action]] Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at login.ConnectionFactory.getSession(ConnectionFactory.java:61)
at login.ItemService.addUser(ItemService.java:77)
at login.LoginAction.execute(LoginAction.java:37)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 7:39 am 
Newbie

Joined: Thu Aug 11, 2005 6:56 am
Posts: 9
See if the answer on http://www.jboss.org/index.html?module= ... 15#3881015 helps.

That solved the problem for me. I Accidently had included "hibernate3.jar" in /WEB_INF/lib" in my .war-file.

When I removed it, the lookup was successful.

Mads


Top
 Profile  
 
 Post subject: Post subject: null after lookup in jboss4.0.2
PostPosted: Thu Aug 18, 2005 3:06 am 
Newbie

Joined: Mon May 16, 2005 2:55 am
Posts: 6
Hi ,

The mistake you have done might be the hibernate.jar file . Please check

the hibernate.jar file version.


Regards

vasu.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 08, 2006 9:31 am 
Newbie

Joined: Tue Jul 12, 2005 9:04 am
Posts: 13
madsaa wrote:
See if the answer on http://www.jboss.org/index.html?module= ... 15#3881015 helps.

That solved the problem for me. I Accidently had included "hibernate3.jar" in /WEB_INF/lib" in my .war-file.

When I removed it, the lookup was successful.

Mads


Wonderful! This solve my problem! When i removed this package of my WEB-INF/lib my application is ok :)
Ty

_________________
Elton Kuzniewski
http://www.eltonk.com.br


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.