I have gone through the Question:
[weblogic.application.ModuleException: Context path '' is already in use by the module: / application:
and followed as answer of the question says; but still getting the same exception:
**> Deployment failed. The message was:
weblogic.application.ModuleException: Context path
'/socketss-war' is already in use by the module:
/Socketss-war application: Socketss
D:\NetBeansProjects\Socketss\Socketss-war\nbproject\build-impl.xml:1056:
The module has not been deployed. See the server log for details.**
Any guidance or suggestion would be highly appreciable.
Thank you!
ModualException come due to inproper Bulid.
Go through step by step.
Update project
Restart your eclipse
Remove project from server
clean server and redeploy your project
Now publish it i hope now it will work
Yup. Try to deploy from Netbeans.
The Weblogic eclipse plugin is, in my experience, the worst deployment plugin I've ever seen. If you are using a patched weblogic - such as 12.1.2 with Patch Set Update 6 - your deployment from eclipse might miraculously not work with such an error.
If you are able to deploy the WAR file without IDE by going to the deploy view, I recommend that you try using Netbeans to deploy and see how it goes.
Notice as well that the outcome of trying to deploy from eclipse as exploded war or as virtual application is not the same. Typically both do not work with different exceptions, depending on the patches you are using.
In my case, I have two local installations of weblogic 12.1.2. One with the patch set update and another one without. From eclipse, It is only possible to deploy to the one without. From Netbeans, deployment works regardless of the instance.
I am doing java dynamic web application in eclipse kepler.I am using Apache Tomcat7 as server.
I run the web application in initial with some static html page, further i changed with dynamic code an java servlet.
Now when ever I run the application it displays previous code result only.There is no change in web application what I made in file.
Please help me.
Thank You!
Try Clean and build before you run .
If u want build automatically , then you should enable Build automatically (To enable this see here)
If the output is same after this try restarting your server .
Hope this helps!!
1.check the Build Automatically in Project option in Eclipse Menu.
2.Then select the Automatically publish when resources change in the Tomcat screen(you will get it by double clicking on tomcat server in your eclipse servers tab.
I think this will help you.
I'm using a Eclipse and have embedded Tomcat. My issue is that sometimes when I edit my servlet, even when restarting tomcat inside of eclipse, the deployed project doesn't update, and seems to me that it's using a cached version of the files compiled.
How do I do efficiently to make eclipse & tomcat take my modifications into consideration? What folder do I need to clean?
I have found a good solution that doesnt need me to clean project each time. With it the context is reloaded whenever I modify my servlet.
In eclipse, Goto Project and activate the checkbox Build Automatically.
I'm running Eclipse Helios Service Release 1, with Tomcat 7.0.12 in Linux Ubuntu Natty Narwhal.
I've been happily hot re-deploying my webapp until it stopped working for apparently no reason. The following exception is displayed:
SEVERE: Allocate exception for servlet Index
java.lang.ClassNotFoundException: obliquid.servlet.Index
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
In Servers tab I've "Tomcat v7.0 Server at localhost [Started,Synchronized]
My project appears as a child of Tomcat v7.0 Server
In Properties, Java Build Path, Source I've Project/src Source folder
In Properties, Web Deployment Assembly, I've the following mappings: /WebContent -> /, /src -> /WEB-INF/classes, /test -> /build/classes
My src directory contains a Servlet in obliquid/servlet/Index.java
I tried already to click on Clean Module Work Directory... and Publish
I tried to stop and start the Server from within Eclipse Servers tab
What else should I check? Thank you.
UPDATE Despite now I'm working with the new project, I came back to check the old one, and mysteriously now it's working. I think I won't be able to find what has happened.
However today with the new project, I had 404 errors with no apparent reason and I found out that right clicking on the Tomcat server and selecting "Clean..." can be useful. Maybe it could have helped.
Selecting "Clean..." says: "Clean will discard all publish state and republish from scratch. Are you sure you want to clean all published resources?". Selecting yes, I solved the problem
UPDATE 2 It happened again on the new project. 404 errors, this time they don't go away.
Stop -> Clean... -> Start (404)
Stop -> Clean Tomcat Work Directory... -> Start (404)
Stop -> Clean Tomcat Work Directory... -> Clean... -> Start (404)
Stop -> Remove on the application -> Clean... -> Run As -> Run on Server -> (404)
Exit Eclipse, Start Eclipse
Start the server -> (404)
UPDATE 3 It turned out that this time I just didn't notice an exception caused by a listener-class during startup. After solving the problem, it worked. Guess I should stop working at 3 AM.
While on Tomcat 6 and Eclipse Ganymede I found out the following chain to work like charm:
1 stop server
2 project -> clean
3 project build (I had automatic build disabled)
4 delete server
5 delete Servers folder
6 restart Eclipse
7 create new server, add project and start :)
takes some time but worked like charm. My problem was a irritating Listener start problem, but this seems to be something similar: a property at tomcat. Btw: nowadays I am also a big Glassfish fan.
I found that this procedure is useful:
Click on Servers tab and Stop the server in use if it's running
Right click on the server again and select Clean...
Right click again and select Clean Tomcat Work Directory...
Hopefully the ClassNotFoundException should be gone now.
Another time I had a problem with a class launched at server startup, an exception in a listener class (ServletContextListener). When a ServletContextListener raises an exception during startup the application deployment is aborted, hence the 404 errors. In that case fixing the problem that caused the exception, made the application working again.
EDIT: This shorter procedure worked for me most of the times, but today didn't work and I had to follow Mico's extended procedure. My suggestion is, if you have a similar problem, first try this shorter procedure. If the problem persists, try with Mico's.
I'd recommend that you stop and start the Tomcat server again. Hot deploy does not work forever; there are some issues that will cause you to have to restart after a few redeploys.
I wonder when I see the accepted answer with +25 is it really accurate?
First if you are going to delete the server then whats the point in cleaning it? It will take your time unnecessarily and nothing useful will you gain.
So i will say just 5, 6, 7 steps should do the magic
5 delete Servers folder
6 restart Eclipse
7 create new server, add project and start
This could be something I learned on con-fess 2011. For me this sounds like a classloader problem.
The theory behind:
Java does not only use the type of the class but also the classloader which loaded it to identify the type of an instance. This means a simle operation could fail, e.g.
ClassA a1 = new a1;
ClassA a2 = SomeOtherClass.giveMeInstanceOfA();
a1 = a2;
This example would fail if SomeOtherClass uses a different classloader because Java would say that they are not the same.
The speaker also mentioned that some servers use per default about 45 different classloaders.
What does this mean in practice:
You deploy your webapp to the server, everything runs fine. The server caches the classes and everything he needs to load them somewhere. Now you make a hot deploymen and the server may loads new classes with a new (or different) classloader. This is the point where it starts to become dangerous because from now on you have two different classes in the memory which should be the same. Simple operations like casts (ClassA a = (ClassA) new ClassA()) fail, new Methods within the class are not found (because the server takes a cached version without this method),....
This is the point where I restart the server, clean the working directory (to get rid of the cached versions) and start thinking about hot deployment as critical thing.
If it is possible to try Mikkos procedere and this solves the problem this explanation could help you understand why.
I know this does not solve your problem but could give you some hints what maybe could have happened.
Speaking of hot deployment of Tomcat, you would indeed experience various problems, the least of which is memory leak, which is why you would have to restart the application. I would recommend to try JRebel for fast turnaround of "make and save any changes and then refresh the browser and see the changes immediately". You can find the JRebel hands-on lab, which shows how to use it with Tomcat and Eclipse. http://www.javapassion.com/rebels/jrebel_basics/
I have gained some new experience on programming and I am not anymore starving on Eclipse + Tomcat combination. Several ways here can help you out of the need of the usage of that combination:
First of all, don't use them together!
You can use other available IDEs, e.g. IntellijIdea (that is not free, but is worth of investing) has an property that when you debug a Java code, you can change code on fly and compile the Java files one by one and then it suggests if you'll want to have it updated on server. No restart needed almost never (of course it sometimes gets lost, but mainly it works).
Use standalone tomcat server, not the one inside Eclipse / your IDE. That first trick works only when you debug external server, nothing inside IDE. There comes the second tip: if you happen to change only jsp or html content, those files can be copied to the right place inside tomcat's webapp folder manually with unix cp or windows copy command and if you happen to develop files in same foulder long time, you can copy the folder content (e.g. myFolder/*.jsp) as many times as you wish and no restart is needed at all. The changes come visible when you touch or edit&save the web.xml file inside the webapps folder and then after that with refreshing the visible page on browser. Probably hard refresh with CTRL+F5 is the best way.
Thanks to #Verdan about his comment, otherwise I wouldn't have came back to answer again.
I was able to solve this by disabling the maven nature (right click on project >> maven >> disable maven nature). Then re-enabling it (right click on project >> configure >> convert to maven project). I had tried all of the other tips and tricks above, but this is the one that finally worked.
I was running into the same problem - tried all of the above, Eclipse always freezed when i tried to start the server, even after i deleted all the server configs and created a new one with a freshly downloaded tomcat instance. Anyways, problem wasnt solved until i moved to a new workspace, reimported the projects and created a new server. Seems like an Eclipse bug to me...So in case nothing else works, this is the way to go...
I'm currently struggling with the same problem, but nothing mentioned here does not help me. Anyway, I found out that if I:
stop server in eclipse
run tomcat elsewhere (in my case the xamp distribution)
stop currently running tomcat
start tomcat in eclipse
everything works just fine, of course until I change something in code and try to test it again.
I'm having this problem in eclipse (EE) when I change things in my code (even something as simple as the text I'm printing using println) it doesn't get applied. I'm using JBoss and when I rerun the servlet, nothing happens.
Any idea how I can force JBoss/Eclipse to do this? I can't preview anything so it's really annoying if I want to test some new code.
Thanks!
Eclipse publishes the newer versions of your application periodically (its called the automatic publish feature). Either the interval is too large, or you're not waiting sufficiently long enough for re-deployment, or automatic publishing of the application has been disabled.
Sometimes, despite ensuring the above, Eclipse might still not publish the newer classes, in which case you might want to perform a clean build, which causes the newly built classes to be loaded into JBoss.
Sorry to ask such a basic question: Do you save your changes before testing?
Eclipse uses its own compiler to check for syntax errors while you are editing, but you have to save the file before the edits take effect in the application.
I only ask because this could be confusing if you are new to Eclipse, having changed from a different IDE. File permission settings can also prevent your files from being saved or built.
Working on EJB deployed in JBoss with Eclipse IDE.
We have ANT build file, in which first old project is deleted from JBoss,
then compiling classes, & building proper directory structure & deploy as .ear - .sar again in JBoss directory.
Stop JBoss, run build file, start JBoss.
Its a good practice to have a build file to deploy project.