users@glassfish.java.net

Same webapp works in Tomcat and doesn't work in GlassFish

From: <glassfish_at_javadesktop.org>
Date: Wed, 06 Jan 2010 12:33:00 PST

Hi,

I have a Windows 2003 Server running:
- Tomcat 6.0.20 (port 8080)
- GlassFish 2.1.1 Final (ports 10080, 10443, 14848)
Both installations are fine, I use Tomcat Manager and GlassFish Admin Console with no problems.

Then, I installed my webapp (subdir c:\sistemas\sitesat2, not a WAR file, because its better when updating only some files) into both servers. The installation was fine.

When running the webapp using Tomcat all works fine.
When running the webapp using GlassFish it arises an error at the line that creates EntityManagerFactory:

[code]
public final class JpaUtil {
        private static final String PERSISTENCE_UNIT = "sitesat2PU";
        private static EntityManagerFactory entityManagerFactory;
        private static final ThreadLocal<EntityManager> threadLocal;
        private JpaUtil() {}
        static {
                entityManagerFactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
                threadLocal = new ThreadLocal<EntityManager>();
        }
[/code]

I dont think this is a problem with my webapp because it works 100% at Tomcat.
This is the first time I try to use GlassFish. I would like to migrate all webapps for it.

My development environment is NetBeans 6.8 + GlassFish 2.1 + my webapp, and
in development GlassFish runs my webapp 100% too!
[Message sent by forum member 'edilmar' (edilista_at_intersite.com.br)]

http://forums.java.net/jive/thread.jspa?messageID=379102