Getting a project started in JBoss within Eclipse - java

I've inherited a project which i'd like to test in JBoss - the problem is I cant get it to start within Eclipse. It works outside of Eclipse but I have to do a maven build, deploy the WAR files to JBoss and restart JBoss each time I make a change which is a nightmare.
In Eclipse I have added a JBoss 6 server, started it which appears to be fine (i.e. no errors in the console), then I try to run the 2 applications (one server then one client) - however nothing gets printed to the console log - no error or anything. It says started pretty much straight away. Just get a 404 error when going to the localhost:8080/name address.
I understand this may be difficult for someone to assist me here as there is no error message but if anyone has any suggestions or advice it would be much appreciated. I would have thought this should be simple but dont know what im doing wrong...

Eclipse may be running the JBoss server so it listens to a different port. Either that or the 8080 port is already bound so Eclipse can't open it.
Try configuring the JBoss project in Eclipse so it listens at a different port.
[Edit]
Here is a thread on jboss.org that discusses changing the port used by JBoss when running in Eclipse.

Related

JPDA doesn't seem to work in IDEA deployed with JBoss

I have a Java project which is deployed on remote JBoss server that I'm trying to debug using JPDA in IDEA.
The following was added to JBoss config to turn this feature on:
"JAVA_OPTS=$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
I created a new debug configuration in IDEA for the server and it seems that the port is opened and I'm able to connect:
Connected to the target VM, address: 'here's goes the IP:8787', transport: 'socket'
However, when I add breakpoints in the app it doesn't seem to stop executing the code.
There's a REST controller which is I'm absolutely sure should trigger the breakpoint when request is sent to the server. But for some reason that's not the case.
Here's what I've tried so far:
Invalidate Caches/Reset IDEA
Make request to server via Postman instead of browser
But with no luck.
The code on the server should match with my local project.
I'm pretty convinced that the problem has to be on my side.
I've only debugged applications deployed with Tomcat, maybe there's something specific about JBoss?
Might be related to IntelliJ IDEA: Breakpoint not being hit, and is shown without the tick, just a red dot since there's no ticks and also gradle is used.
In addition, I remember when I debugged a tomcat + maven project with JPDA and added breakpoint, IDEA would evaluate and calculate something for a considerable amount of time but in the current project there's no sign of it.

Eclipse with Weblogic 12c is not stopping in breakpoints

I hope you could help me. I'm newbie in Weblogic and debugging in Eclipse. I've followed different threads like this, but I'm not able to make Eclipse stop at WS breakpoints. This is how I have it currently configured:
1.- I have raised Weblogic 12c from the command line (the NodeManager is also raised) debugging in 8453 port:
Console
2.- I've launched Remote Aplication Debug in Weblogic in 8453 port:
Eclipse Debug
3.- However, if I launch a Webservice request, and having breakpoints within the Webservice code, the application does not stop at those breakpoints: Breakpoint
It seems that when I launch the request, the Remote Java application "ignores" the request, (it looks like nothing happens in debugged VM ,no new threads, nothing).
Maybe I'm listening the wrong port/VM? What could I be doing wrong? Thanks in advance.

The Eclipse plugin cannot communicate with the GlassFish server

I need use Glassfish in a project we're currently working on in Eclipse IDE.
My problem is after installing Glassfish Tools in Eclipse I manage to correctly create a new glassfish server en SERVERS tab but when I try to start it the following error message pop up:
The Eclipse plugin cannot communicate with the GlassFish server....
The Eclipse plugin cannot communicate with the GlassFish server. A
GlassFish Enterprise Server may be running on the same admin or HTTP
port, but with a different root installation.Please also check for
antivirus software, firewall configuration, or VPN setup which might
block some ports.
Actually the problem looks more complex since not only I'm not able to start server but I cannot execute any action on server. Neither deploying, nor clean or whaterever else do work resulting in popping up the above message.
In the internet developers communities I only find clues about CREDENTIAL ERROR but this is not the case.
Looking in the Glassfish log folder there is no trace of any access attempt.
Everythings points at Eclipse plug-in neither be able to communicate with glassfish by any circumstance.
This issue occours either with Glassfish 3.1 (using jdk1.7) and 4.1 (using jdk1.8) and in Eclipse Luna and Mars.
I already tried to create, delete and manage glassfish domains (as suggested in other questions here at StackOverflow) to get over potential "credential-related" issues but no result.
Tried to uninstall and reinstall Glassfish Tools from Eclipse too but still no way.
Both Glasshfish 3.1 an 4.1 start flawlessly manually and NetBeans manage to start them without any problem but, as said, I need to work with eclipse so switching to NetBeans is not the solution (and, please, don't suggest me a manual deploy and server start).
As a last attempt, since I work in Windows, in a console window I tried this:
netstat -a -b
to verify no other service is "taking" port 8080 (although it doesn't seem to be a port problem but a "plug-in communication" one) but it resulted free.
I'm into this mess by days.
Please help.
Thank you
I had exactly the same problem. When I set "preserve sessions across redeployment" in the Eclipse properties dialog for GlassFish, tab "GlassFish", to false (true being the default), everything worked out fine.
I just set the proxy configuration in Eclipse menu Window -> Preferences -> General -> Network Connections (changing the Active Provider value from "Native" to "Manual" and inserting all the needed values for HTTP and HTTPS rows) and added "localhost" and "127.0.0.1" to the section "Proxy bypass".
I have faced the same problem. Generally, the programs that get dynamicly port numbers causes this. Etc: skype, teamviewer.
For me, I solved the problem with starting eclipse before them.
Maybe this works for you too.
I had the same problem, and I solved it by removing the glassfish server from Eclipse, and adding it again.
What I noticed in my own case was that other applications where using port number 4848, so I had to stop all use of port 4848 and restart the domain again ( restart glassfish server )

How do I debug Java servlet filters, on-the-fly, from a remote machine (I'm using Eclipse and Apache Tomcat 5.5)

I wrote a Java servlet filter on my local machine and deployed it a remote (machine) web server. Unfortunately, it's been very difficult and time-consuming trying to trace errors reported by Apache Tomcat 5.5, my JSP/servlet engine. I can't keep writing System.out.println(...), saving, deploying, testing JSP pages, and so on. It's taking too long. There has to be a better, faster way.
Is it possible to remotely debug servlet filters? I don't have a web server on my local machine, which is why I'm asking about remote debugging. Specifically, I'm looking for a way to debug, line-by-line, the servlet filter, on-the-fly, as it's happening on the remote web server. Does such a method exist?
Or, is there a better method than writing to standard output. It's taking too long and I feel that must be a more efficient means of debugging Java servlet filters.
Note: I'm using Eclipse for development.
Thank you very much for any help.
Update
Thank you all for your help. I really appreciate it.
I added the JVM argument to Tomcat, restarted Tomcat. Then, on the machine with Eclipse, I entered in the appropriate info in the Debug config, put the breakpoint in, and tested. Unfortunately, it did not work. In the config, I left it as Socket Attach, clicked apply, and that was it. I pressed the debug button and it said the connection was refused. I tried ports 8000 and 8001 and both did not work.
Let me explain what I'm trying to do, that might be better.
I have a login page called login.jsp. On that page, is a form whose action attribute is servlet/LoginServlet. When the user submits the form, it calls servlet/LoginServlet, which is mapped to a class in the web.xml file. Let's call this class com.mysite.mypkg.classA. In class A, it calls a method from another class called com.custom.mypkg.classB. I want to put a breakpoint in classB.
So, using the url with login.jsp page in the Eclipse debugger won't call it. I tried using servlet/LoginServlet and that also did not work.
What should I put in for the URL? Or, do I debug this type of setup?
Thank you.
Update 2
I found this site here, which is pretty comprehensive. I ran netstat -a and noticed that the debug port is not listed. Windows Firewall is turned off, but there could be another thing blocking the port, who knows. Anyway, I placed the VM argument here and it's not working.
Thank you.
For remote debugging you need to start the server in debug mode. There are couple of ways doing that.
1 > start the server using
catinlina.bat jpda start
2 > Add an jvm argument to the tomcat java process
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
Once the server is started in debug mode , you need to change the perspective of the project in eclipse to debug.
Then go to Run - > Debug configuration.
Double click remote java application and enter the details such as
Remote IP address
Debug port . Default tomcat debug port is 8000. If you use jvm argument, use the port mentioned in the jvm argument.
Click Apply
Go to the java file you want to debug.
Put a break point in the source code and run the scenario you want to test (Eg Web application using browser)
Also , ensure that the code in the java file is in sync with code deployed on remote server.
Happy Debugging!!!
Peace.
Sanket Raut
You can attach a debugger to a running Tomcat instance, provided that you gave it the right command line options when you launched it.
The Tomcat Development Wiki explains how to do this, and as a bonus gives you instructions on how to set up to debug from the Eclipse or NetBeans IDEs.
Of course, attaching a debugger to a running Tomcat has both security and performance implications*.
* And OH&S issues - you might get badly scratched if you tried this on the wrong kind of tomcat ...
You should run your remote tomcat with the following starup parameter:
bin/catalina.bat jpda start
Then in Eclipse on your local machine go to Run -> Debug Configurations -> Remote Java Application, create new configuration here, use IP of the remote machine as a host and 8000 as a port there
Run this configuration and use the breakpoints in Eclipse for debugging

Can't debug using eclipse and weblogic 8.1 ( weblogic 10 works fine)

first of all, Is it possible to debug web apps with eclipse and weblogic 8.1.
I can successfully debug with weblogic 10.
in weblogic 8.1 when I click on debug server from eclipse it shows me a debugging warning about debugging jsp pages. and then starts. when It start, the server state shows in eclipse as "started" not debug compared to weblogic 10 and break points dont work at all.
I did set up my startWLS.cmd file correctly for debugging.
I m using eclipse 3.4
I believe you are using some kind of plugin to eclipse that allows you to debug code running on weblogic without being notified about the gory details of the process.
Actually what happens is that your are running weblogic as external process (even if you see its stdout into the eclipse console) and connect to it with remote debugger.
So, probably your plugin does not support weblogic 8.
But it is very simple to debug any java application remotely.
The following article describes how to do this: http://eclipse.dzone.com/articles/how-debug-remote-java-applicat
Shortly you have to add the following options when your run your application:
-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y
Just find the bat/cmd/sh script that runs weblogic and modify it.
Then start remote debugging by Run/Debug Configurations/Remote Java Application
and configure the port your specified when your ran your application.
Stack Overflow is cool site, but you will likely get more on-topic responses to your question by asking it on Oracle's eclipse tooling forum:
http://forums.oracle.com/forums/forum.jspa?forumID=578

Categories