Bug #40039 "java.lang.IllegalArgumentException: null source" when using Glassfish with JPA
Submitted: 15 Oct 2008 9:59 Modified: 5 Jan 2009 13:53
Reporter: Dzmitry Horbach Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.6 OS:Windows
Assigned to: CPU Architecture:Any
Tags: connector, glassfish, IllegalArgumentException

[15 Oct 2008 9:59] Dzmitry Horbach
Description:
I have deployed JPA+JSF application to Glassfish server v2ur2 that uses mysql connection pool. Mysql version is 5.0.51b for Win32.

Whenever I try to use javax.persistence.EntityManager to execute javax.persistence.Query I receive the next exception:

java.lang.IllegalArgumentException: null source

The odd thing is that everything works fine when using old connector version 5.0.8

How to repeat:
Code that triggers errror (line 3):

1. Query query = em.createQuery("SELECT r FROM Resource r where" 
				+ "  r.name LIKE :name");
2. query.setParameter("name", "%" + name + "%");
		
3. return (List<Resource>) query.getResultList();

EntityManager is injected like follow:

@PersistenceContext(unitName="MediaSearch")
private EntityManager em;

persistence.xml:

<persistence-unit name="MediaSearch" transaction-type="JTA">
<jta-data-source>GFMYSQL</jta-data-source>
</persistence-unit>
[15 Oct 2008 10:00] Dzmitry Horbach
full stacktrace

Attachment: stacktrace (application/octet-stream, text), 34.93 KiB.

[9 Dec 2008 16:51] Torsten Krah
I am using version 5.1.6 with JBoss AS 4.2.3.GA and a XADataSource on Linux 2.6.x too and can confirm this problem.
It does not happen with a non XA DateSource and it does not happen with a XADataSource and Version 5.0.8.
[10 Dec 2008 10:13] Dzmitry Horbach
I have tested the new version of Connector/J 5.1.7 and now it works without problem.
Looks like this bug is a duplicate to the following: http://bugs.mysql.com/bug.php?id=35489
[11 Dec 2008 8:08] Tonci Grgin
Hi Dzmitry and thanks for your report. Special thanks for testing more as I had no time to look into this yet.

Can others confirm I can close this report?
[5 Jan 2009 13:45] Torsten Krah
I can confirm that 5.1.7 does work where 5.1.6 did fail.
[5 Jan 2009 13:53] Tonci Grgin
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/

Hi Dzmitry and Torsten and thanks for being such a great team players! I am closing this report now as fixed in release 5.1.7.

Thanks again for your interest in MySQL.