This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 142034 - Error while running ejbc
Summary: Error while running ejbc
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-29 11:48 UTC by Jaroslav Pospisil
Modified: 2008-09-11 17:08 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (93.43 KB, text/plain)
2008-07-29 11:58 UTC, Jaroslav Pospisil
Details
server.log (221.62 KB, text/plain)
2008-07-29 17:03 UTC, Jaroslav Pospisil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Pospisil 2008-07-29 11:48:17 UTC
Build 200807290201,JDK 1.6.0_10, Win Vista

1)Create web application
2)Add web service client
3)Add servlet,uncomment template HTML section (out.println....) and Call web service operation
just before </body> tag.
4)Save and deploy project.
ERROR: Build fails

deployment started : 0%
Deploying application in domain failed; Error while running ejbc -- Fatal Error from EJB Compiler -- fhgt.NewWebService
Deployment error:
The module has not been deployed.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:193)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor251.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:486)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: The module has not been deployed.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
        ... 16 more
BUILD FAILED (total time: 2 seconds)

Attaching also messages.log with full stacktrace.
Notice: If I disable Deploy on Change feature in Properties (Compile on Save), everything works.
Comment 1 Jaroslav Pospisil 2008-07-29 11:58:09 UTC
Created attachment 65928 [details]
messages.log
Comment 2 Jaroslav Pospisil 2008-07-29 14:56:57 UTC
I've got simila result for ws client in EJB module/session bean's bussiness method:

init:
deps-jar:
wsimport-init:
wsimport-client-check-ejbWS:
wsimport-client-ejbWS:
wsimport-client-generate:
wsimport-client-compile:
compile:
library-inclusion-in-archive:
dist:
pre-run-deploy:
In-place deployment at C:\Users\jp154641\Documents\NetBeansProjects\EJBModule2\build\jar
Start registering the project's server resources
Finished registering server resources
moduleID=EJBModule2
deployment started : 0%
Deploying application in domain failed; Error loading deployment descriptors for module [EJBModule2] -- Invalid ejb jar
[C:\Users\jp154641\Documents\NetBeansProjects\EJBModule2\build\jar]: it contains zero ejb. 
Note: 
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean. 
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 
3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful,
@MessageDriven), please check server.log to see whether the annotations were processed properly.
Deployment error:
The module has not been deployed.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:193)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:486)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: The module has not been deployed.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
        ... 16 more
BUILD FAILED (total time: 0 seconds)
Comment 3 Petr Jiricka 2008-07-29 15:44:36 UTC
Cau Jardo,

which server do you have? Could you please also attach the server log as noted in the exception?
Comment 4 Jaroslav Pospisil 2008-07-29 16:53:30 UTC
Default glassfish v2, bundled with Netbeans 6.5dev build.
Comment 5 Jaroslav Pospisil 2008-07-29 17:02:21 UTC
Default glassfish v2, bundled with Netbeans 6.5dev build.

Comment 6 Jaroslav Pospisil 2008-07-29 17:03:13 UTC
Created attachment 65965 [details]
server.log
Comment 7 _ pcw 2008-07-29 22:45:31 UTC
In case anyone is wondering, this not a server bug or a server plugin bug as far as I can tell.  It's lots of other bugs
rolled into one.  I'm still compiling the list.  Compile-On-Save seems to be the culprit for the final deploy failure
though.
Comment 8 _ pcw 2008-07-30 00:39:34 UTC
The deploy/run bug here seems to be a compile on save bug.

To check this, switch to <files> view.  Locate build.xml in the client project. Right click, select Run Target | Clean,
then Run Target | Compile.  This will run the real compiler and build correct class files.

Clearing the server log, then Undeploy/Redeploy and the project should deploy correctly.

Note that if the service was also from NetBeans, it may suffer the same problem, so if the client is deployed but
doesn't run (ClassNotFound or other exceptions), fix the service project as above, then refix the client and it should work.

It seems that in some or all cases, the CalcServlet.class generated by CompileOnSave is 0 bytes long.
Comment 9 Petr Jiricka 2008-07-30 14:37:17 UTC
Peter, thanks for the evaluation. Adding Jan Lahoda to cc - the "CalcServlet.class is 0 bytes long" symptom may be
related to his code.
Comment 10 Vince Kraemer 2008-08-02 01:22:08 UTC
OK.  I am going to mark this as a dup of 142392.

The symptom is VERY similar to symptoms of issue 142392.

I also went through a sequence of steps that would cover this issue (in issue 142367) successfully.

Please reopen, with more details, if you can reproduce this with builds younger than 20080801...

*** This issue has been marked as a duplicate of 142392 ***
Comment 11 Jaroslav Pospisil 2008-08-05 16:38:58 UTC
v.
Comment 12 Jaroslav Pospisil 2008-08-21 15:26:10 UTC
Reproduced again in 200808210201,JDK1.6.0_10,Win Vista and Mac

1)Start IDE with clean userdir and add JAX-RPC plugin
2)Create J2EE1.4 Web App with web service and deploy
3)Create another J2EE1.4 Web App with web service client on previously deployed ws
4)Call ws op in index.jsp of second web project (ignore error markings,it's OK, known issue)
5)Deploy web application

NOTICE: Although stacktrace isn't exactly the same,it's very similar and again, disabling Compile-On-Save fixes the problem.

DPL5306:Servlet Web Service Endpoint [NewWebService] listening at address
[http://129.157.20.185:8080/WebApplication36/NewWebService]
deployed with moduleid = WebApplication36
JAXRPCSERVLET14: JAX-RPC servlet initializing
DPL5306:Servlet Web Service Endpoint [NewWebService] listening at address
[http://129.157.20.185:8080/WebApplication36/NewWebService]
DPL5035:Error while running ejbc
com.sun.enterprise.deployment.backend.IASDeploymentException: Fatal Error from EJB Compiler -- cdcdvd.NewWebService
        at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:248)
        at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1434)
        at com.sun.enterprise.deployment.Application.visit(Application.java:1767)
        at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.run(JaxRpcRICodegen.java:142)
        at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:856)
        at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:593)
        at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployModule(EJBCompiler.java:347)
        at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:230)
        at com.sun.enterprise.deployment.backend.ModuleDeployer.runEJBC(ModuleDeployer.java:814)
        at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java:181)
        at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:179)
        at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788)
        at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException: Error while running ejbc -- Fatal Error from EJB Compiler
-- cdcdvd.NewWebService
        at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:248)
        at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1434)
        at com.sun.enterprise.deployment.Application.visit(Application.java:1767)
        at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.run(JaxRpcRICodegen.java:142)
        at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:856)
        at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:593)
        at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployModule(EJBCompiler.java:347)
        at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:230)
        at com.sun.enterprise.deployment.backend.ModuleDeployer.runEJBC(ModuleDeployer.java:814)
        at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java:181)
        at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:179)
        at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788)
        at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
JAXRPCSERVLET15: JAX-RPC servlet destroyed
DPL5306:Servlet Web Service Endpoint [NewWebService] listening at address
[http://129.157.20.185:8080/WebApplication36/NewWebService]
deployed with moduleid = WebApplication36
JAXRPCSERVLET14: JAX-RPC servlet initializing
deployed with moduleid = WebApplication38
naming.bind
Comment 13 Petr Hejl 2008-08-22 13:25:11 UTC
I think this is the source of the issue:

<webproject2:javac classpath="${wscompile.classpath}:${javac.classpath}" destdir="${build.classes.dir}"
srcdir="${build.generated.dir}/wsclient"/>

Source files in build dir are probably not handled correctly with CoS, not sure what the solution should be. Honza,
Milan can you comment?

This concept is bit weird to me, but I'm not an WS expert. Milan, what is the ${build.generated.dir}/wsbinary
(containing classes) used for?
Comment 14 Petr Jiricka 2008-09-05 13:29:58 UTC
Any news on this issue? Is it still reproduceable? If not - Honzo or Milane, can you comment?
Comment 15 Jaroslav Pospisil 2008-09-11 16:56:08 UTC
Can't reproduce anymore in latest hudson trunk build (20080911080508).Closing as fixed.
Comment 16 Jaroslav Pospisil 2008-09-11 16:57:55 UTC
v.
Comment 17 Milan Kuchtiak 2008-09-11 17:08:20 UTC
I can confirm,
the issue was fixed by some improvements in Compile on Save implementation and by specifying SourceForBinaryQuery for
JAX-WS and JAX-RPC artifacts.