eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
369 stars 136 forks source link

GlassFish 9.0 b42 returns "Inconsistent Module State" error on re-deployment #546

Closed glassfishrobot closed 17 years ago

glassfishrobot commented 18 years ago

I've downloaded b42 version of GlassFish application server yesterday. I wanted to test the new possibilities of JEE 5 and I've found a strange problem. Every application created in NetBeans 5.5 (be it Preview, Dev and Daily) deploys fine only the first time. On every other attempt server returns an error, which results in deployment failure (details follow). I've tried different combinations of server and NetBeans, but the final result was virtually the same.

Reproducibility: Every time.

Steps to reproduce: 1. Download GlassFish 9.0 b42 server 2. Run "java -Xmx512m -jar glassfish-installer-9.0-b42.jar" 3. Extract to /opt/glassfish-9.0-b42 4. cd /opt/glassfish-9.0-b42 5. ant -f setup.xml

6. Download NetBeans 5.5 (Preview, Dev, or Daily) 7. Create new server instance on the Runtime tab:

8. Create new Enterprise Application:

Actual Results:

=============== 1st run ===============

GlassFish Application Server 9.0 b42

ADM1006:Uploading the file to:[/tmp/s1astempdomain1server2037890344/GlassHello.ear] deployed with moduleid = GlassHello ADM1041:Sent the event to instance:[ApplicationDeployEvent -- enable GlassHello] Registering ad hoc servlet: WebPathPath: context root = "/GlassHello", path = "/GlassHello-app-client' Java Web Start services started for application com.sun.enterprise.appclient.jws.ApplicationContentOrigin@195f1b9 registration name=GlassHello com.sun.enterprise.appclient.jws.NestedAppclientContentOrigin@130afa6 registration name=GlassHello, context root=/GlassHello/GlassHello-app-client, module name= , parent=GlassHello|#] WEB0100: Loading web module [GlassHello:GlassHello-war.war] in virtual server [server] at [/GlassHello-war]

build.xml (run-deploy)

pre-init: init-private: init-userdir: init-user: init-project: do-init: post-init: init-check: init-macrodef-javac: init-macrodef-nbjpda: init-macrodef-debug: init: deps-jar: deps-j2ee-archive: init: deps-jar: Created dir: /home/wiktorw/java/GlassHello/GlassHello-app-client/build/ear-module Copying 3 files to /home/wiktorw/java/GlassHello/GlassHello-app-client/build/ear-module/META-INF Compiling 1 source file to /home/wiktorw/java/GlassHello/GlassHello-app-client/build/ear-module compile: library-inclusion-in-manifest: Created dir: /home/wiktorw/java/GlassHello/GlassHello-app-client/dist Building jar: /home/wiktorw/java/GlassHello/GlassHello-app-client/dist/GlassHello-app-client.jar dist-ear: init: deps-jar: Created dir: /home/wiktorw/java/GlassHello/GlassHello-ejb/build/jar Created dir: /home/wiktorw/java/GlassHello/GlassHello-ejb/build/ear-module Copying 2 files to /home/wiktorw/java/GlassHello/GlassHello-ejb/build/ear-module/META-INF compile: library-inclusion-in-manifest: Created dir: /home/wiktorw/java/GlassHello/GlassHello-ejb/dist Building jar: /home/wiktorw/java/GlassHello/GlassHello-ejb/dist/GlassHello-ejb.jar dist-ear: init: deps-module-jar: deps-ear-jar: deps-jar: Created dir: /home/wiktorw/java/GlassHello/GlassHello-war/build/ear-module/WEB-INF/classes Created dir: /home/wiktorw/java/GlassHello/GlassHello-war/build/ear-module/META-INF Copying 1 file to /home/wiktorw/java/GlassHello/GlassHello-war/build/ear-module/META-INF Copying 3 files to /home/wiktorw/java/GlassHello/GlassHello-war/build/ear-module library-inclusion-in-archive: library-inclusion-in-manifest: compile: compile-jsps: do-ear-dist: Created dir: /home/wiktorw/java/GlassHello/GlassHello-war/dist Building jar: /home/wiktorw/java/GlassHello/GlassHello-war/dist/GlassHello-war.war dist-ear: pre-pre-compile: Created dir: /home/wiktorw/java/GlassHello/build/jar pre-compile: do-compile: Copying 3 files to /home/wiktorw/java/GlassHello/build/META-INF Copying 1 file to /home/wiktorw/java/GlassHello/build Copying 1 file to /home/wiktorw/java/GlassHello/build Copying 1 file to /home/wiktorw/java/GlassHello/build post-compile: compile: pre-dist: do-dist-without-manifest: do-dist-with-manifest: Created dir: /home/wiktorw/java/GlassHello/dist Building jar: /home/wiktorw/java/GlassHello/dist/GlassHello.ear post-dist: dist: run-deploy: Distributing /home/wiktorw/java/GlassHello/dist/GlassHello.ear to [localhost:4848_server] Start registering the project's server resources Finished registering server resources deployment started : 0% deployment finished : 100% Deploying application in domain completed successfully Trying to create reference for application in target server completed successfully Trying to start application in target server completed successfully Deployment of application GlassHello completed successfully Enable of GlassHello in target server completed successfully Enable of application in all targets completed successfully BUILD SUCCESSFUL (total time: 4 seconds) All operations completed successfully

=============== 2nd run ===============

GlassFish Application Server 9.0 b42

Java Web Start services ended for application: com.sun.enterprise.appclient.jws.ApplicationContentOrigin@195f1b9 registration name=GlassHello com.sun.enterprise.appclient.jws.NestedAppclientContentOrigin@130afa6 registration name=GlassHello, context root=/GlassHello/GlassHello-app-client, module name= , parent=GlassHello|#] ADM1064:The upload file at [/tmp/s1astempdomain1server2037890344/GlassHello.ear] exists and will be overwritten. ADM1006:Uploading the file to:[/tmp/s1astempdomain1server2037890344/GlassHello.ear] Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: Cannot generate policy file for GlassHello. – Inconsistent Module State at com.sun.enterprise.security.SecurityUtil.linkPolicyFile(SecurityUtil.java:339) at com.sun.enterprise.deployment.backend.AppDeployerBase.generatePolicy(AppDeployerBase.java:371) at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:130) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)

| #] Unable to create client jar: null com.sun.enterprise.deployment.backend.IASDeploymentException at com.sun.enterprise.deployment.backend.ClientJarMakerThread.createClientJar(ClientJarMakerThread.java:143) at com.sun.enterprise.deployment.backend.ClientJarMakerThread.run(ClientJarMakerThread.java:80) Caused by: java.io.FileNotFoundException: /opt/glassfish-9.0-b42/domains/domain1/generated/xml/j2ee-apps/GlassHello/GlassHelloClient.jar (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:179) at java.io.FileOutputStream.(FileOutputStream.java:131) at com.sun.enterprise.deployment.deploy.shared.OutputJarArchive.create(OutputJarArchive.java:90) at com.sun.enterprise.deployment.backend.ClientJarMakerThread.createClientJar(ClientJarMakerThread.java:109) ... 1 more | | #] |

build.xml (run-deploy)

pre-init: init-private: init-userdir: init-user: init-project: do-init: post-init: init-check: init-macrodef-javac: init-macrodef-nbjpda: init-macrodef-debug: init: deps-jar: deps-j2ee-archive: init: deps-jar: compile: library-inclusion-in-manifest: dist-ear: init: deps-jar: compile: library-inclusion-in-manifest: dist-ear: init: deps-module-jar: deps-ear-jar: deps-jar: library-inclusion-in-archive: library-inclusion-in-manifest: compile: compile-jsps: do-ear-dist: dist-ear: pre-pre-compile: pre-compile: do-compile: post-compile: compile: pre-dist: do-dist-without-manifest: do-dist-with-manifest: Building jar: /home/wiktorw/java/GlassHello/dist/GlassHello.ear post-dist: dist: run-deploy: Undeploying ... While undeploying, trying to stop application in target server completed successfully While undeploying, trying to remove reference for application in target server completed successfully Undeploying the application Trying to undeploy application from domain completed successfully Undeployment of application GlassHello completed successfully All operations completed successfully Distributing /home/wiktorw/java/GlassHello/dist/GlassHello.ear to [localhost:4848_server] Start registering the project's server resources Finished registering server resources deployment started : 0% Deploying application in domain failed; Cannot generate policy file for GlassHello. – Inconsistent Module State /home/wiktorw/java/GlassHello/nbproject/build-impl.xml:223: Deployment error: The module has not been deployed. See the server log for details. BUILD FAILED (total time: 3 seconds)

My System Specifications:

Portage 2.0.54 (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.5-r2, 2.6.15-suspend2-r8 i686)

System uname: 2.6.15-suspend2-r8 i686 AMD Turion(tm) 64 Mobile Technology ML-30

  1. java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
  2. which java /opt/sun-jdk-1.5.0.06/bin/java
  3. which javac /opt/sun-jdk-1.5.0.06/bin/javac

Additional information: I understand this is a development version. But at least on my system the aforementioned procedure gives me the same result every time. On the project's page there is a note that the server passes several tests (quicklook, CTS and SQE). But does any of those tests include re-deployment test, like in my case?

Environment

Operating System: All Platform: Linux URL: http://www.netbeans.info/downloads/download.php?type=5.5

Affected Versions

[9.0pe]

glassfishrobot commented 5 years ago
glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: When using context menu on the "GlassHello-ejb" project -> Deploy Project, the error is similar, but slightly different:

GlassFish Application Server 9.0 b42

ADM1064:The upload file at [/tmp/s1astempdomain1server2037890344/GlassHello-ejb.jar] exists and will be overwritten. ADM1006:Uploading the file to:[/tmp/s1astempdomain1server2037890344/GlassHello-ejb.jar] Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error – null at java.util.HashMap$HashIterator.nextEntry(HashMap.java:790) at java.util.HashMap$KeyIterator.next(HashMap.java:823) at com.sun.enterprise.deployment.backend.EjbModuleDeployer.generatePolicy(EjbModuleDeployer.java:203) at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:171) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)

| #] Unable to create client jar: null com.sun.enterprise.deployment.backend.IASDeploymentException at com.sun.enterprise.deployment.backend.ClientJarMakerThread.createClientJar(ClientJarMakerThread.java:143) at com.sun.enterprise.deployment.backend.ClientJarMakerThread.run(ClientJarMakerThread.java:80) Caused by: java.io.FileNotFoundException: /opt/glassfish-9.0-b42/domains/domain1/generated/xml/j2ee-modules/GlassHello-ejb/GlassHello-ejbClient.jar (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:179) at java.io.FileOutputStream.(FileOutputStream.java:131) at com.sun.enterprise.deployment.deploy.shared.OutputJarArchive.create(OutputJarArchive.java:90) at com.sun.enterprise.deployment.backend.ClientJarMakerThread.createClientJar(ClientJarMakerThread.java:109) ... 1 more | | #] |

build.xml (run)

init: deps-jar: compile: library-inclusion-in-archive: Building jar: /home/wiktorw/java/GlassHello/GlassHello-ejb/dist/GlassHello-ejb.jar dist: run-deploy: Distributing /home/wiktorw/java/GlassHello/GlassHello-ejb/dist/GlassHello-ejb.jar to [localhost:4848_server] Start registering the project's server resources Finished registering server resources deployment started : 0% Deploying application in domain failed; Deployment Error – null /home/wiktorw/java/GlassHello/GlassHello-ejb/nbproject/build-impl.xml:310: Deployment error: The module has not been deployed. See the server log for details. BUILD FAILED (total time: 0 seconds)

Please note the strange file path in the server log:

Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error – null ... Caused by: java.io.FileNotFoundException: /opt/glassfish-9.0-b42/domains/domain1/generated/xml/j2ee-modules/GlassHello-ejb/GlassHello-ejbClient.jar (No such file or directory)

I'm almost sure that no part of the project involves crating the GlassHello-ejbClient.jar file...

Actually, the trend is similar to the original issue:

Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: Cannot generate policy file for GlassHello. – Inconsistent Module State ... Caused by: java.io.FileNotFoundException: /opt/glassfish-9.0-b42/domains/domain1/generated/xml/j2ee-apps/GlassHello/GlassHelloClient.jar (No such file or directory)

I have no idea why the server was looking for the GlassHelloClient.jar file instead of GlassHello.jar file...

Maybe that's the source of the problem?

glassfishrobot commented 18 years ago

@glassfishrobot Commented @honghzzhang said: Similar problem have been reported here: http://forums.java.net/jive/thread.jspa?threadID=14134&tstart=0

One cause that we have identified (seems related to netbeans packaging) is if your ear contains an ejb jar which contains no actual ejb.

We have filed a bug for this and will fix in 9.1: we will fail the deployment if we find ejb jars containing no ejbs.

Please attach the application you use. And also check whether this is the case for your ear. Your ejb-jar should either contain a ejb-jar.xml which defines at least one ejb. Or you should have component level annotations in your ejb.

glassfishrobot commented 18 years ago

@glassfishrobot Commented @honghzzhang said: I've just heard another case where the user sees the inconsistent module state problem fairly often. He was using build 37 before he switched to build 42. He didn't see that problem with build 37. So this might have something to do with the latest security policy generation changes.

Please attach the application and reproducible steps (if you have them) so we can look into this carefully for regressions.

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Created an attachment (id=198) Original GlassHello application (zip), without EJB's – exhibits problem

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Created an attachment (id=199) Original GlassHello application (zip), with one EJB – no problem

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: As you suggested, I've added one simple EJB to the GlassHello application. To my pleasure, it resolved this simple case.

However, as I returned back to my original GlassAddress application, which includes JDBC resources and Entity classes, the problem persited. I've tried both approaches: with and without @Inheritance between the book.Person and book.Worker classes. The results are the same (Cannot generate policy file for GlassAddress. – Inconsistent Module State which leads to: Deploying application in domain failed

I include the aforementioned GlassAddress application in hope that the problem may be reproduced. Used components:

Error details follow:

GlassFish Application Server 9.0 b42

ADM1064:The upload file at [/tmp/s1astempdomain1server2037890344/GlassAddress.ear] exists and will be overwritten. ADM1006:Uploading the file to:/tmp/s1astempdomain1server2037890344/GlassAddress.ear: 2006.04.06 06:33:37.676-ServerSession(10289353)-TopLink, version: Oracle TopLink Essentials - 2006.3 (Build 060327)

| #] TopLink Info: 2006.04.06 06:33:37.678-ServerSession(10289353)-Server: unknown | | #]

06:33:37.680-ServerSession(10289353)-file:/opt/glassfish-9.0-b42/domains/domain1/applications/j2ee-apps/GlassAddress/GlassAddress-ejb_jar/-GlassAddress login successful | | #]

06:33:37.684-ServerSession(10289353)-file:/opt/glassfish-9.0-b42/domains/domain1/applications/j2ee-apps/GlassAddress/GlassAddress-ejb_jar/-GlassAddress logout successful | | #] TopLink Info: 2006.04.06 06:33:37.706-ServerSession(31303118)-TopLink, version: Oracle TopLink Essentials - 2006.3 (Build 060327) | | #] TopLink Info: 2006.04.06 06:33:37.707-ServerSession(31303118)-Server: unknown | | #]

06:33:37.730-ServerSession(31303118)-file:/opt/glassfish-9.0-b42/domains/domain1/applications/j2ee-apps/GlassAddress/GlassAddress-ejb_jar/-GlassAddress login successful | | #]

06:33:37.734-ServerSession(31303118)-file:/opt/glassfish-9.0-b42/domains/domain1/applications/j2ee-apps/GlassAddress/GlassAddress-ejb_jar/-GlassAddress logout successful | | #] Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: Cannot generate policy file for GlassAddress. – Inconsistent Module State at com.sun.enterprise.security.SecurityUtil.linkPolicyFile(SecurityUtil.java:339) at com.sun.enterprise.deployment.backend.AppDeployerBase.generatePolicy(AppDeployerBase.java:371) at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:130) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210) | | #] |

build.xml (run-deploy)

pre-init: init-private: init-userdir: init-user: init-project: do-init: post-init: init-check: init-macrodef-javac: init-macrodef-nbjpda: init-macrodef-debug: init: deps-jar: deps-j2ee-archive: init: deps-jar: compile: library-inclusion-in-manifest: dist-ear: init: deps-module-jar: deps-ear-jar: deps-jar: library-inclusion-in-archive: library-inclusion-in-manifest: compile: compile-jsps: do-ear-dist: dist-ear: pre-pre-compile: pre-compile: do-compile: post-compile: compile: pre-dist: do-dist-without-manifest: do-dist-with-manifest: post-dist: dist: run-deploy: Distributing /home/wiktorw/java/GlassAddress/dist/GlassAddress.ear to [localhost:4848_server] Start registering the project's server resources Finished registering server resources deployment started : 0% Deploying application in domain failed; Cannot generate policy file for GlassAddress. – Inconsistent Module State /home/wiktorw/java/GlassAddress/nbproject/build-impl.xml:219: Deployment error: The module has not been deployed. See the server log for details. BUILD FAILED (total time: 1 second)

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Created an attachment (id=200) Problematic GlassAddress application (zip)

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Created an attachment (id=201) Problematic GlassAddress application (zip)

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Not knowing what is the root cause of this embarassing situation, I downloaded the linux installers for b32g, b37, and b43 of the GlassFish server.

I'll try to compare the results using these different versions in hope to isolate the problem. If I find anything useful I'll try to inform you tomorrow about my findings.

glassfishrobot commented 18 years ago

@glassfishrobot Commented @honghzzhang said: Thanks for trying and providing all the information. I downloaded your GlassAddress application, but I couldn't get it to build. I tried to modify the properties files and xml files to point to my environment variables, but still have problems. I don't know if this is because I don't have this corresponding properies. /home/wiktorw/.netbeans/5.5dev/build.properties I don't have netbeans installed on my machine. It doesn't seem to be able to resolve this when it's building. javac: invalid target release: $

{default.javac.target}

In any case, could you please attach the built ear so I can just deploy that instead of building it?

And please do let me know how you find out with the other builds. That information will be very helpful to us to narrow down the cause.

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: This time I've started with the b32g version and progressed through b37, b42 to b43. The tactic I've used was pretty straightforward: create two basic applications, do clean and build on every project, and finally try to deploy each application twice. For switching between severs' versions I was changing the target server for every project (Properties -> Run -> Server) before rebuilding them (Clean and Build Project) and deploying (Deploy Project).

It seems that for applications that use typical EJB there is no problem in the whole process. Problems arise when Entity Classes are there in the EJB project and there is @Inheritance used on the one entity class, while another entity class extends the first one.

For testing I used the NetBeans 5.5 preview that can be found on the official NetBeans site: http://www.netbeans.info/downloads/download.php?type=5.5

I created two applications, as following.

GlassHello2:

GlassAddress2:

GlassFish Application Server 9.0 b32g – no problems

GlassFish Application Server 9.0 b37 – errors with 2nd app

============================== ADM1006:Uploading the file to:[/tmp/s1astempdomain1server1211576590/glassaddress2.ear] archive = file:/opt/glassfish-9.0-b37/domains/domain1/applications/j2ee-apps/glassaddress2/ archive = file:/opt/glassfish-9.0-b37/domains/domain1/applications/j2ee-apps/glassaddress2/GlassAddress2-ejb_jar/ archive = file:/opt/glassfish-9.0-b37/domains/domain1/applications/j2ee-apps/glassaddress2/GlassAddress2-web_war/ JTADSName = jdbc/addressbookDB nonJTADSName = jdbc/addressbookDB Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: java.lang.NullPointerException at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.loadPersistenceUnitBundle(PersistenceProcessor.java:458) at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.generateDDLFiles(PersistenceProcessor.java:282) at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processAppBundle(PersistenceProcessor.java:170) at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:112) at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:193) at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:152) at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109) at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66) at com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:418) at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:220) at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:125) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:842) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:260) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:716) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:165) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:194)

| #] ============================== |

GlassFish Application Server 9.0 b42 – errors with 2nd app

============================== Deploying application in domain failed; Error loading deployment descriptors for module [glassaddress2] Line 2 Column 61 – Deployment descriptor file META-INF/persistence.xml in archive [GlassAddress2-ejb.jar]. cvc-complex-type.4: Attribute 'version' must appear on element 'persistence'.

============================== ADM1064:The upload file at [/tmp/s1astempdomain1server2037890344/glassaddress2.ear] exists and will be overwritten. ADM1006:Uploading the file to:[/tmp/s1astempdomain1server2037890344/glassaddress2.ear] deployed with moduleid = glassaddress2 ADM1041:Sent the event to instance:[ApplicationDeployEvent -- enable glassaddress2] topLink_version application_server_name_and_version login_successful WEB0100: Loading web module [glassaddress2:GlassAddress2-web.war] in virtual server [server] at [/GlassAddress2-web] ADM1006:Uploading the file to:[/tmp/s1astempdomain1server2037890344/GlassAddress2-ejb.jar] Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error – null at java.util.HashMap$HashIterator.nextEntry(HashMap.java:790) at java.util.HashMap$KeyIterator.next(HashMap.java:823) at com.sun.enterprise.deployment.backend.EjbModuleDeployer.generatePolicy(EjbModuleDeployer.java:203) at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:171) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)

| #] Unable to create client jar: null com.sun.enterprise.deployment.backend.IASDeploymentException at com.sun.enterprise.deployment.backend.ClientJarMakerThread.createClientJar(ClientJarMakerThread.java:143) at com.sun.enterprise.deployment.backend.ClientJarMakerThread.run(ClientJarMakerThread.java:80) Caused by: java.io.FileNotFoundException: /opt/glassfish-9.0-b42/domains/domain1/generated/xml/j2ee-modules/GlassAddress2-ejb/GlassAddress2-ejbClient.jar (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:179) at java.io.FileOutputStream.(FileOutputStream.java:131) at com.sun.enterprise.deployment.deploy.shared.OutputJarArchive.create(OutputJarArchive.java:90) at com.sun.enterprise.deployment.backend.ClientJarMakerThread.createClientJar(ClientJarMakerThread.java:109) ... 1 more | | #] ============================== |

All in all, it looks like handling of Entity Classes and inheritance among them is problematic in newer GlassFish builds. My tests showed that NetBeans 5.5 can be successfully used with b32g build, while other builds are erroneous.

To make sure that you are able to repeat all the steps, you would need to download the NetBeans 5.5 preview from the NetBeans site and use its provided Sun Java System Application Server or combine it with GlassFish b32g. Then you should create a basic Enterprise Application by yourself, create database in Derby, add JDBC Connection Pool, JDBC Resource, Persistence Unit, and create two Entity Classes with inheritance.

I'll attach my very basic applications once again. But please keep in mind that they are just the results of my steps repeated, on a clean NetBeans profile and clean GlassFish installations. So in my opinion, the problem I described is persistent and repeatable.

I don't really know how to help you more right now. I'm going to try newer builds of GlassFish to see if the situation is resolved. For now I'll just stick to the working b32g version.

Hope this helps,

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Created an attachment (id=208) GlassHello2 application, including dist/glasshello2.ear

glassfishrobot commented 18 years ago

@glassfishrobot Commented siryes said: Created an attachment (id=209) GlassAddress2 application, including dist/glassaddress2.ear

glassfishrobot commented 18 years ago

@glassfishrobot Commented mvatkina said: To see your tables created please rename the corresponding properties in persistence.xml according to this list: http://forums.java.net/jive/thread.jspa?threadID=13989&tstart=0

Another problem with your persistence classes: PK can be defined only on the root entity. It is not allowed to have a different PK on a subclass - in your case it's this: @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getWorkerId()

{ return workerId; }

I suggest to change log level to FINE (or FINEST) and check for any exceptions that are not properly reported.

glassfishrobot commented 18 years ago

@glassfishrobot Commented @honghzzhang said: Thanks for your time spent experimenting with different builds and the detailed steps to reproduce.

1. I've filed a separate bug on persistence for the problem you reported about entity persistence and @Inheritance. Please follow up issue 558 for that aspect.

2. For the inconsistent module state problem: a. netbeans has packaged the persistence unit (@Entity annotation) as an ejb jar (specified as an ejb module in application.xml). This is incorrect. I have reported this to netbeans team. b. The incorrect packaging of ejb jar caused another problem: an empty security policy was created during deployment but was not removed during undeployment. We have already filed a bug for this one. We will fail the deployment for such invalid ejb jar in 9.1 (too late to check in this fix for 9.0).

I will keep this bug open but lower the priority to P4. Will close the bug once we add the validation code to reject invalid ejb jar in 9.1.

glassfishrobot commented 18 years ago

@glassfishrobot Commented @honghzzhang said: Lower to P4

glassfishrobot commented 18 years ago

@glassfishrobot Commented pjiricka@java.net said: cc myself

glassfishrobot commented 18 years ago

@glassfishrobot Commented @honghzzhang said: I've checked in the fix from appserver side in 9.1. Fail the deployment for such invalid ejb jar.

glassfishrobot commented 18 years ago

@glassfishrobot Commented @vkraemer said: fixed the target milestone to be correct.

pushed properity back up since folks using ANY tool (or no tool at all) could encounter this issue and get no help from the error message

Add to self to CC list.

glassfishrobot commented 18 years ago

@glassfishrobot Commented @vkraemer said: forgot to remove... opps.

glassfishrobot commented 17 years ago

@glassfishrobot Commented dochez said: need to be fixed in UR1

glassfishrobot commented 17 years ago

@glassfishrobot Commented @honghzzhang said: Fixed in 9.0ur1 now.

glassfishrobot commented 18 years ago

@glassfishrobot Commented File: GlassAddress.zip Attached By: siryes

glassfishrobot commented 18 years ago

@glassfishrobot Commented File: GlassAddress.zip Attached By: siryes

glassfishrobot commented 18 years ago

@glassfishrobot Commented File: GlassAddress2.zip Attached By: siryes

glassfishrobot commented 18 years ago

@glassfishrobot Commented File: GlassHello-no_EJB.zip Attached By: siryes

glassfishrobot commented 18 years ago

@glassfishrobot Commented File: GlassHello-one_EJB.zip Attached By: siryes

glassfishrobot commented 18 years ago

@glassfishrobot Commented File: GlassHello2.zip Attached By: siryes

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-546

glassfishrobot commented 18 years ago

@glassfishrobot Commented Reported by siryes