Tuesday, January 30, 2007

Developing the JEE application, how tears appeared in my eyes...

Update: I fixed the first exception mentioned in this blog. I had two methods in the WS with the same name but different params. And yesterday I probably didn't compile the -war project, which I did today. Really annoying NB doesn't take care of this.

As promised in yesterday's blog, I would keep you all posted on my proceedings... Unfortunately there's a lot of misery going on.

So I moved towards a JEE application and that was easy as can be. I created a new Enterprise project and two additional modules were created, one for the ejb's and one for the web part. Excellent. And as intended the newly created project was also the main project.

I then created some entities and had NB create as much as possible, which went like a breeze. Same goes for some stateless session-facades that would actually take care of my transaction problems. NB generated everything nicely and did so for remote and local interfaces as well. How it worked? Like a charm.

Next was a webservice, again NB generated all code and I was on a roll. Added some functionality and hit F11... nothing happened but an error message. As it turned out, the two additional projects weren't compiled as a result of a build of the JEE project.
There's no way to set anywhere in the project's properties to build dependent projects as well, so my guess is that NB should've done this all by itself. Yet it didn't.
So I build both projects myself, and did some experimentation... and as it turned out, when compiling the war project it had the same problem. Since the WS is using the SessionFacade it requires the -ejb project to be build and use its resulting JAR. Since that project is not build as a result of building the -war project, the build of the -war project fails. Hmmm, so I need to build dependencies by hand? First tears started to emerge. This is not what I am use to with NB.
After building everything by hand in the right order I run my project and what do you know... it all worked. Yippie... time to shutdown my laptop and go to sleep.

Tonight I wanted to continue where I left my proceedings last night. And this is where the real misery started and I'm getting the feeling that JEE support in NB is not as good as Roman's demo's show.
So what is happening? Well, nothing to be honest. Nothing has changed. Really nothing, honestly. But now when I run my project, it can't find the WS' WSDL file. Here's the output I get.

Problem encountered during annotation processing;
see stacktrace below for more information.
modeler error: Request wrapper bean names must be unique and must not clash with other generated classes. Class: com.sticktailgames.iff.backend.ws.WSPlayerServiceImpl method register(java.lang.String,java.lang.String,java.lang.String)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.onError(WebServiceAP.java:204)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.onError(WebServiceAP.java:193)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.onError(WebServiceAP.java:189)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.generateWrappers(WebServiceWrapperGenerator.java:220)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.processMethod(WebServiceWrapperGenerator.java:146)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitMethodDeclaration(WebServiceVisitor.java:470)
at com.sun.tools.apt.mirror.declaration.MethodDeclarationImpl.accept(MethodDeclarationImpl.java:41)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.processMethods(WebServiceVisitor.java:408)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.postProcessWebService(WebServiceVisitor.java:363)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.postProcessWebService(WebServiceWrapperGenerator.java:121)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:169)
at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:347)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:232)
at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
at com.sun.tools.apt.main.Main.compile(Main.java:1102)
at com.sun.tools.apt.main.Main.compile(Main.java:964)
at com.sun.tools.apt.Main.processing(Main.java:95)
at com.sun.tools.apt.Main.process(Main.java:85)
at com.sun.tools.apt.Main.process(Main.java:67)
at com.sun.tools.ws.wscompile.CompileTool.buildModel(CompileTool.java:605)
at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:538)
at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:56)
at com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactoryImpl.java:44)
at com.sun.enterprise.webservice.WsUtil.runWsGen(WsUtil.java:1820)
at com.sun.enterprise.webservice.WsUtil.genWSInfo(WsUtil.java:2089)
at com.sun.enterprise.deployment.backend.AppDeployerBase.loadDescriptors(AppDeployerBase.java:328)
at com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:332)
at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:182)
at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
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)
error: compilation failed, errors should have been reported
wsgen successful
Error parsing WSDLC:\Programs\Sun\AppServer\9.UR1\domains\domain1\generated\xml\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\wsdl\WSPlayerServiceImplService.wsdl (The system cannot find the file specified)


So I'm a bit mystified when it comes to this since everything worked fine yesterday. Messing around with this kind of stuff like this takes too much time. I should just work, or it should hint better at how to solve my problems.
Worse yet, when I re-run the project, I get an error that it can't deploy the application, because Sun AS is not allowing the deletion of the the ear-file.

ADM1006:Uploading the file to:[C:\Documents and Settings\Iwan\Local Settings\Temp\s1astempdomain1server1400139303\IFFServer.ear]
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFServer-ejb.jar
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFServer-ejb.jar failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFServer-ejb.jar failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFSharedLib.jar
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFSharedLib.jar failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFSharedLib.jar failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFServer-ejb.jar
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFServer-ejb.jar failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFServer-ejb.jar failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFSharedLib.jar
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFSharedLib.jar failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib\IFFSharedLib.jar failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF\lib failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war\WEB-INF failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer\IFFServer-war_war failed; now marked for delete-on-exit
UTIL6040: Error attempting to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer
UTIL6041: Performing gc to try to force file closures
UTIL6043: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer failed after 4 retries
UTIL6048: Attempt to delete C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer failed; now marked for delete-on-exit
Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException: Cannot delete existing directory C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFServer, possibly due to one or more open files or streams; these may interfere with later deployment attempts so you may need to manually delete this directory and/or restart the server to release the open files
at com.sun.enterprise.deployment.backend.AppDeployer.cleanAndCheck(AppDeployer.java:313)
at com.sun.enterprise.deployment.backend.AppDeployer.liquidateAppDirAndStubsDirIfTheyHappenToExist(AppDeployer.java:285)
at com.sun.enterprise.deployment.backend.AppDeployer.predeploy(AppDeployer.java:167)
at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:128)
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)

Why is this happening? Why can't the interoperability between Sun AS 9 and NB55 both bundled, not be better, smoother? It only works after stopping Sun AS 9. That is just too time consuming, time I want to spend on developing not on waiting for an app server to start.

And while I'm at it, why can clear the app servers output window, but when I run my project the whole log is displayed, not the log from that point on? What's the use of that?

Well... I'm going ahead and try to figure out what's going on and try to fix things. I'll be posting my proceedings through this.

Iwan

3 comments:

Anonymous said...

heihei,I have same thing as you

Anonymous said...

Hi,

Came across your site while browsing around…cool stuff u have going on here. Also I thought I’d tell u about something I came across, thought u might find it useful, bcoz ur in Technology…it’s this site called Myndnet…u should check it out..the link is here http://www.myndnet.com/login.jsp?referral=alpa83&channel=al237

It’s this cool place where u get paid for responding to queries…very cool stuff!! http://www.myndnet.com/login.jsp?referral=alpa83&channel=al237

Sign up n lemme know what u think…my mail id is barot.alpa@gmail.com

Cheers
Alpa

Anonymous said...

Good words.