问题
I'm trying to deploy java class as a webservice on GlassFish.
javac -d C:\glassfish3\glassfish\domains\mydomain\autodeploy grWrapper/HelloWorld.java
No errors during compilation, but i have server_deployFailed file in autodeploy folder and "file open failure" in server.log
[#|2011-11-30T00:21:05.616+0400|INFO|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=41;_ThreadName=Thread-2;|[AutoDeploy] Selecting file C:\glassfish3\glassfish\domains\mydomain\autodeploy\HelloWorld.class for autodeployment.|#]
[#|2011-11-30T00:21:05.622+0400|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=41;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/C:/glassfish3/glassfish/domains/mydomain/autodeploy/HelloWorld.class|#]
[#|2011-11-30T00:21:05.623+0400|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=41;_ThreadName=Thread-2;|error in opening zip file -- invalid zip file: file:/C:/glassfish3/glassfish/domains/mydomain/autodeploy/HelloWorld.class|#]
[#|2011-11-30T00:21:05.624+0400|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=41;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/C:/glassfish3/glassfish/domains/mydomain/autodeploy/HelloWorld.class|#]
[#|2011-11-30T00:21:05.624+0400|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=41;_ThreadName=Thread-2;|error in opening zip file -- invalid zip file: file:/C:/glassfish3/glassfish/domains/mydomain/autodeploy/HelloWorld.class|#]
[#|2011-11-30T00:21:05.625+0400|SEVERE|glassfish3.1.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=41;_ThreadName=Thread-2;|The log message is null.|#]
[#|2011-11-30T00:21:05.626+0400|WARNING|glassfish3.1.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=41;_ThreadName=Thread-2;|[AutoDeploy] Autodeploy failed : C:\glassfish3\glassfish\domains\mydomain\autodeploy\HelloWorld.class.|#]
Any clue what might be wrong?
回答1:
You cannot autodeploy a single class file with GlassFish Server 3.1.1.
You may have been reading some blogs that leveraged the fact that autodeployment of a class did 'work' in earlier versions of GlassFish v3 Prelude and maybe even v3. That feature was not a 'supported feature' of GlassFish and it looks like it finally stopped 'working'.
来源:https://stackoverflow.com/questions/8317550/file-open-failure-compiling-java-class-to-glassfish-autodeploy