Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange issue..I think java class is not getting build, not able to print simple SOP on console

 
Vinod Vijay
Ranch Hand
Posts: 150
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm working on enterprise level java project in my company. I'm using eclipse here and my project is developed upon EJB, thousands of Core Java classes, JSP/Servlets, PL SQL.

I'm facing a very strange problem. I have written a very small piece of java code and to test that i have placed a simple SOP also to print the output but unfortunately that simple code not even my SOP is getting reflecting on eclipse's server console and accordingly my logic is not working. Then i used logger class also(logutils) to capture the output but still hard luck

Here is my code:-


I have checked my eclipse settings, its 'build automatically' only. I deliberately refreshed project, then cleaned, closed and opened eclipse again and again & finally once again manually build all project but still hard luck. I ran server on debugging mode. I can clearly see that the control is passing over my written code but why it is not printing anything even a simple System.out.println() on server's console.

Any idea. I'm stuck. Tried alot..Googled but no help...


Eclipse build settings.GIF
[Thumbnail for Eclipse build settings.GIF]
screen 1.GIF
[Thumbnail for screen 1.GIF]
screen 2.GIF
[Thumbnail for screen 2.GIF]
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you redeployed your application to the server? The build automatically option in eclipse will not do this step for you.
 
Vinod Vijay
Ranch Hand
Posts: 150
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Boswell wrote:Have you redeployed your application to the server? The build automatically option in eclipse will not do this step for you.


I'm sorry, I didn't get you. Just for your information, I'm trying to run this application on jboss server on my local machine only.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you changed the code and rebuilt the application (into an ear or war file), did you reload (redeploy) the application on JBoss.

The point I am trying to make is that changes you have made through eclipse (regardless of whether the build automatically option is on or not) will not be reflected on the application server (in your case, JBoss) until the application has been redeployed.
 
Vinod Vijay
Ranch Hand
Posts: 150
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Boswell wrote:When you changed the code and rebuilt the application (into an ear or war file), did you reload (redeploy) the application on JBoss.

The point I am trying to make is that changes you have made through eclipse (regardless of whether the build automatically option is on or not) will not be reflected on the application server (in your case, JBoss) until the application has been redeployed.




How can I reload or redeploy on Jboss?
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you have built your application, you should have a WAR file (or perhaps an EAR depending on your requirements).

Copy this file into <JBOSS_HOME>/server/<SERVER_INSTANCE>/deploy

where:

<JBOSS_HOME> - directory where JBoss is installed
<SERVER_INSTANCE> - the server instance you are using. For a basic setup, this will be called 'default'

What version of JBoss are you using?

Copying the file into the deploy folder effectively redeploys the application. The server log should show this happening.
 
Vinod Vijay
Ranch Hand
Posts: 150
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Boswell wrote:Once you have built your application, you should have a WAR file (or perhaps an EAR depending on your requirements).

Copy this file into <JBOSS_HOME>/server/<SERVER_INSTANCE>/deploy

where:

<JBOSS_HOME> - directory where JBoss is installed
<SERVER_INSTANCE> - the server instance you are using. For a basic setup, this will be called 'default'

What version of JBoss are you using?

Copying the file into the deploy folder effectively redeploys the application. The server log should show this happening.


I'm using jboss-4.0.3SP1
 
Carlo Moore
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set up your eclipse to auto publish / deploy for you if you want.
You'll have to configure that within eclipse. There is a server view where you can add your jboss instance. That way you can debug from within eclipse. With this method you can make hot fixes without restarting your jboss instance. Although, when you add or remove method signitures you'll have to restart your jboss.

Either that or you'll have to use ant / maven to build and package your app. Stop your jboss instance then copy it to your deploy directory and start jboss again.

It can take longer to start jboss within eclipse but sometimes the extra debugging power is worth it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic