Skip to main content



      Home
Home » Eclipse Projects » Equinox » debug servlet activator
debug servlet activator [message #99655] Mon, 15 October 2007 13:07 Go to next message
Eclipse UserFriend
I deployed a servlet
I can get to localhost:9080/app/sp_test
When I run localhost:9080/app/myServlet I get a 500
How do I debug that ? :)

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Re: debug servlet activator [message #99664 is a reply to message #99655] Mon, 15 October 2007 13:24 Go to previous messageGo to next message
Eclipse UserFriend
Christophe Elek <Christophe.Elek@gmail.com> wrote in
news:Xns99CA858DA5A43celekcaibmcom@206.191.52.34:

> I deployed a servlet
> I can get to localhost:9080/app/sp_test
> When I run localhost:9080/app/myServlet I get a 500
> How do I debug that ? :)

My JAR file with my servlet inside is locked by Tomcat...
So it seems it is found right ?

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Re: debug servlet activator [message #99777 is a reply to message #99664] Mon, 15 October 2007 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Christophe Elek <Christophe.Elek@gmail.com> wrote in
news:Xns99CA886A13835celekcaibmcom@206.191.52.34:

> My JAR file with my servlet inside is locked by Tomcat...
> So it seems it is found right ?

Yet, it seems (using remote debug) that my Activator.start() is never hit
:(

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Re: debug servlet activator [message #99786 is a reply to message #99777] Mon, 15 October 2007 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christophe,

A 500 would normally indicate the request is reaching your servlet but an
error is occuring inside.
Try placing a break point in your Servlet's init and service method and see
what happens.

How are you contributing your servlet? via the "servlets" extension or
directly via the Http Service interface?
Is your bundle's manifest marked Eclipse-LazyStart: true ?

HTH
-Simon



"Christophe Elek" <Christophe.Elek@gmail.com> wrote in message
news:Xns99CA8997E41E2celekcaibmcom@206.191.52.34...
> Christophe Elek <Christophe.Elek@gmail.com> wrote in
> news:Xns99CA886A13835celekcaibmcom@206.191.52.34:
>
>> My JAR file with my servlet inside is locked by Tomcat...
>> So it seems it is found right ?
>
> Yet, it seems (using remote debug) that my Activator.start() is never hit
> :(
>
> --
> Christophe Elek
> Serviceability Architect
> IBM Software Group - Rational
>
Re: debug servlet activator [message #99798 is a reply to message #99786] Mon, 15 October 2007 15:23 Go to previous messageGo to next message
Eclipse UserFriend
"Simon Kaegi" <simon_kaegi@ca.ibm.com> wrote in news:ff0dfu$n6c$1
@build.eclipse.org:

> How are you contributing your servlet? via the "servlets" extension or
> directly via the Http Service interface?
> Is your bundle's manifest marked Eclipse-LazyStart: true ?

Simon, Thx
Sorry I do not even get the 500 :( I get the tomcat resource not found
Seems to me the resource is not even registered with the server

In any case, I will check and confirm

I use the HTTPServiceTracker (I basically copied the HelloWorld and added
my own code)
The manifest is like the hello world one:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Server Logger
Bundle-SymbolicName: org.eclipse.server.logger
Bundle-Version: 1.0.0
Bundle-Activator: org.eclipse.server.logger.Activator
Bundle-Localization: plugin
Import-Package: javax.servlet,
javax.servlet.http,
org.osgi.framework;version="1.3.0",
org.osgi.service.http;version="1.2.0",
org.osgi.util.tracker;version="1.3.1"
Require-Bundle: org.eclipse.osgi.util,
org.eclipse.osgi,
org.eclipse.core.runtime

Thanks for the help :)

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Re: debug servlet activator [message #99810 is a reply to message #99798] Mon, 15 October 2007 16:32 Go to previous messageGo to next message
Eclipse UserFriend
I suspect your bundle is not started as that's when the registering occurs.
There are a couple of fairly easy things you might try:
1) If you're just testing things out I'd suggest using the console to
explicitly start your bundle.
2) add your bundle in config.ini (and @start it)
3) use the "servlets" extension.

In most cases I'd suggest (3) as it promotes lazy activation of your
bundles.

A few days ago Eike Stepper made a post about using an IApplication to
manage the lifecycle of a server-side application and I agree. In an
application where using the "servlets" extension is not sufficient this is a
good path to investigate.
-Simon


"Christophe Elek" <Christophe.Elek@gmail.com> wrote in message
news:Xns99CA9C9575BA0celekcaibmcom@206.191.52.34...
> "Simon Kaegi" <simon_kaegi@ca.ibm.com> wrote in news:ff0dfu$n6c$1
> @build.eclipse.org:
>
>> How are you contributing your servlet? via the "servlets" extension or
>> directly via the Http Service interface?
>> Is your bundle's manifest marked Eclipse-LazyStart: true ?
>
> Simon, Thx
> Sorry I do not even get the 500 :( I get the tomcat resource not found
> Seems to me the resource is not even registered with the server
>
> In any case, I will check and confirm
>
> I use the HTTPServiceTracker (I basically copied the HelloWorld and added
> my own code)
> The manifest is like the hello world one:
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Server Logger
> Bundle-SymbolicName: org.eclipse.server.logger
> Bundle-Version: 1.0.0
> Bundle-Activator: org.eclipse.server.logger.Activator
> Bundle-Localization: plugin
> Import-Package: javax.servlet,
> javax.servlet.http,
> org.osgi.framework;version="1.3.0",
> org.osgi.service.http;version="1.2.0",
> org.osgi.util.tracker;version="1.3.1"
> Require-Bundle: org.eclipse.osgi.util,
> org.eclipse.osgi,
> org.eclipse.core.runtime
>
> Thanks for the help :)
>
> --
> Christophe Elek
> Serviceability Architect
> IBM Software Group - Rational
>
Re: debug servlet activator [message #99826 is a reply to message #99810] Mon, 15 October 2007 17:00 Go to previous messageGo to next message
Eclipse UserFriend
"Simon Kaegi" <simon_kaegi@ca.ibm.com> wrote in news:ff0ioo$mar$1
@build.eclipse.org:

> In most cases I'd suggest (3) as it promotes lazy activation of your
> bundles.

Nah, no luck, unless I did something wrong :(
I tried #3 and #2, same error in tomcat
What is weird is that I can see the bundles under the bridge app when I do
'ss'
But I cannot see the one in my application :(

Do we have a trace i could start ? Or should I put my debugger in a certain
class ?

Thanks again :)

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Re: debug servlet activator -> FIXED [message #99902 is a reply to message #99655] Tue, 16 October 2007 13:01 Go to previous message
Eclipse UserFriend
Christophe Elek <Christophe.Elek@gmail.com> wrote in
news:Xns99CA858DA5A43celekcaibmcom@206.191.52.34:

> I deployed a servlet
> I can get to localhost:9080/app/sp_test
> When I run localhost:9080/app/myServlet I get a 500
> How do I debug that ? :)

Simon helped me
1) I removed the bridge application
2) I modified the web.xml of my application as follow:

<init-param>
<param-name>enableFrameworkControls</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>commandline</param-name>
<param-value>-console -consolelog</param-value>
</init-param>

When I started my Tomcat I finally saw the exception involving *MY* code :)
Now I am working on fixing it :)

--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Previous Topic:Remote OSGi
Next Topic:java.lang.InstantiationException in plugin
Goto Forum:
  


Current Time: Wed Jul 16 17:15:43 EDT 2025

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

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

Back to the top