Deploying WAR File to Glassfish - deployment

I'm just getting to grips with the NetBeans 6.9 / Glassfish 3 combo, and have developed a Java EE app consisting of a WAR module and an EJB module. Having played around with the EJB side of things for a while, I went back to run the web code, and started having problems.
When I try to run the WAR file, it fails to deploy, and the error from the server is `WEB0113: virtual server [server] already has a web module [MyApp-war.war] loaded.' But I haven't edited the web side code since I last ran it, and I'm rather puzzled as to what it's trying to do.
I've tried the usual things: restarting the server, undeploying and redeploying the application, but to no avail... so if anyone with any more experience with Glassfish has any hints, they will be gratefully received!

if anyone with any more experience with Glassfish has any hints, they will be gratefully received!
Open GlassFish's Admin Console, see if the application is listed and try to undeploy it from there.

Did you create and deploy an enterprise application (ear) containing the ejb and web module? I don't think you can then deploy only the webapplication since its already deployed inside the ear. You'll have to redeploy the ear instead.

I had the same problem. Restart of glassfish server helped.
What was interesting, the Applications list did not have the application. Apparently some glassfish/netbeans bug.

What I did was , i went to the admin console for my Glassfish server and I undeployed all the unused projects and redeployed the project that i was trying to run. And it worked!

Related

Liferay/jboss : no response after hot deploying a war

When I start jboss server with liferay (6.2), everything works. I can access the portal, access the administration section of liferay, even war deployed outside of liferay (activiti-explorer,...)
But when I hot deploy a war with portlets, jboss is still running but I can't access anything, even war deployed outside of liferay.
In chrome, i get a ERR_EMPTY_RESPONSE for any url pointing to the jboss server.
In the jboss console, there is nothing showing up after liferay telling the war has been deployed.
Could you help or indicate me leads to resolve my problem?
Thanks in advance

Step through debugging of web app code in Eclipse maven app running on tomcat

I am trying to set up eclipse so that I can work on a maven web application which packages as a war file without building the war file and deploying to tomcat webapps manually.
This would also allow me to step through the code. I have installed tomcat 7 and my app deploys there ok and I have pointed eclipse at the installation of tomcat but it does not seem to deploy properly even though the manual deployment works fine.
The issue I get when deploying is that eclipse informs me that tomcat was not able to start.
To deploy my app I am going "servers >> add and remove" and then deploying my application from the available list by moving it into the configured list. After doing this and starting the tomcat server I get the error message.
Can anybody help me with running the app from within eclipse based on the compiled code and not on whats in the war file as ideally my end result would be to be able to step through code I am working on without building the war file first.
Thanks
I finally sorted this out after a few hours of messing around reading numerous posts, so hopefully this answer may help someone else who gets the error message:
"Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds"
Below are the steps I took:
1) Backed up my projects in my work space and then deleted the workspace
2) Recreated the workspace and imported my projects back into it
3) (this bit was crucial for me) - Added a connector to my server.xml on port 8080 as my app was set up to only run with SSL, it seems that eclipse tries to verify your app started by hitting the root of the web app and it couldnt do this due to the SSL connector.
I hope this helps someone out.

Eclipse Kepler + maven + websphere 8.5 + JAX-WS

I have an ear maven project which contain an ejb moudle which has 4 stateless session beans annotated as web services. I was doing all my testing in Glassfish and have never complained when i deployed the ear file. Glassfish published the ejb's as web services and generated the WSDL and life was pink.
However, when i tried to deploy the same ear in WAS 8.5 nothing is published, and i can see the status of the service has x icon and when i hover it, it says that the service endpoints are not listening but the deployed asset is running.
I have spent a 3 day trying to solve this but no progress.
Have anyone faced such a problem? how you solved that and managed to publish the ejb as a web service?
For anyone later who may face the same issue. there is a utility in websphere/appserver/bin called endptEnabler. You must run it on your ear before installment in the app server.. Good luck for all
while deployment of webservices you have to enable the check box "Webservice" available in deployment settings in websphere

Glassfish Hot Deploy with File Synchronization

I was looking for someway to perform hot deployment on glassfish. I was find this guide:
http://entjavastuff.blogspot.se/2010/11/hot-deploying-from-eclipse.html
which is exactly what I am looking for. Unfortunately, this is for JBoss. I do not know how to handle it for Glassfish.
Can you please help me transform the part "Configure destinations" to Glassfish directories instead?
Best regards
It would be exactly the same, except, rather than pointing the synchronization of files to the JBoss deploy directory, you would point them to the glassfish/domains/domain1/autodeploy directory.
Forget that.
"File open failure" compiling java class to glassfish autodeploy
If somebody find a Java EE 6 container you can do autodeploy, please share it. I have pass the last month trying do do an autodeploy on JBoss, WebLogic and Glassfish. It never worked.
Lesson learned: Do not use Java EE. Use Spring on a simple tomcat.

Java EE6 App + EJB in Glassfish 3.0/Netbeans 6.8?

Has anyone got this configuration working?
Latest Netbeans, latest Glassfish, I created an EJB project, also an EE Application.
The EJB in itself builds & deploys to Glassfish OK.
Now when I want to reference the EJB, I have to add the EJB jar to the EE Application path, if I don't do this the code does not compile.
But, the EJB jar gets packaged in the App jar and as a result when I try to deploy the app to Glassfish it says:
"java.lang.IllegalArgumentException:
Sniffers with type [ejb] and type
[appclient] should not claim the
archive at the same time. Please check
the packaging of your archive"
How do I tell Netbeans NOT TO package the EJB in the App jar? Or is the problem somewhere else?
btw. if I remove the EJB manually from the JAR then the app deploys successfully (with asadmin deploy), but when I try to run it with appclient, I get a NullPointerException.
Surely there must be a solution to this, I thought Netbeans was for web application development after all...
Edit: I found this:
http://forums.netbeans.org/topic23499.html
Which lists exactly the same steps that I did to resolve the problem.
Here is a solution candidate:
https://netbeans.org/bugzilla/show_bug.cgi?id=183488
Which basically says that Glassfish v3 is seriously broken, and it won't work.
Here is how I got it to work: the EJB and the EE Application MUST BE packaged in an EAR (project), and they MUST BE deployed within the EAR. Deploying the application jar individually WILL NOT WORK (at least not with Netbeans 6.8 + Glassfish v3).