Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] createEntityManager(properties) throws NullPointerException after successfull connection and login

Looks like a bug in 1.1.1.  Looking at the code it was fixed in the 2.0
stream, not sure if it is in 1.1.2 as well.  You can either upgrade to a 2.0
build, or log a bug on 1.1.  I think if you set a new DataSouce name in the
properties it will not occur.



Otzoup wrote:
> 
> Hello,
> 
> we user createEntityManagerFactory with username/password set as
> properties:
> 
> 	        properties.put(PersistenceUnitProperties.JDBC_USER, args[0]);
> 	        properties.put(PersistenceUnitProperties.JDBC_PASSWORD, args[1]);
> 	        
> 	        emf = provider.createEntityManagerFactory("tup_pu",properties);
> 
> Followed by createEntityManager WITHOUT properties:
> 
> 	        em = emf.createEntityManager();	
> 
> THAT's WORKING FINE !!!
> 
> 
> The next step is passing the properties to createEntityManager instead of
> creating it without properties:
> 	        
> 	        em = emf.createEntityManager(properties);
> 
> Connection and login are performed (see log excerpt below) successfully -
> but within the createEntityManager-Method a NullPointerException is
> raised.
> 
> 
> Any idea why connection and login work followed by a NullPointerException
> ??
> 
> 
> 
> Attentamente,
> Martin Kubitza
> 
> 
> PS-1: We use a Session-Customizer-Class but its properties are evaluated
> correctly (e.g. number of connections, here: 2)
> PS-2: We use Eclipselink v1.1.1 
> 
> 
> LOG-excerpt:
> 
> [EL Info]: 2009-07-21
> 14:35:08.343--ServerSession(1535718)--Thread(Thread[9936743@qtp-30284778-1,5,main])--EclipseLink,
> version: Eclipse Persistence Services - 1.1.2.v20090612-r4475
> [EL Config]: 2009-07-21
> 14:35:08.359--ServerSession(1535718)--Connection(13996454)--Thread(Thread[9936743@qtp-30284778-1,5,main])--connecting(DatabaseLogin(
> 	platform=>Oracle10Platform
> 	user name=> "lisa10_auftrag_mku"
> 	datasource URL=> "jdbc:oracle:thin:@verleihnix:1521:lxxl"
> ))
> [EL Config]: 2009-07-21
> 14:35:08.718--ServerSession(1535718)--Connection(33522601)--Thread(Thread[9936743@qtp-30284778-1,5,main])--Connected:
> jdbc:oracle:thin:@verleihnix:1521:lxxl
> 	User: LISA10_AUFTRAG_MKU
> 	Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release
> 10.2.0.2.0 - Production
> With the OLAP and Data Mining options
> 	Driver: Oracle JDBC driver  Version: 10.1.0.4.2
> [EL Config]: 2009-07-21
> 14:35:08.718--ServerSession(1535718)--Connection(1899900)--Thread(Thread[9936743@qtp-30284778-1,5,main])--connecting(DatabaseLogin(
> 	platform=>Oracle10Platform
> 	user name=> "lisa10_auftrag_mku"
> 	datasource URL=> "jdbc:oracle:thin:@verleihnix:1521:lxxl"
> ))
> [EL Config]: 2009-07-21
> 14:35:08.781--ServerSession(1535718)--Connection(22852149)--Thread(Thread[9936743@qtp-30284778-1,5,main])--Connected:
> jdbc:oracle:thin:@verleihnix:1521:lxxl
> 	User: LISA10_AUFTRAG_MKU
> 	Database: Oracle  Version: Oracle Database 10g Enterprise Edition Release
> 10.2.0.2.0 - Production
> With the OLAP and Data Mining options
> 	Driver: Oracle JDBC driver  Version: 10.1.0.4.2
> [EL Info]: 2009-07-21
> 14:35:09.046--ServerSession(1535718)--Thread(Thread[9936743@qtp-30284778-1,5,main])--bundleresource://23/-tup_pu
> login successful
> java.lang.NullPointerException
> 	at
> org.eclipse.persistence.internal.jpa.EntityManagerImpl.processConnectionPolicyProperties(EntityManagerImpl.java:1545)
> 	at
> org.eclipse.persistence.internal.jpa.EntityManagerImpl.processProperties(EntityManagerImpl.java:1349)
> 	at
> org.eclipse.persistence.internal.jpa.EntityManagerImpl.initialize(EntityManagerImpl.java:202)
> 	at
> org.eclipse.persistence.internal.jpa.EntityManagerImpl.<init>(EntityManagerImpl.java:190)
> 	at
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:173)
> 	at
> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:158)
> 	at
> com.tp.server.persistence.internal.TransactionManagerBean.buildConnection(TransactionManagerBean.java:74)
> 	at
> com.tp.server.persistence.internal.TransactionManagerBean$$FastClassByCGLIB$$d216f03b.invoke(<generated>)
> 	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> 	at
> org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
> 	at
> com.tp.server.persistence.internal.TransactionManagerBean$$EnhancerByCGLIB$$47f1b8a0.buildConnection(<generated>)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> 	at
> org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
> 	at
> org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
> 	at
> org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> 	at $Proxy10.buildConnection(Unknown Source)
> 	at
> com.tp.server.lisa.core.internal.DomainValuesSessionBean.buildConnection(DomainValuesSessionBean.java:76)
> 	at
> com.tp.server.lisa.core.internal.DomainValuesSessionBean$$FastClassByCGLIB$$d5b14c61.invoke(<generated>)
> 	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> 	at
> org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
> 	at
> org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
> 	at
> com.tp.server.lisa.core.internal.DomainValuesSessionBean$$EnhancerByCGLIB$$81260f72.buildConnection(<generated>)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> 	at
> org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> 	at $Proxy12.buildConnection(Unknown Source)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
> 	at
> org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
> 	at
> org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
> 	at
> org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
> 	at
> org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)
> 	at
> org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
> 	at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
> 	at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
> 	at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
> 	at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 	at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
> 	at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
> 	at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 	at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:311)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> 	at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
> 	at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> 	at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
> 	at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> 	at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/createEntityManager%28properties%29-throws-NullPointerException-after-successfull-connection-and-login-tp24587403p24700083.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top