Connecting Eclipse to Weblogic server hosted on UNIX machine - eclipse

I have weblogic installed on a UNIX machine and my source code is in SVN.
I am trying to use the source code in Eclipse and want to know how I can integrate/connect the weblogic server hosted on UNIX machine so that I can develop/modify my application on Windows machine.

Try using remote debugging. There is a question on StackOverflow about it here: Weblogic remote debugging using eclipse.
This is more detail from Oracle:
In the startWebLogic.cmd script, specify the JAVA OPTIONS with:
set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
The -XDebug parameter enables debugging. The -Xnoagent parameter disables the default sun.tools.debug debug agent. The -Xrunjdwp parameter loads the JPDA reference implementation of JDWP. Debugging is enabled on port 4000. The JDWP protocol is the protocol used to debug with a remote debugger.
Source: Remote Debugging on WebLogic Server
And how to set up the configuration in Eclipse:
Next, configure a debug configuration for the Eclipse project. Select the Debug option in the Debug option list. The Debug frame gets displayed. In the Debug frame select the Remote Java Application node. Right-click on the node and select New. In the Debug configuration frame specify a name for the Debug configuration. Select the project that is to be debugged. Select the EclipseWebLogic project previously created in the Eclipse IDE. Select the default value for Connection Type. In the Connection Properties, specify localhost as the Host and specify the Port as the port that was specified in the startWebLogic batch script of the WebLogic server, [4000]. Click on the Apply button. A remote Java application debug configuration gets added.
Source: Configuring Eclipse for Remote Debugging a WebLogic Java Application

Related

How to debug Spring if project deployed from console to Tomcat server?

I have issue to deploy Spring project directly from Eclipse. It doesn't work if I try run to server option from Eclipse. But same project works fine if I deploy from console to local Tomcat. I would like to debug it by setting break point and also want to see debug output to console as I used many log as logger.info("Listing Walks"); Where is this log if I deploy from console?
on the console in your tomcat folder do
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
bin/catalina.bat jpda start
This starts tomcat in debug mode
Then in in eclipse you can create a remote debug profile to attach to the tomcat process on port 8000

Change remote glassfish server port in Netbeans 7.3

how can I change the default port 8080 when creating a new remote server instance in Netbeans 7.3?
The common way to change this for local glassfish instances is to edit the domain.xml file. But this doesn't work for remote instances. I even changed the local glassfish domain.xml file to use another port than 8080. This affects local glassfish server instances in Netbeans but not remote ones.
Any help would be appreciative.
If GlassFish and Oracle Database are installed in the same system, it results in port conflict as both of them use port 8080.
Here is the procedure to change port number of GlassFish so that you can run GlassFish at a different port number from Oracle to avoid the port conflict.
Find out the folder where GlassFish is installed*.
If you installed GlassFish along with NetBeans, you can find out the folder where GlassFish is installed by using the following procedure.
Select Services window by using Window -> Services in NetBeans IDE
Expand Servers node and select GlassFish Domain
Right click and select Properties option from popup menu
On the right of Domains Folder you can see the folder where GlassFish is installed. For example : C:\netbeans6.8\glassfish-v3\glassfish\domains You can also see the other details regarding Glassfish such as port number, in the same window.
2.Go to the folder where Glassfish in installed.
3.Go into config folder which is as follows (yours might be different): c:\netbeans6.8\glassfish-3\glassfish\domains\domain1\config
4.Open domain.xml using any text editor.
5.Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers. I generally change it to 9999.
6.Save domain.xml.
7.Now you need to remove GlassFish from NetBeans and add it again so that NetBeans IDE understands the new port number. For this do the following:
In Servers window of NetBeans, remove GlassFish by using RemoveServer button after selecting GlassFish server
Click on AddServer and select GlassFish V2 or GlassFish V3 and click on Next
Select the Installation Location of GlassFish and click on Next
Accept defaults and click on Finish
8.Restart GlassFish, if it was already running.
I got my source from a blog post you can find here.

Debugging FuseESB application in Eclipse

Fuse ESB uses karaf server with OSGi.
for the code if anybody has steps to get the debugger for the application it will help.
I am currently using Eclipse Indigo.
As OSGi is used we are using Maven to build the same.
Which plugin will help for Karaf with OSGi
Java allows you to remote debug any JVM running.
So if you start the ESB with a debug argument, then it will run in debug mode listening on port 5005.
davsclaus:/opt/fuse-esb-7.0.1.fuse-084$ bin/fuseesb debug
Listening for transport dt_socket at address: 5005
Then you can do remote debugging from Eclipse using that port number. This is standard Java remote debugging, and Eclipse has a wizard for that already. Its the debug wizard which has a remote debug functionality.
You just need to put the following line in the Fuse ESB startup script (e.g. fuseesb.bat or karaf.bat):
set KARAF_DEBUG=true
After that Fuse ESB will start in debug mode using 5005 port.
1) just run $fuse debug (jboss fuse 6.1.0 version) debug port is 5005,
2) in eclipse or jboss dev studio do following
i) run
ii) debug configuration
iii) remote java application -> create new
iv) host: localhost, port : 5005
v) click on debug
3) put breakpoints in java classes

Eclipse + JBoss Tools won't run webapp to configured JBoss AS

I am using Eclipse 3.7.2 with JBoss Tools 3.3 under Ubuntu 12 and have configured a locally installed copy of JBoss AS 7.1.1 in Eclipse under "Preferences::Server::Runtime" Environments.
However, when trying to run a Java EE application by double-clicking on the project or an .xhtml page I only see "Run As / Run" on Server as an option and I get an HTTP 404 from Apache Tomcat/7.0.26 at localhost:8080. That is, it seems like Eclipse is trying to deploy to a Tomcat server as opposed to the JBoss AS I have configured in "Preferences::Server::Runtime" and I don't get an option like "Run on JBoss" or anything. When I export my application as a war and manually deploy to JBoss AS the app runs fine.
The idea is to add your application to a specific server that you have configured. Additionally; just adding the server runtime isn't enough.
You need to open the Servers view, and from there right click on the background and select New, and then Server. If you choose JBoss Community -> JBoss AS 7.1 here, you can select your previously created Server runtime in the Server runtime environment, or optionally create a new one.
Then comes the mental twist that you need to make. In WTP you don't use the Run As command, but instead right click the server in the Servers view (default name should be JBoss 7.1 Runtime Server, and select Add and Remove. Select one or more applications from your workspace that you would like to run on your server. Click finish when done.
Now right click again on your server, and choose either Start or Debug.

Why eclipse always complain that the tomcat server port is in use?

I have a eclipse web project source code, the name of the project is "My-Proj" .
I download Eclipse Java EE version (Indigo) , extract the achive, then I started the eclipse IDE. After I successfully installed tomcat7 server into the Eclpse IDE. I import my existing project to Eclipse IDE.
Then I run my imported project by choose "Run on server", but eclipse pop up the error message window like below:
I saw the port has been used, so I change the server running port by double click on tomcat server V7 under Eclipse "server" tab, and change the port to 8085 as below (see the right side of the image):
Please right click the image and view the image if you can not see clearly.
I run the project on server again , but I got the same error, port 8080 is in use, why? I have changed the port number to 8085, why it still complain the port 8080?
You need to change the one labeled "HTTP/1.1" not "Tomcat admin port" (in your image above on the right hand side where ports are).
Second you probably have an existing tomcat running that was not shutdown (unless you purposely have something else running on 8080). Shutdown eclipse and then look for any running java process that look like tomcat and kill them.
As Adam said, you'll need to change the HTTP/1.1 port if you want to have Eclipse's tomcat running on a different port to avoid the conflict.
However, this conflict is usually because your installed Tomcat is also running outside eclipse. You probably don't need two Tomcat instances running at the same time, so you might want to shut down the non-eclipse one. You can do this using the services panel in Windows, or using init.d on linux.
If you have multiple tomcat instances, try to change all ports in elipse - tomcat admin port, http/1.1, AJP. It works for me - I have eclipse from tomcat and netbeans on one machine.
Remember about firewall - it may be problem.