Cannot see sources will debugging on local JBoss server - java

I have a project producing a .war file, I created a local JBoss 7.1 server in eclipse referencing my local JBoss installation. Then I start the local server in debug mode, copy my war file to {JBOSS_HOME}\standalone\deployments, and it deploys it correctly.
But when I add a breakpoint in eclipse, the code stops like it should, but showing me a "Source not found" white page.
How can I link or synchronize the source code to my local server?
Thank you.

Okay so I solved my problem and it seems pretty obvious now that I found it :
My project is generating a projectname.war, and a projectname-sources.jar, I just had to deploy also the projectname-sources.jar...

Related

tomcat unable to publish due to deleted java.orig file

I used a merge tool to merge my code with the upstream branch which created a .orig file for one of my java classes. After verifying that everything was working fine I saw not need to keep the .java.orig file around so I deleted it.
Now whenever I try to deploy to tomcat from eclipse I get the following error:
'Publishing to Tomcat v8.0 Server at localhost..' has encountered a problem.
Resource '.../MyClass.java.orig' does not exist.
I've tried removing all applications off the server and removing the server from eclipse and then recreating it but to no avail.
I'm running out of things to try and I'm not sure what dependency tomcat thinks my project has on the .orig file. Any help is appreciated.
Ok so rebooting my machine seemed to have fixed the issue I was able to start tomcat normally after that using the same eclipse workspace. I'm not sure what the underlying issue actually was but the restart seemed to fix it.

Glassfish 4 deployment error

I added some libraries to my JavaEE project and then deploy the application works. I modified something and I got this error message in Eclipse:
Cannot Deploy ProjectName
deploy is failing=Error occurred during deployment: Keys cannot be duplicate.
Old value of this key property, nullwill be retained.
Please see server.log for more details.
java.lang.LinkageError: loader (instance of
org/glassfish/web/loader/WebappClassLoader):
attempted duplicate class definition for name:
"org/glassfish/web/loader/JdbcLeakPrevention"
loader (instance of org/glassfish/web/loader/WebappClassLoader): attempted duplicate
class definition for name: "org/glassfish/web/loader/JdbcLeakPrevention"
I made some research and I found out that it is not an Eclipse bug. I'm working with Kepler but I tested with Juno too. Got the same error message.
I downloaded Glassfish 3.1.2.2 and the message gone.
Why am I getting this message?
I Had the same error. I stopped the GLassfish server and then I cleaned the project (Project -> Clean... ). Started the server and worked
I also had this issue, and I was also using the SVNKit library plus its dependencies so it looks like there is some kind of conflict there. I can get around it by cleaning out the osgi-cache folder & restarting glassfish, but I have to do this every time I want to deploy, so not a great solution.
Try to remove all the files under osgi-cache and generated directories. It worked for me.
In my Glassfish log file it says:
Application with name ws is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name
Following my logs instructions I deployed the app with --force option:
asadmin deploy --force=true ws.war
and it worked. More info on deploy --force=true
Try to clean autodeploy directory, restart the server.
Also clean the project deployment directory.
following steps worked for me.
stop the glassfish server(if running)
kill all the java process (using terminal or activity monitor)
now try redeploy.
Was somehow related to a single #Singleton bean. Converted it to #Stateless and everything worked fine. Not quite sure why this happened...

Webapp shows 404 page after project renaming

I have been working on this web application using Eclipse and m2e (maven plugin for Eclipse).
After a while I decide to change the project name in eclipse doing: Right click on project >> refactor >> rename
Following this I see a few errors coming up, mostly to do with classpath configuration & java versions mismatch. I fix them, adding the maven dependencies to the build path, and updating the java versions to be used during compilation & run time.
I rebuild my web app & restart my server (Tomcat in this case). Open my browser to go to my app's root url. And I get a 404 page (everything looks fine in the console btw).
I've been going through my buildpath and classpath config to double check if anything was coming from there but everything seems fine. I'm confused and unsure where to look at.
Thanks in advance
This really depends on your Setup. If you are using the default path, it is (as Kal said) myserver/newappname.
If you are using a url that you have configured in webserver for easier readability like (myapp.myserver.com) you would have to change the redirection in your server from your old appname to the new one.
Actually,
404 HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested.
1. Check your path with newapplication name.
2. See inside your server, Is there a resource with (newNameApp.war)?
3. As you are using maven, try to build the project and see the log, by which name war is generated, and where the war got placed.
I faced the same situation and simply restarted Eclipse and no more 404 afterward

Running JSP application using tomcat 6.0 and Eclipse

I am working on an academic project using Eclipse 3.X , jsp's, servlet's etc. The server i chosed to deploy my application is "Tomcat 6.0".
when i change any of my code in the application, i am facing problem with running the application. the changes in the code are not showing any affect even though i restart the server. the changes only get affected, if i restart my eclipse. i tried lot of ways by googling about integration of eclipse with tomcat but nothing worked?. I always have to restart the eclipse, to see my changes.
Please help me with this issue.
thanks in advance.
You should simply be able to use the "republish" feature after saving/building.
1, If the development path and deployment path is the same dictionary, make sure that the "Build Automatically" is checked, it's in "Project->Build Automatically", it can help you deploy the files which are changed.
2, If the development path and deployment path is not the same dictionary, you can write an ant task to deploy project.
if u are running in eclipse it is running the tomcat server of eclipse so for changes to be affected it should be refresh so u have to restart eclipse better way is to use outside eclipse and use localhost and tomcat manager u can restart and can see the changes or use ajax

wtpwebapps/myapp is empty when running Tomcat under Eclipse

I know that tomcat is running because when I type http://localhost, the tomcat page dispay. My problem is I can't figure out why the wtpwebapps/myapp is empty, is like the eclipse doesn't publish it and when i type http://localhost/myapp, I get 404 error.
In the server overview :
Server Location is set to "Use Tomcat installation" | server path: the servers's folder | deploy path : wtpwebapps
Server Option : Publish module contexts to separate XML file
Publishing : Automatically publish when ressource change
I use eclipse Ganymede 3.4.2, tomcat 6.0, under Win7
Any help would be appreciated, thanks
your files must be somwhere, so start searching in:
<YOUR_WORKSPACE_DIR>\.metadata\.plugins\org.eclipse.wst.server.core\tmp<SOME_NUMBER>\wtpwebapps
I had a similar problem, when updating our project (.project and .classpath are checked in for convenience, but causes sometimes problems).
Console-Log in eclipse always says:
Error configuring application listener of class org.sth.ThisClass
java.lang.ClassNotFoundException: org.sth.ThisClass
The reason was that $WORKSPACE_DIR/.metadata/.plugins/org.eclipse.wst.server.core/tmp$NUMBER/wtpwebapps/$CONTEXT/WEB-INF/lib/classes was empty. The solution was to enter under Project Properties > Deployment Assembly an entry:
Source: /src
Deploy Path: WEB-INF/classes
If you use a Maven in your project, this is a solution for you:
Delete the project(s) in the Eclipse.
create project from Maven sources (select your workspace directory).
Check found pom.xml to import.
Restart the Tomcat.
Try to look into servers explorer and it will show you what state is your application at and if its deployed.
Since I had difficulty finding where this "server overview" is, I like to add that you just double click on a server under the "servers" view. I kept on right click and look at the "Properties" and was not getting to this information.

Categories

Resources