Debug application in Jboss 5.1 using local debugging mode in Eclipse - java

I am trying to setup my eclipse project to be able to debug an EJB application that is deployable in Jboss 5.1. To configure the debugging options i used the options described here:
JBoss debugging in Eclipse
I tried the above and it works but with the following limitations:
If i change any code, i have to rebuild the application and re-deploy into Jboss and restart the server. We use ANT to build the project so having to rebuild and re-deploy the application because of a small change is not really ideal.
I managed two approaches:
The first one as described in JBoss debugging in Eclipse. This requires that i copy the war file manually, start up jboss remotely then start the remote debugger in ecliplse.
The second approach is i would still copy the war file manually to jboss but not start jboss remotely. Instead i would start jboss within eclipse. This sort of works but the problem is i still have to do the manual deployment when i make a change.
I have debugged an application within eclipse running in Tomcat before and with that all i had to do is just restart the server if i make a change to the code.
Is it possible to debug an EJB application locally within Eclipse so that if i make a code change all i need to do is restart the server locally and not need to redeploy the war file?

Related

How to find if a particular service is run/started when JBOSS AS is started?

Beginner here! I have two questions.
Background:
I have installed a program (following their installation instructions) by downloading a .zip file and then unzipping it, and then deploying it by executing ant deploy. According to the installation instructions, this deploys my program as a JBOSS AS Service.
Now I want to run the service. According to the user manual of the deployed program, starting the JBoss Application Server will run the service. But the user manual instructs to run a script named run.sh in <jboss-install-directory>/bin folder. But there is no script named run.sh in my <jboss-install-directory>/bin folder. So I started the JBoss AS using the usual ./standalone.sh.
Question 1:
What is meant by a JBoss AS SERVICE?
Question 2:
How can I find a list of all services started/run when JBoss AS is started?
So that I can confirm that my service has been started.
When you say "JBoss AS" service, I guess that we are talking about JBoss in version 7.x, because later versions are either named Wildfly (community edition) or JBoss EAP (enterprise edition).
The JBoss documentation explains the two different deployment modes: automatic or manual. If you did not change anything in the configuration file standalone.xml (as your are starting this configuration), then the automatic mode may be active. In this case JBoss AS deploys your application (which you name "service") automatically and indicates the status by a marker file (for more details see here).

autodeploy web service java with glassfish server 4.1.1?

How can I do to deploy the web service automatically,I have the webService.war file ?I'm working with glassfish 4.1.1 and use a external library postgresql-9.4-1203.jdbc4.jar and I dont know how deploy the .war file thanks.
Not sure what you mean by deploy automatically, however, DeshanR's suggestion is still workable even for 4.1.1. You also have two other options:
You can deploy the war file from the browser by pointing your browser to yourdomain:4848. This will bring you to the glassfish admin console (provided glassfish is up and running and your glassfish is set to use port 4848, which by default it should be). You can then deploy your war file under the applications menu.
If this is a dev environment you can also deploy to your local glassfish from your IDE. This is an example for Eclipse. Connecting your IDE to your local glassfish has the advantage of allowing you to publish changes as you make them.
If you're using the postgres jar file for the JDBC driver and Glassfish's Connection Pool, you will need to restart the server to deploy that file after copying it in to your domain/ext/lib directory.
For the WAR, there is the asadmin command line client, your IDE may have direct support to deploy it from there, you can use the GF administration console, or you can copy the WAR in to the domain/autodeploy directory (assuming you have autodeploy enabled, which is it by default).
There are also HTTP and JMX interfaces, but those are probably not what you're looking for.

Deploy the web application using weblogic adaptor for eclipse

I have installed weblogic 9.2 adaptor for eclipse kepler and try to deploy the application with eclipse. I right click the project and choose run configuration and click on run.
The server already started and i can see in the console,
But in the eclipse server tab it shows as BEA WebLogic Server v9.2 at localhost [proj] [Stopped, Unable to validate weblogic domain].
Any way But the server seems started as when i try to strat the server directly it says server already started.
But the problem is the application is not deployed when i use the plugin.
Also i want to clarify previously when i manually deploy i ran an ant build script which create a EAR file and then i deploy it using web logic web admin console. But now when i use eclipse does eclipse plugin do the build script job of creating a EAR and deploy it or is there i need to do more?
The problem here is eclipse is working on java 6 and weblogic is running on java 5.
The workaround is
add
-Dsun.lang.ClassLoader.allowArraySyntax=true
after -vmargs string in eclipse.ini in your eclipse directory.

Where does WebSphere put the EAR file when RAD does a "Run On Server"? And how to run createEJBStubs on it?

I have a JavaEE-based web app with IBM RAD 7.5 (Eclipse) and WebSphere 7. The app has EJBs with remote interfaces. It runs fine.
I created a new project for JUnit tests, and I'm trying to do a JNDI lookup of the EJB to test it, but I get the following error:
"ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with com.myapp.UserServiceRemote"
To solve this problem, my understanding is I have to run the WebSphere createEJBStubs command to generate remote stubs, so the JUnit app (which is running as a separate application) can look up the EJB.
My question is:
When I run my app from within WebSphere by rightclicking the myappEAR project and selecting "Run As > Run On Server", where does WebSphere put the EAR file that's being run? That is, what folder is it in?
I ask because my understanding is I'm supposed to run the createEJBStubs command on it, which will generated the stubs and put those stubs in the EAR.
Any advice is greatly appreciated, thanks!
Rob
FYI, I followed the instructions here to create an ANT script to build the EJB jar with the stubs included:
http://www-01.ibm.com/support/docview.wss?uid=swg21393419
To speed up processing, an EAR is not actually built. Instead, the application is configured so that each module or JAR file is loaded from the RAD workspace. I would recommend exporting the EAR (from either RAD or the WAS admin console), and then using createEJBStubs on the result.

Using IDEA, how to debug web app that is deployed to local tomcat?

Using IDEA, how to debug web app that is deployed to local tomcat?
Edit your run/debug configurations and add a "remote" configuration. Instructions contained in that very dialogue.
I don't believe the remote configuration instruction is necessary. Just add breakpoints to your Java classes or JSPs and run in debug mode. If Tomcat is local to your machine, that's all you need to do.

Categories

Resources