Hibernate Spatial Postgis + Glassfish 3.1 Deployment Error.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Hibernate Spatial Postgis + Glassfish 3.1 Deployment Error.

iliTheFallen
event-tutorial.zip

Hi Hibernate Spatial Users & Developers,

I was trying to make hibernate spatial tutorial work; but failed for many times. I am using JPA and EJB and deploying ejb jar to glassfish 3.1 open source edition. i attached my sample maven project to this thread.

When i deploy the same module to glassfish sometimes i get this error :

  java.lang.NoClassDefFoundError: Could not initialize class org.hibernatespatial.GeometryUserType
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at org.hibernate.type.CustomType.<init>(CustomType.java:75)
        at org.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:295)
        at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:281)
        at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:274)
        at org.hibernate.mapping.Property.isValid(Property.java:217)
        at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
        at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
        at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:883)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:205)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
        at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213)
        at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)
        at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220)
        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
       


sometimes i get this one (strange ha?) :


java.lang.NoSuchMethodError: org.hibernate.type.CustomType.<init>(Lorg/hibernate/usertype/UserType;)V
        at org.hibernatespatial.GeometryUserType.<clinit>(GeometryUserType.java:61)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at org.hibernate.type.CustomType.<init>(CustomType.java:75)
        at org.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:295)
        at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:281)
        at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:274)
        at org.hibernate.mapping.Property.isValid(Property.java:217)
        at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
        at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
        at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:883)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:205)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
        at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:213)
        at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:486)
        at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:220)
        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:166)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)


I added hibernatespatial-1.1, hibernatespatial-postgis, jta-1.8 and postgis-2.0.0SVN.jar to the classpath of glassfish(glassfishv3/glassfish/domains/domain1/lib).

I really can't have found what the problem is about for almost one month.


Thanks for your replies in advance,
Ilker GURCAN