Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Application is loaded by 2 classloaders
icon5.gif  Application is loaded by 2 classloaders [message #522837] Wed, 24 March 2010 07:39 Go to next message
Svetoslav Missing name is currently offline Svetoslav Missing name
Messages: 17
Registered: July 2009
Junior Member
Hi all.

I have a problem with my web application. I am using Eclipse Galileo SR2, WTP 3.1.1. I am deploying my application on tomcat. I have these options for the server configuration:

* Use tomcat installation (takes control of tomcat installation)
* Server path: wtpwebapps (I have tried with webapps also)

For the project configuration I have tried with and without associating Target Runtime and Server.

The web app is added to the server.

When I log in to my app (I am using pluto) first 1 of my classes (Singleton) responsible for several initializations is loaded with 1 classloader and a little later is loaded again with different classloader.

I have tested that with Ganymede and it was not working. Probably some improvements to the Ganymede are done because with older Eclipse (Europa) and same code and configuration this problems is gone. How can I turn off this Eclipse class loading and delegate all of these tasks to tomcat?

Thank you!
Re: Application is loaded by 2 classloaders [message #522975 is a reply to message #522837] Wed, 24 March 2010 16:26 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
Svetoslav wrote:
> Hi all.
>
> I have a problem with my web application. I am using Eclipse Galileo
> SR2, WTP 3.1.1. I am deploying my application on tomcat. I have these
> options for the server configuration:
>
> * Use tomcat installation (takes control of tomcat installation)
> * Server path: wtpwebapps (I have tried with webapps also)
>
> For the project configuration I have tried with and without associating
> Target Runtime and Server.
> The web app is added to the server.
> When I log in to my app (I am using pluto) first 1 of my classes
> (Singleton) responsible for several initializations is loaded with 1
> classloader and a little later is loaded again with different classloader.
> I have tested that with Ganymede and it was not working. Probably some
> improvements to the Ganymede are done because with older Eclipse
> (Europa) and same code and configuration this problems is gone. How can
> I turn off this Eclipse class loading and delegate all of these tasks to
> tomcat?
>
> Thank you!

I must not be understanding what you are doing. There is no Eclipse
class loading to turn off in Tomcat. When Tomcat is started it runs a
JVM in a separate process and which does all its own class loading.
What am I missing?

Cheers,
Larry
Re: Application is loaded by 2 classloaders [message #523422 is a reply to message #522975] Fri, 26 March 2010 12:30 Go to previous messageGo to next message
Svetoslav Missing name is currently offline Svetoslav Missing name
Messages: 17
Registered: July 2009
Junior Member
Hi.

You are right. It appears that tomcat is running 2 classloaders and Eclipse has nothing to do with that. However, I cannot get it working as it should. I will ask a question in tomcat's forum.. If someone here has experienced similar behavior and has some idea I will be grateful for any info. Thank you and sorry for the post.
Re: Application is loaded by 2 classloaders [message #523432 is a reply to message #523422] Fri, 26 March 2010 13:38 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
Svetoslav wrote:
> Hi.
>
> You are right. It appears that tomcat is running 2 classloaders and
> Eclipse has nothing to do with that. However, I cannot get it working as
> it should. I will ask a question in tomcat's forum.. If someone here has
> experienced similar behavior and has some idea I will be grateful for
> any info. Thank you and sorry for the post.

I believe there has been, or still is, a quirk in server "publishing".
If you remove a project from a server and restart Eclipse without
publishing the server, the server handling may fail to remember that
though the project has been removed, the published copy of the project
still needs to be deleted from the server. This published copy can get
left behind. Normally for Tomcat, this copy gets left behind under
"wtpwebapps" and has no impact when the Tomcat server is run (i.e. there
is no <Context> to serve it). However, if you used the "webapps" folder
instead of "wtpwebapps", a published project left behind under "webapps"
would continue to be served. While it's more likely the cause of the
problem is in your web application, this scenario could be a
possibility. If you think the scenario is possible, just create a new
Tomcat server, add your project, then see if the same symptom appears.
If it does, you have confirmation it's not a "left behind" published
project.

Note: The only "pluto" I'm aware of is Apache Pluto, which is a portlet
container and not a servlet container. I don't know enough about
portlet containers to say if this could explain the behavior you are
seeing, but I know there are differences.

Cheers,
Larry
Previous Topic:Which Web Service Stacks are supported by WTP? Metro, CXF, JBossWS, Axis 2
Next Topic:WTP for Java SE web service clients?
Goto Forum:
  


Current Time: Thu Oct 02 06:45:13 GMT 2014

Powered by FUDForum. Page generated in 0.02219 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software