users@glassfish.java.net

Re: Obtaining a stacktrace for java.lang.IllegalArgumentException: An exception occured while creating a query in EntityManager

From: Chris Searle <chris.searle_at_objectware.no>
Date: Thu, 9 Jul 2009 07:21:02 +0200

On 9. juli. 2009, at 01.02, Martin Gainty wrote:

> ps -ef
> get the pid of GLASSFISH process
>
> then feed the pid to jstack e.g.
> jstack -l pid

My jstack seems to only have -m and -h options:

Usage: jstack [option] <pid>
                 (to connect to a live java process)
    or jstack [option] <executable> <core>
                 (to connect to a core file)
    or jstack [option] [server_id@]<remote server IP or hostname>
                 (to connect to a remote debug server)

where option must be one of:
     -m to print both java and native frames (mixed mode)
     -h | -help to print this help message

(and the -m option says "not supported - use gdb").

Can't say that I can see anything of use in the list generated with
straight jstack <pid> - both run before and after the
IllegalArgumentException. Is this a timing issue (do I need to run
jstack while the error is actually processing?)

>
> hth
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de
> confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig.
> Diese Nachricht dient lediglich dem Austausch von Informationen und
> entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten
> Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den
> Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes
> pas le destinataire prévu, nous te demandons avec bonté que pour
> satisfaire informez l'expéditeur. N'importe quelle diffusion non
> autorisée ou la copie de ceci est interdite. Ce message sert à
> l'information seulement et n'aura pas n'importe quel effet
> légalement obligatoire. Étant donné que les email peuvent facilement
> être sujets à la manipulation, nous ne pouvons accepter aucune
> responsabilité pour le contenu fourni.
>
>
>
>
>
> > From: chris.searle_at_objectware.no
> > To: users_at_glassfish.dev.java.net
> > Date: Wed, 8 Jul 2009 21:14:08 +0200
> > Subject: Obtaining a stacktrace for
> java.lang.IllegalArgumentException: An exception occured while
> creating a query in EntityManager
> >
> > Am trying to get spring 2.5 to use glassfish (2.1) persistence
> > handling/JTA (as a test project for trying to learn about JPA/JTA).
> >
> > I'm getting a 500 internal server error with
> >
> > java.lang.IllegalArgumentException: An exception occured while
> > creating a query in EntityManager
> >
> > note The full stack traces of the exception and its root causes are
> > available in the Sun GlassFish Enterprise Server v2.1 logs.
> >
> >
> > but no matter where I dig in the log files I can't get any output
> > other than:
> >
> >
> >
> > [#|2009-07-08T20:58:13.656+0200|INFO|sun-appserver2.1|
> > oracle.toplink.essentials.session.file:/Users/chris/src/twphch/
> > flickrvote/flickrvote-web/target/twitterphotochallenge/WEB-INF/
> > classes/-FlickrVote|
> > _ThreadID=19;_ThreadName=httpSSLWorkerThread-8080-0;|file:/Users/
> chris/
> > src/twphch/flickrvote/flickrvote-web/target/twitterphotochallenge/
> WEB-
> > INF/classes/-FlickrVote login successful|#]
> >
> > [#|2009-07-08T20:58:13.656+0200|INFO|sun-appserver2.1|
> > javax.enterprise.system.stream.out|
> > _ThreadID=19;_ThreadName=httpSSLWorkerThread-8080-0;|DEBUG
> > httpSSLWorkerThread-8080-0
> > org.springframework.orm.jpa.EntityManagerFactoryUtils - Registering
> > transaction synchronization for JPA EntityManager
> > |#]
> >
> > [#|2009-07-08T20:58:13.670+0200|INFO|sun-appserver2.1|
> > javax.enterprise.system.stream.out|
> > _ThreadID=19;_ThreadName=httpSSLWorkerThread-8080-0;|DEBUG
> > httpSSLWorkerThread-8080-0
> > org.springframework.orm.jpa.EntityManagerFactoryUtils - Closing JPA
> > EntityManager
> > |#]
> >
> > [#|2009-07-08T20:58:13.670+0200|INFO|sun-appserver2.1|
> > javax.enterprise.system.stream.out|
> > _ThreadID=19;_ThreadName=httpSSLWorkerThread-8080-0;|DEBUG
> > httpSSLWorkerThread-8080-0
> > org.springframework.transaction.jta.JtaTransactionManager -
> Initiating
> > transaction rollback
> > |#]
> >
> >
> > Seems daft but I simply cannot find a stacktrace. I've tried setting
> > log levels for jta, persistence etc to FINEST - no luck.
> >
> >
> > Can anyone give me a hint as to where to find out what went wrong?
> >
> >
> >
> > If relevant - the config of the app looks like:
> >
> > <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> > http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
> > version="1.0">
> >
> > <persistence-unit name="FlickrVote" transaction-type="JTA">
> > <jta-data-source>jdbc/FlickrVoteDS</jta-data-source>
> > <properties>
> > <property name="toplink.ddl-generation" value="create-
> > tables"/>
> > <property name="toplink.application-location" value="/
> > tmp/"/>
> > <property name="toplink.create-ddl-jdbc-file-name"
> > value="create.sql"/>
> > <property name="toplink.drop-ddl-jdbc-file-name"
> > value="drop.sql"/>
> > <property name="toplink.ddl-generation.output-mode"
> > value="sql-script"/>
> > <property name="toplink.logging.level.sql" value="FINE"/>
> > <property name="toplink.logging.level.transaction"
> > value="FINE"/>
> > </properties>
> > </persistence-unit>
> > </persistence>
> >
> > with spring config:
> >
> > <bean
> > class
> > =
> > "org
> > .springframework
> > .orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
> > <property name="persistenceUnits">
> > <map>
> > <entry key="FlickrVote" value="persistence/
> > FlickrVote"/>
> > </map>
> > </property>
> > </bean>
> >
> > <tx:jta-transaction-manager/>
> > <tx:annotation-driven/>
> >
> >
> > and finally web.xml
> >
> > <persistence-unit-ref>
> > <persistence-unit-ref-name>persistence/FlickrVote</
> > persistence-unit-ref-name>
> > <persistence-unit-name>FlickrVote</persistence-unit-name>
> > </persistence-unit-ref>
> >
> >
> > The service layer classes that call the dao are marked for spring
> > @Transactional and the dao's themselves have a
> >
> > @PersistenceUnit
> > private EntityManager em;
> >
> > Just for fun have also tested with
> >
> > <jee:jndi-lookup id="entityManagerFactory" jndi-name="java:comp/
> > env/persistence/FlickrVote"/>
> >
> > with the same result. It gives the IllegalArgumentException but I
> can
> > find nothing else in the logs to give me a hint as to what I have
> wrong.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> > For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> >
>
> Lauren found her dream laptop. Find the PC that’s right for you.