Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Re sourceBundle error

Hi, thanks for the replies. I found the problem. It's not a bug.
I write a Servlet to load the Bundle and get the ClassLoader

......
@Override
	public void init(ServletConfig config) throws ServletException
	{
		ClassLoader classLoader =
ExceptionMessageGenerator.class.getClassLoader();
		log.info("EclipseLink ClassLoader - " + classLoader + " -");
		ResourceBundle resourceBundle =
ResourceBundle.getBundle("org.eclipse.persistence.exceptions.i18n.ExceptionResource",
				Locale.getDefault(), ExceptionMessageGenerator.class.getClassLoader());
		log.info("EclipseLink ResourceBundle - " + resourceBundle + " -");
	}
.....

just to remove the Spring variable.

The problem was the location of the EclipseLink jar. It was located in the
endorsed directory, not in the lib directory (I have many applications using
EclipseLink, so I don't include the library in the war).
With the jar in the lib directory it works fine.
Thanks for the help.



tware wrote:
> 
> This appears to be a bug. (although I am not sure if it is in EclipseLink
> or in 
> your server.)
> 
> The call that causes the problem is:
> 
>              bundle = 
> ResourceBundle.getBundle("org.eclipse.persistence.exceptions.i18n.ExceptionResource", 
> Locale.getDefault(), ExceptionMessageGenerator.class.getClassLoader());
> 
> 
> It appears ExceptionMessageGenerator.class.getClassLoader() is returning
> null.
> 
> -Tom
> 
> aledbf wrote:
>> Hi, I'm having problems with the message error extraction.
>> Here are two examples: the first is because a mandatory field is missing
>> (USER_FK) and the secons is related to a bad formed named query.
>> 
>> Java: jdk 1.6.20
>> OS: OSX 10.6 and  Ubuntu 10.04
>> Server: Apache Tomcat 6.0.29 and 7.0.2
>> Framework: Spring Framework 3.0.4, EclipseLink 2.1.1 (libraries from
>> Maven
>> repositories)
>> 
>> 
>> [EL Finest]: 2010-09-22
>> 13:13:28.759--UnitOfWork(1296450955)--Thread(Thread[http-8080-exec-1,5,main])--Execute
>> query InsertObjectQuery(cl.PluginAsincrono@97067d53)
>> [EL Finest]: 2010-09-22
>> 13:13:28.759--UnitOfWork(1296450955)--Thread(Thread[http-8080-exec-1,5,main])--Execute
>> query ValueReadQuery(sql="SELECT NOW()")
>> [EL Finer]: 2010-09-22
>> 13:13:28.759--ClientSession(2132512504)--Connection(1783069945)--Thread(Thread[http-8080-exec-1,5,main])--Begin
>> batch statements
>> [EL Fine]: 2010-09-22
>> 13:13:28.759--ClientSession(2132512504)--Connection(1783069945)--Thread(Thread[http-8080-exec-1,5,main])--INSERT
>> INTO PLUGIN_ASINCRONO (ID_PK, ENABLED, VERSION, USER_FK) VALUES (?, ?, ?,
>> ?)
>> [EL Fine]: 2010-09-22
>> 13:13:28.759--ClientSession(2132512504)--Connection(1783069945)--Thread(Thread[http-8080-exec-1,5,main])--
>> bind => [e2d982ef-6bfc-4ddc-b3a8-b7437a7792de, true, 1, null]
>> [EL Finer]: 2010-09-22
>> 13:13:28.76--ClientSession(2132512504)--Connection(1783069945)--Thread(Thread[http-8080-exec-1,5,main])--End
>> Batch Statements
>> [EL Finest]: 2010-09-22
>> 13:13:28.76--ClientSession(2132512504)--Thread(Thread[http-8080-exec-1,5,main])--reconnecting
>> to external connection pool
>> [EL Fine]: 2010-09-22
>> 13:13:28.772--ClientSession(2132512504)--Thread(Thread[http-8080-exec-1,5,main])--SELECT
>> 1
>> [EL Warning]: 2010-09-22
>> 13:13:58.165--UnitOfWork(1296450955)--Thread(Thread[http-8080-exec-1,5,main])--[EL
>> Warning]: 2010-09-22
>> 13:14:04.547--UnitOfWork(1296450955)--Thread(Thread[http-8080-exec-1,5,main])--java.lang.NullPointerException
>> 	at java.util.ResourceBundle.getBundle(ResourceBundle.java:950)
>> 	at
>> org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.getHeader(ExceptionMessageGenerator.java:95)
>> 	at
>> org.eclipse.persistence.exceptions.EclipseLinkException.printStackTrace(EclipseLinkException.java:165)
>> 	at
>> org.eclipse.persistence.logging.DefaultSessionLog.log(DefaultSessionLog.java:150)
>> 	at
>> org.eclipse.persistence.internal.sessions.AbstractSession.log(AbstractSession.java:2653)
>> 	at
>> org.eclipse.persistence.internal.sessions.AbstractSession.logThrowable(AbstractSession.java:3827)
>> 	at
>> org.eclipse.persistence.internal.sessions.AbstractSession.handleException(AbstractSession.java:2298)
>> 	at
>> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1378)
>> 	at
>> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1273)
>> 	at
>> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1233)
>> 	at
>> org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.getTimestampFromServer(DatasourcePlatform.java:292)
>> 	at
>> org.eclipse.persistence.history.HistoryPolicy.getCurrentTime(HistoryPolicy.java:162)
>> 	at
>> org.eclipse.persistence.history.HistoryPolicy.logicalInsert(HistoryPolicy.java:734)
>> 
>> 
>> java.lang.NullPointerException: null
>> 	at java.util.ResourceBundle.getBundle(ResourceBundle.java:950)
>> ~[na:1.6.0_20]
>> 	at
>> org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:47)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.eclipse.persistence.exceptions.TransactionException.errorGettingExternalTransaction(TransactionException.java:63)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.eclipse.persistence.transaction.AbstractTransactionController.getTransaction(AbstractTransactionController.java:211)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.eclipse.persistence.internal.jpa.transaction.JTATransactionWrapper.setRollbackOnlyInternal(JTATransactionWrapper.java:76)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.eclipse.persistence.internal.jpa.EntityManagerImpl.setRollbackOnly(EntityManagerImpl.java:1706)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.eclipse.persistence.internal.jpa.EJBQueryImpl.setRollbackOnly(EJBQueryImpl.java:1242)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:718)
>> ~[na:2.1.1.v20100817-r8050]
>> 	at
>> org.springframework.orm.jpa.JpaTemplate$9.doInJpa(JpaTemplate.java:315)
>> ~[spring-orm-3.0.4.RELEASE.jar:3.0.4.RELEASE]
>> 	at org.springframework.orm.jpa.JpaTemplate$9.doInJpa(JpaTemplate.java:1)
>> ~[spring-orm-3.0.4.RELEASE.jar:3.0.4.RELEASE]
>> 	at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
>> ~[spring-orm-3.0.4.RELEASE.jar:3.0.4.RELEASE]
>> 	at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
>> ~[spring-orm-3.0.4.RELEASE.jar:3.0.4.RELEASE]
>> 	at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:306)
>> ~[spring-orm-3.0.4.RELEASE.jar:3.0.4.RELEASE]
>> 	at org.springframework.orm.jpa.JpaTemplate.find(JpaTemplate.java:302)
>> ~[spring-orm-3.0.4.RELEASE.jar:3.0.4.RELEASE]
>> 
>> Any ideas?
>> Thanks in advance.
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 

-- 
View this message in context: http://old.nabble.com/ResourceBundle-error-tp29820315p29843102.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top