Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Rally Basic Equinox/Servlet Bridge Problem
Rally Basic Equinox/Servlet Bridge Problem [message #116163] Fri, 15 August 2008 22:57 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
All,

I have Tomcat 5.5 running with the bridge.war deployed.

tomcat responds properly to sp_test. I can deploy plug ins and see them
using osgi> ss. When I attempt to start them:

osgi> start xx

I find myself winding down the road to what looks like dependency hell.

Am I correct in thinking that all dependent plug ins from the eclipse
platform must also be deployed? I seems logical after all that's the way
RCP works.

Next question:

Must I explicitly start each plug in or just those that have servlets?

Next question:

If the bridge servlet is forwarding a request to one of my servlets, what
would be the URL for my servlet since I'm not entering into web.xml? I
deployed that sample.http servlet, it shows as active, but things like:

http://localehost:8080/bridge/helloworld yield a 404.
Re: Rally Basic Equinox/Servlet Bridge Problem [message #116179 is a reply to message #116163] Sat, 16 August 2008 14:03 Go to previous messageGo to next message
Simon Archer is currently offline Simon ArcherFriend
Messages: 24
Registered: July 2009
Junior Member
The OSGi dependency rules are no different whether you're running with
the servlet bridge inside a container or just a regular OSGi app. I
suggest using the "diag" command at the OSGi prompt to diagnose your
dependency problems:

- Use "ss" for a short status.
- Use "diag <id>" to diagnose the INSTALLED bundles.

It also sounds like your config.ini is not correct. You need to make
sure that at least the bundles that register servlet programmatically
are started; these bundles have no other way of getting started since
they are accessed via an HTTP request.

> http://localehost:8080/bridge/helloworld yield a 404.

You should try the following URL since there is no 'e' in localhost:
http://localhost:8080/bridge/helloworld

Give these suggestions a try and post back what you see. The exact
contents of your config.ini is helpful, as is the exact result of the
"ss" console command.

Good luck,

Simon

Geoffry Roberts wrote:
> All,
>
> I have Tomcat 5.5 running with the bridge.war deployed.
>
> tomcat responds properly to sp_test. I can deploy plug ins and see them
> using osgi> ss. When I attempt to start them:
>
> osgi> start xx
> I find myself winding down the road to what looks like dependency hell.
>
> Am I correct in thinking that all dependent plug ins from the eclipse
> platform must also be deployed? I seems logical after all that's the
> way RCP works.
> Next question:
>
> Must I explicitly start each plug in or just those that have servlets?
>
> Next question:
>
> If the bridge servlet is forwarding a request to one of my servlets,
> what would be the URL for my servlet since I'm not entering into
> web.xml? I deployed that sample.http servlet, it shows as active, but
> things like:
>
> http://localehost:8080/bridge/helloworld yield a 404.
Re: Rally Basic Equinox/Servlet Bridge Problem [message #116205 is a reply to message #116179] Mon, 18 August 2008 17:18 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
The "e" in locale was a typo in the posting. I have in fact the correct
spelling in my browser.

Assuming I can get localhost spelled correctly, the correct URL for
accessing a servlet via the bridge should be:

http://localhost/bridge/HelloWorldServlet

Correct? This would be logical, but I keep getting a 404. I am trying to
determine if the bridge is doing something unexpected.
Re: Rally Basic Equinox/Servlet Bridge Problem [message #116231 is a reply to message #116205] Mon, 18 August 2008 21:49 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
Geoffry Roberts wrote:

> The "e" in locale was a typo in the posting. I have in fact the correct
> spelling in my browser.

> Assuming I can get localhost spelled correctly, the correct URL for
> accessing a servlet via the bridge should be:

> http://localhost/bridge/HelloWorldServlet

> Correct? This would be logical, but I keep getting a 404. I am trying to
> determine if the bridge is doing something unexpected.

I replied to myself here so I could include the config.ini and the our put
of osgi> ss.

I've been stepping through BridgeServlet and I don't see how another
servlet gets called from the service method.

config.ini:

#Eclipse Runtime Configuration File
osgi.bundles=org.eclipse.equinox.common@2:start,
org.eclipse.update.configurator@start,
org.eclipse.equinox.http.servletbridge@start,
org.eclipse.equinox.http.registry@start
osgi.bundles.defaultStartLevel=4



osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
Fragments=11
1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
5 RESOLVED javax.servlet_2.4.0.200808151435
9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
Master=0
12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
15 ACTIVE sample.http_1.0.0
Re: Rally Basic Equinox/Servlet Bridge Problem [message #116244 is a reply to message #116231] Tue, 19 August 2008 03:29 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Hi Geoffry,

Everything looks alright to me except possibly the URL.

Try:
http://localhost:8080/bridge/helloworld and
http://localhost:8080/bridge/helloworld.html

--

The BridgeServlet is just a front controller for the real work which is done
in org.eclipse.equinox.http.servlet.internal.ProxyServlet.

You might want to look at the service and processAlias methods if you're
interested in understanding what's going on.

My favorite places to set breakpoints are in the two register methods in
HttpServiceImpl as well as the handleRequest call in
ProxyServlet.processAlias.
After seeing your servlets and resources registered and still having a tough
time understanding what is (or isn't getting called) walk through
ProxyServlet.service.

HTH
-Simon


"Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
> Geoffry Roberts wrote:
>
>> The "e" in locale was a typo in the posting. I have in fact the correct
>> spelling in my browser.
>
>> Assuming I can get localhost spelled correctly, the correct URL for
>> accessing a servlet via the bridge should be:
>
>> http://localhost/bridge/HelloWorldServlet
>
>> Correct? This would be logical, but I keep getting a 404. I am trying
>> to determine if the bridge is doing something unexpected.
>
> I replied to myself here so I could include the config.ini and the our put
> of osgi> ss.
> I've been stepping through BridgeServlet and I don't see how another
> servlet gets called from the service method.
> config.ini:
>
> #Eclipse Runtime Configuration File
> osgi.bundles=org.eclipse.equinox.common@2:start,
> org.eclipse.update.configurator@start,
> org.eclipse.equinox.http.servletbridge@start,
> org.eclipse.equinox.http.registry@start
> osgi.bundles.defaultStartLevel=4
>
>
>
> osgi> ss
>
> Framework is launched.
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
> Fragments=11
> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
> 3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
> 5 RESOLVED javax.servlet_2.4.0.200808151435
> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
> 11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
> Master=0
> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
> 15 ACTIVE sample.http_1.0.0
>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116300 is a reply to message #116244] Tue, 19 August 2008 17:32 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
Simon,

I do appreciate the help thus far but things are not working. I have two
bridge setups, (1) in a stand alone Tomcat instance and another in my
workbench. Both yield a 404. In both, html, jsp, servlets, etc that
don't use the bridge work.

Standby, I'm going to dig in and see if I can figure it out.

Simon Kaegi wrote:

> Hi Geoffry,

> Everything looks alright to me except possibly the URL.

> Try:
> http://localhost:8080/bridge/helloworld and
> http://localhost:8080/bridge/helloworld.html

> --

> The BridgeServlet is just a front controller for the real work which is done
> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.

> You might want to look at the service and processAlias methods if you're
> interested in understanding what's going on.

> My favorite places to set breakpoints are in the two register methods in
> HttpServiceImpl as well as the handleRequest call in
> ProxyServlet.processAlias.
> After seeing your servlets and resources registered and still having a tough
> time understanding what is (or isn't getting called) walk through
> ProxyServlet.service.

> HTH
> -Simon


> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>> Geoffry Roberts wrote:
>>
>>> The "e" in locale was a typo in the posting. I have in fact the correct
>>> spelling in my browser.
>>
>>> Assuming I can get localhost spelled correctly, the correct URL for
>>> accessing a servlet via the bridge should be:
>>
>>> http://localhost/bridge/HelloWorldServlet
>>
>>> Correct? This would be logical, but I keep getting a 404. I am trying
>>> to determine if the bridge is doing something unexpected.
>>
>> I replied to myself here so I could include the config.ini and the our put
>> of osgi> ss.
>> I've been stepping through BridgeServlet and I don't see how another
>> servlet gets called from the service method.
>> config.ini:
>>
>> #Eclipse Runtime Configuration File
>> osgi.bundles=org.eclipse.equinox.common@2:start,
>> org.eclipse.update.configurator@start,
>> org.eclipse.equinox.http.servletbridge@start,
>> org.eclipse.equinox.http.registry@start
>> osgi.bundles.defaultStartLevel=4
>>
>>
>>
>> osgi> ss
>>
>> Framework is launched.
>>
>> id State Bundle
>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>> Fragments=11
>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>> 3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>> 11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>> Master=0
>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>> 15 ACTIVE sample.http_1.0.0
>>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116305 is a reply to message #116300] Tue, 19 August 2008 18:11 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
Geoffry Roberts wrote:

> Simon,

> I do appreciate the help thus far but things are not working. I have two
> bridge setups, (1) in a stand alone Tomcat instance and another in my
> workbench. Both yield a 404. In both, html, jsp, servlets, etc that
> don't use the bridge work.

> Standby, I'm going to dig in and see if I can figure it out.

Here's what I don't understand:

When I call: http://localhost:8080/bridge/helloworld.html

public class BridgeServlet...
...
protected void service...
if (req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) == null) {
String pathInfo = req.getPathInfo();

// At this point, pathInfo = "/helloworld.html"

// Check ...
if (pathInfo == null && isExtensionMapping(req.getServletPath()))
req = new ExtensionMappingRequest(req);
if (enableFrameworkControls) {
if (pathInfo != null && pathInfo.startsWith("/sp_")) {
if (serviceFrameworkControls(req, resp)) {
return;
}
}
}
} else {...
...
// This is a call to a service method in
javax.servlet.http.HttpServlet
servletReference.service(req, resp);
...

I find nothing in this code's path of execution that can reach either
ProxyServlet or HttpServiceImpl much less how a servlet of mine would be
called.

> Simon Kaegi wrote:

>> Hi Geoffry,

>> Everything looks alright to me except possibly the URL.

>> Try:
>> http://localhost:8080/bridge/helloworld and
>> http://localhost:8080/bridge/helloworld.html

>> --

>> The BridgeServlet is just a front controller for the real work which is
done
>> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.

>> You might want to look at the service and processAlias methods if you're
>> interested in understanding what's going on.

>> My favorite places to set breakpoints are in the two register methods in
>> HttpServiceImpl as well as the handleRequest call in
>> ProxyServlet.processAlias.
>> After seeing your servlets and resources registered and still having a
tough
>> time understanding what is (or isn't getting called) walk through
>> ProxyServlet.service.

>> HTH
>> -Simon


>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>>> Geoffry Roberts wrote:
>>>
>>>> The "e" in locale was a typo in the posting. I have in fact the correct
>>>> spelling in my browser.
>>>
>>>> Assuming I can get localhost spelled correctly, the correct URL for
>>>> accessing a servlet via the bridge should be:
>>>
>>>> http://localhost/bridge/HelloWorldServlet
>>>
>>>> Correct? This would be logical, but I keep getting a 404. I am trying
>>>> to determine if the bridge is doing something unexpected.
>>>
>>> I replied to myself here so I could include the config.ini and the our put
>>> of osgi> ss.
>>> I've been stepping through BridgeServlet and I don't see how another
>>> servlet gets called from the service method.
>>> config.ini:
>>>
>>> #Eclipse Runtime Configuration File
>>> osgi.bundles=org.eclipse.equinox.common@2:start,
>>> org.eclipse.update.configurator@start,
>>> org.eclipse.equinox.http.servletbridge@start,
>>> org.eclipse.equinox.http.registry@start
>>> osgi.bundles.defaultStartLevel=4
>>>
>>>
>>>
>>> osgi> ss
>>>
>>> Framework is launched.
>>>
>>> id State Bundle
>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>> Fragments=11
>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>> 3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>> 11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>> Master=0
>>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>>> 15 ACTIVE sample.http_1.0.0
>>>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116310 is a reply to message #116305] Wed, 20 August 2008 01:11 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
I just noticed you hava a javax.servlet bundle in your install.
Remove it -- when running under the servletbridge the servlet api comes from
the app server.

HTH
-Simon
"Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
news:ae13973ec507d3dfb49c2fa6e3a7eaf8$1@www.eclipse.org...
> Geoffry Roberts wrote:
>
>> Simon,
>
>> I do appreciate the help thus far but things are not working. I have two
>> bridge setups, (1) in a stand alone Tomcat instance and another in my
>> workbench. Both yield a 404. In both, html, jsp, servlets, etc that
>> don't use the bridge work.
>
>> Standby, I'm going to dig in and see if I can figure it out.
>
> Here's what I don't understand:
>
> When I call: http://localhost:8080/bridge/helloworld.html
>
> public class BridgeServlet...
> ..
> protected void service...
> if (req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) == null) {
> String pathInfo = req.getPathInfo();
>
> // At this point, pathInfo = "/helloworld.html"
>
> // Check ...
> if (pathInfo == null && isExtensionMapping(req.getServletPath()))
> req = new ExtensionMappingRequest(req);
> if (enableFrameworkControls) {
> if (pathInfo != null && pathInfo.startsWith("/sp_")) {
> if (serviceFrameworkControls(req, resp)) {
> return;
> }
> }
> }
> } else {...
> ...
> // This is a call to a service method in
> javax.servlet.http.HttpServlet
> servletReference.service(req, resp);
> ...
>
> I find nothing in this code's path of execution that can reach either
> ProxyServlet or HttpServiceImpl much less how a servlet of mine would be
> called.
>
>> Simon Kaegi wrote:
>
>>> Hi Geoffry,
>
>>> Everything looks alright to me except possibly the URL.
>
>>> Try:
>>> http://localhost:8080/bridge/helloworld and
>>> http://localhost:8080/bridge/helloworld.html
>
>>> --
>
>>> The BridgeServlet is just a front controller for the real work which is
> done
>>> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.
>
>>> You might want to look at the service and processAlias methods if you're
>>> interested in understanding what's going on.
>
>>> My favorite places to set breakpoints are in the two register methods in
>>> HttpServiceImpl as well as the handleRequest call in
>>> ProxyServlet.processAlias.
>>> After seeing your servlets and resources registered and still having a
> tough
>>> time understanding what is (or isn't getting called) walk through
>>> ProxyServlet.service.
>
>>> HTH
>>> -Simon
>
>
>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>>>> Geoffry Roberts wrote:
>>>>
>>>>> The "e" in locale was a typo in the posting. I have in fact the
>>>>> correct spelling in my browser.
>>>>
>>>>> Assuming I can get localhost spelled correctly, the correct URL for
>>>>> accessing a servlet via the bridge should be:
>>>>
>>>>> http://localhost/bridge/HelloWorldServlet
>>>>
>>>>> Correct? This would be logical, but I keep getting a 404. I am
>>>>> trying to determine if the bridge is doing something unexpected.
>>>>
>>>> I replied to myself here so I could include the config.ini and the our
>>>> put of osgi> ss.
>>>> I've been stepping through BridgeServlet and I don't see how another
>>>> servlet gets called from the service method.
>>>> config.ini:
>>>>
>>>> #Eclipse Runtime Configuration File
>>>> osgi.bundles=org.eclipse.equinox.common@2:start,
>>>> org.eclipse.update.configurator@start,
>>>> org.eclipse.equinox.http.servletbridge@start,
>>>> org.eclipse.equinox.http.registry@start
>>>> osgi.bundles.defaultStartLevel=4
>>>>
>>>>
>>>>
>>>> osgi> ss
>>>>
>>>> Framework is launched.
>>>>
>>>> id State Bundle
>>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>>> Fragments=11
>>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>>> 3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>>> 11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>>> Master=0
>>>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>>>> 15 ACTIVE sample.http_1.0.0
>>>>
>
>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116338 is a reply to message #116310] Wed, 20 August 2008 16:40 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
Simon,

Thank for you help so far. My persistence in this is driven by the fact
that I have an OSGi app that I would love to give web access to if I can
just get my head around the problem with this bridge.

Also, I must remind you of my efforts to step through the BridgeServlet as
I described in an earlier post. I set break points as you suggested and
they were never reached.

For right now, let's address this most basic of problems wrt helloworld.
You suggested removing javax.servlet, which I did with an osgi> uninstall
to no avail. I noticed javax.servlet in the equinox container seems to be
a part of the deployment of bridge.war.

To wit:

// Start a clean Tomcat 5.5.26, plain vanilla,
// like its right out of the box.

Aug 20, 2008 8:21:53 AM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path: C:\Program
Files\Java\jdk1.6.0_04\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WIND OWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WI NDOWS\System32\Wbem;C:\Program
Files\MySQL\MySQL Server 5.0\bin;C:\Program
Files\Subversion\bin;C:\ant\bin;C:\maven\bin;C:\Program
Files\Java\jdk1.6.0_04\bin;C:\Program
Files\ApacheSoftwareFoundation\Tomcat5.5.26\bin;C:\Program
Files\cvsnt;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program
Files\QuickTime\QTSystem\;
Aug 20, 2008 8:21:53 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Aug 20, 2008 8:21:53 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 531 ms
Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Aug 20, 2008 8:21:54 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Aug 20, 2008 8:21:54 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Aug 20, 2008 8:21:54 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Aug 20, 2008 8:21:54 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Aug 20, 2008 8:21:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1047 ms

// Server started, everything works, lets drop bridge.war into the webapps
// directory.

Aug 20, 2008 8:23:14 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive bridge.war

osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
Fragments=11
1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
3 ACTIVE
org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
Master=0
12 RESOLVED org.eclipse.osgi.services_3.1.100.200704022148
15 RESOLVED sample.http.registry_1.0.0
16 ACTIVE sample.http_1.0.0
17 RESOLVED javax.servlet_2.4.0.200808151550

osgi>

// Notice javax.servlet is RESOLVED; I didn't put it there, and our
helloworld appears ready to go.

// Go to the browser
http://localhost:8080/bridge/sp_test

// Return

Servlet delegate registered -
org.eclipse.equinox.http.servlet.HttpServiceServlet

// So far so good.
// Now we try

http://localhost:8080/bridge/helloworld.html

// We get the dreaded 404

Simon Kaegi wrote:

> I just noticed you hava a javax.servlet bundle in your install.
> Remove it -- when running under the servletbridge the servlet api comes from
> the app server.

> HTH
> -Simon
> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
> news:ae13973ec507d3dfb49c2fa6e3a7eaf8$1@www.eclipse.org...
>> Geoffry Roberts wrote:
>>
>>> Simon,
>>
>>> I do appreciate the help thus far but things are not working. I have two
>>> bridge setups, (1) in a stand alone Tomcat instance and another in my
>>> workbench. Both yield a 404. In both, html, jsp, servlets, etc that
>>> don't use the bridge work.
>>
>>> Standby, I'm going to dig in and see if I can figure it out.
>>
>> Here's what I don't understand:
>>
>> When I call: http://localhost:8080/bridge/helloworld.html
>>
>> public class BridgeServlet...
>> ..
>> protected void service...
>> if (req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) == null) {
>> String pathInfo = req.getPathInfo();
>>
>> // At this point, pathInfo = "/helloworld.html"
>>
>> // Check ...
>> if (pathInfo == null && isExtensionMapping(req.getServletPath()))
>> req = new ExtensionMappingRequest(req);
>> if (enableFrameworkControls) {
>> if (pathInfo != null && pathInfo.startsWith("/sp_")) {
>> if (serviceFrameworkControls(req, resp)) {
>> return;
>> }
>> }
>> }
>> } else {...
>> ...
>> // This is a call to a service method in
>> javax.servlet.http.HttpServlet
>> servletReference.service(req, resp);
>> ...
>>
>> I find nothing in this code's path of execution that can reach either
>> ProxyServlet or HttpServiceImpl much less how a servlet of mine would be
>> called.
>>
>>> Simon Kaegi wrote:
>>
>>>> Hi Geoffry,
>>
>>>> Everything looks alright to me except possibly the URL.
>>
>>>> Try:
>>>> http://localhost:8080/bridge/helloworld and
>>>> http://localhost:8080/bridge/helloworld.html
>>
>>>> --
>>
>>>> The BridgeServlet is just a front controller for the real work which is
>> done
>>>> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.
>>
>>>> You might want to look at the service and processAlias methods if you're
>>>> interested in understanding what's going on.
>>
>>>> My favorite places to set breakpoints are in the two register methods in
>>>> HttpServiceImpl as well as the handleRequest call in
>>>> ProxyServlet.processAlias.
>>>> After seeing your servlets and resources registered and still having a
>> tough
>>>> time understanding what is (or isn't getting called) walk through
>>>> ProxyServlet.service.
>>
>>>> HTH
>>>> -Simon
>>
>>
>>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>>> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>>>>> Geoffry Roberts wrote:
>>>>>
>>>>>> The "e" in locale was a typo in the posting. I have in fact the
>>>>>> correct spelling in my browser.
>>>>>
>>>>>> Assuming I can get localhost spelled correctly, the correct URL for
>>>>>> accessing a servlet via the bridge should be:
>>>>>
>>>>>> http://localhost/bridge/HelloWorldServlet
>>>>>
>>>>>> Correct? This would be logical, but I keep getting a 404. I am
>>>>>> trying to determine if the bridge is doing something unexpected.
>>>>>
>>>>> I replied to myself here so I could include the config.ini and the our
>>>>> put of osgi> ss.
>>>>> I've been stepping through BridgeServlet and I don't see how another
>>>>> servlet gets called from the service method.
>>>>> config.ini:
>>>>>
>>>>> #Eclipse Runtime Configuration File
>>>>> osgi.bundles=org.eclipse.equinox.common@2:start,
>>>>> org.eclipse.update.configurator@start,
>>>>> org.eclipse.equinox.http.servletbridge@start,
>>>>> org.eclipse.equinox.http.registry@start
>>>>> osgi.bundles.defaultStartLevel=4
>>>>>
>>>>>
>>>>>
>>>>> osgi> ss
>>>>>
>>>>> Framework is launched.
>>>>>
>>>>> id State Bundle
>>>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>>>> Fragments=11
>>>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>>>> 3 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>>>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>>>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>>>> 11 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>>>> Master=0
>>>>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>>>>> 15 ACTIVE sample.http_1.0.0
>>>>>
>>
>>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116367 is a reply to message #116338] Thu, 21 August 2008 17:06 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
It's no problem, I don't mind helping at all especially in cases like this
where it's usually something simple.

I'm not sure where you're getting the WAR file but it should definitely not
contain a javax.servlet bundle.
This would lead to the sorts of problems you're seeing since the
http.registry bundle would not be able to see the Http Service provided by
the servlet bridge. OSGi will do some service filter to remove
incompatabilites and in this case different instances of the Servlet API
would do this.

Every Servlet API import should be wired to
org.eclipse.equinox.servletbridge.extensionbundle.
You can use the console to figure out how things are wired up running the
consoles "bundle" command.
e.g. bundle org.eclipse.osgi.services
or if you've used "ss" and know the bundle id -- bundle 7 -- or even -- b 7

HTH
-Simon


"Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
news:0c1801c94709fe3829b3abc3b7eb4903$1@www.eclipse.org...
> Simon,
>
> Thank for you help so far. My persistence in this is driven by the fact
> that I have an OSGi app that I would love to give web access to if I can
> just get my head around the problem with this bridge.
>
> Also, I must remind you of my efforts to step through the BridgeServlet as
> I described in an earlier post. I set break points as you suggested and
> they were never reached.
> For right now, let's address this most basic of problems wrt helloworld.
> You suggested removing javax.servlet, which I did with an osgi> uninstall
> to no avail. I noticed javax.servlet in the equinox container seems to be
> a part of the deployment of bridge.war.
>
> To wit:
>
> // Start a clean Tomcat 5.5.26, plain vanilla, // like its right out of
> the box.
>
> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Tomcat Native library which allows optimal performance in
> production environments was not found on the java.library.path: C:\Program
> Files\Java\jdk1.6.0_04\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WIND OWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WI NDOWS\System32\Wbem;C:\Program
> Files\MySQL\MySQL Server 5.0\bin;C:\Program
> Files\Subversion\bin;C:\ant\bin;C:\maven\bin;C:\Program
> Files\Java\jdk1.6.0_04\bin;C:\Program
> Files\ApacheSoftwareFoundation\Tomcat5.5.26\bin;C:\Program
> Files\cvsnt;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program
> Files\QuickTime\QTSystem\;
> Aug 20, 2008 8:21:53 AM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Aug 20, 2008 8:21:53 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 531 ms
> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> Aug 20, 2008 8:21:54 AM org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Aug 20, 2008 8:21:54 AM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> Aug 20, 2008 8:21:54 AM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/15 config=null
> Aug 20, 2008 8:21:54 AM org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> Aug 20, 2008 8:21:54 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 1047 ms
>
> // Server started, everything works, lets drop bridge.war into the webapps
> // directory.
>
> Aug 20, 2008 8:23:14 AM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive bridge.war
>
> osgi> ss
>
> Framework is launched.
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
> Fragments=11
> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
> 3 ACTIVE
> org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
> 11 RESOLVED
> org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
> Master=0
> 12 RESOLVED org.eclipse.osgi.services_3.1.100.200704022148
> 15 RESOLVED sample.http.registry_1.0.0
> 16 ACTIVE sample.http_1.0.0
> 17 RESOLVED javax.servlet_2.4.0.200808151550
>
> osgi>
>
> // Notice javax.servlet is RESOLVED; I didn't put it there, and our
> helloworld appears ready to go.
>
> // Go to the browser
> http://localhost:8080/bridge/sp_test
>
> // Return
>
> Servlet delegate registered -
> org.eclipse.equinox.http.servlet.HttpServiceServlet
>
> // So far so good.
> // Now we try
>
> http://localhost:8080/bridge/helloworld.html
>
> // We get the dreaded 404
>
> Simon Kaegi wrote:
>
>> I just noticed you hava a javax.servlet bundle in your install.
>> Remove it -- when running under the servletbridge the servlet api comes
>> from the app server.
>
>> HTH
>> -Simon
>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>> news:ae13973ec507d3dfb49c2fa6e3a7eaf8$1@www.eclipse.org...
>>> Geoffry Roberts wrote:
>>>
>>>> Simon,
>>>
>>>> I do appreciate the help thus far but things are not working. I have
>>>> two bridge setups, (1) in a stand alone Tomcat instance and another in
>>>> my workbench. Both yield a 404. In both, html, jsp, servlets, etc
>>>> that don't use the bridge work.
>>>
>>>> Standby, I'm going to dig in and see if I can figure it out.
>>>
>>> Here's what I don't understand:
>>>
>>> When I call: http://localhost:8080/bridge/helloworld.html
>>>
>>> public class BridgeServlet...
>>> ..
>>> protected void service...
>>> if (req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) == null) {
>>> String pathInfo = req.getPathInfo();
>>>
>>> // At this point, pathInfo = "/helloworld.html"
>>>
>>> // Check ...
>>> if (pathInfo == null && isExtensionMapping(req.getServletPath()))
>>> req = new ExtensionMappingRequest(req);
>>> if (enableFrameworkControls) {
>>> if (pathInfo != null && pathInfo.startsWith("/sp_")) {
>>> if (serviceFrameworkControls(req, resp)) {
>>> return;
>>> }
>>> }
>>> }
>>> } else {...
>>> ...
>>> // This is a call to a service method in
>>> javax.servlet.http.HttpServlet
>>> servletReference.service(req, resp);
>>> ...
>>>
>>> I find nothing in this code's path of execution that can reach either
>>> ProxyServlet or HttpServiceImpl much less how a servlet of mine would be
>>> called.
>>>
>>>> Simon Kaegi wrote:
>>>
>>>>> Hi Geoffry,
>>>
>>>>> Everything looks alright to me except possibly the URL.
>>>
>>>>> Try:
>>>>> http://localhost:8080/bridge/helloworld and
>>>>> http://localhost:8080/bridge/helloworld.html
>>>
>>>>> --
>>>
>>>>> The BridgeServlet is just a front controller for the real work which
>>>>> is
>>> done
>>>>> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.
>>>
>>>>> You might want to look at the service and processAlias methods if
>>>>> you're interested in understanding what's going on.
>>>
>>>>> My favorite places to set breakpoints are in the two register methods
>>>>> in HttpServiceImpl as well as the handleRequest call in
>>>>> ProxyServlet.processAlias.
>>>>> After seeing your servlets and resources registered and still having a
>>> tough
>>>>> time understanding what is (or isn't getting called) walk through
>>>>> ProxyServlet.service.
>>>
>>>>> HTH
>>>>> -Simon
>>>
>>>
>>>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>>>> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>>>>>> Geoffry Roberts wrote:
>>>>>>
>>>>>>> The "e" in locale was a typo in the posting. I have in fact the
>>>>>>> correct spelling in my browser.
>>>>>>
>>>>>>> Assuming I can get localhost spelled correctly, the correct URL for
>>>>>>> accessing a servlet via the bridge should be:
>>>>>>
>>>>>>> http://localhost/bridge/HelloWorldServlet
>>>>>>
>>>>>>> Correct? This would be logical, but I keep getting a 404. I am
>>>>>>> trying to determine if the bridge is doing something unexpected.
>>>>>>
>>>>>> I replied to myself here so I could include the config.ini and the
>>>>>> our put of osgi> ss.
>>>>>> I've been stepping through BridgeServlet and I don't see how another
>>>>>> servlet gets called from the service method.
>>>>>> config.ini:
>>>>>>
>>>>>> #Eclipse Runtime Configuration File
>>>>>> osgi.bundles=org.eclipse.equinox.common@2:start,
>>>>>> org.eclipse.update.configurator@start,
>>>>>> org.eclipse.equinox.http.servletbridge@start,
>>>>>> org.eclipse.equinox.http.registry@start
>>>>>> osgi.bundles.defaultStartLevel=4
>>>>>>
>>>>>>
>>>>>>
>>>>>> osgi> ss
>>>>>>
>>>>>> Framework is launched.
>>>>>>
>>>>>> id State Bundle
>>>>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>>>>> Fragments=11
>>>>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>>>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>>>>> 3 ACTIVE
>>>>>> org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>>>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>>>>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>>>>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>>>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>>>>> 11 RESOLVED
>>>>>> org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>>>>> Master=0
>>>>>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>>>>>> 15 ACTIVE sample.http_1.0.0
>>>>>>
>>>
>>>
>
>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116371 is a reply to message #116367] Thu, 21 August 2008 20:43 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
Simon,

My bridge.war file does not contain a javax.servlet bundle. When I drop
it into Tomcat's webapp directory and let it deploy, then do ss from the
osgi console, that's when I see the javax.servlet bundle. It lists as
resolved.

I downloaded my bridge.war from the web page:

Equinox in a Servlet Container/Quickstart
http://www.eclipse.org/equinox/server/http_in_container.php



Simon Kaegi wrote:

> It's no problem, I don't mind helping at all especially in cases like this
> where it's usually something simple.

> I'm not sure where you're getting the WAR file but it should definitely not
> contain a javax.servlet bundle.
> This would lead to the sorts of problems you're seeing since the
> http.registry bundle would not be able to see the Http Service provided by
> the servlet bridge. OSGi will do some service filter to remove
> incompatabilites and in this case different instances of the Servlet API
> would do this.

> Every Servlet API import should be wired to
> org.eclipse.equinox.servletbridge.extensionbundle.
> You can use the console to figure out how things are wired up running the
> consoles "bundle" command.
> e.g. bundle org.eclipse.osgi.services
> or if you've used "ss" and know the bundle id -- bundle 7 -- or even -- b 7

> HTH
> -Simon


> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
> news:0c1801c94709fe3829b3abc3b7eb4903$1@www.eclipse.org...
>> Simon,
>>
>> Thank for you help so far. My persistence in this is driven by the fact
>> that I have an OSGi app that I would love to give web access to if I can
>> just get my head around the problem with this bridge.
>>
>> Also, I must remind you of my efforts to step through the BridgeServlet as
>> I described in an earlier post. I set break points as you suggested and
>> they were never reached.
>> For right now, let's address this most basic of problems wrt helloworld.
>> You suggested removing javax.servlet, which I did with an osgi> uninstall
>> to no avail. I noticed javax.servlet in the equinox container seems to be
>> a part of the deployment of bridge.war.
>>
>> To wit:
>>
>> // Start a clean Tomcat 5.5.26, plain vanilla, // like its right out of
>> the box.
>>
>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.AprLifecycleListener
>> lifecycleEvent
>> INFO: The Apache Tomcat Native library which allows optimal performance in
>> production environments was not found on the java.library.path: C:Program
>>
FilesJavajdk1.6.0_04bin;.;C:WINDOWSSunJavabin;C:WINDOWSsyste m32;C:WINDOWS;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32W bem;C:Program
>> FilesMySQLMySQL Server 5.0bin;C:Program
>> FilesSubversionbin;C:antbin;C:mavenbin;C:Program
>> FilesJavajdk1.6.0_04bin;C:Program
>> FilesApacheSoftwareFoundationTomcat5.5.26bin;C:Program
>> Filescvsnt;C:Program FilesCommon FilesGTK2.0bin;C:Program
>> FilesQuickTimeQTSystem;
>> Aug 20, 2008 8:21:53 AM org.apache.coyote.http11.Http11BaseProtocol init
>> INFO: Initializing Coyote HTTP/1.1 on http-8080
>> Aug 20, 2008 8:21:53 AM org.apache.catalina.startup.Catalina load
>> INFO: Initialization processed in 531 ms
>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardService start
>> INFO: Starting service Catalina
>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardEngine start
>> INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardHost start
>> INFO: XML validation disabled
>> Aug 20, 2008 8:21:54 AM org.apache.coyote.http11.Http11BaseProtocol start
>> INFO: Starting Coyote HTTP/1.1 on http-8080
>> Aug 20, 2008 8:21:54 AM org.apache.jk.common.ChannelSocket init
>> INFO: JK: ajp13 listening on /0.0.0.0:8009
>> Aug 20, 2008 8:21:54 AM org.apache.jk.server.JkMain start
>> INFO: Jk running ID=0 time=0/15 config=null
>> Aug 20, 2008 8:21:54 AM org.apache.catalina.storeconfig.StoreLoader load
>> INFO: Find registry server-registry.xml at classpath resource
>> Aug 20, 2008 8:21:54 AM org.apache.catalina.startup.Catalina start
>> INFO: Server startup in 1047 ms
>>
>> // Server started, everything works, lets drop bridge.war into the webapps
>> // directory.
>>
>> Aug 20, 2008 8:23:14 AM org.apache.catalina.startup.HostConfig deployWAR
>> INFO: Deploying web application archive bridge.war
>>
>> osgi> ss
>>
>> Framework is launched.
>>
>> id State Bundle
>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>> Fragments=11
>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>> 3 ACTIVE
>> org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>> 11 RESOLVED
>> org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>> Master=0
>> 12 RESOLVED org.eclipse.osgi.services_3.1.100.200704022148
>> 15 RESOLVED sample.http.registry_1.0.0
>> 16 ACTIVE sample.http_1.0.0
>> 17 RESOLVED javax.servlet_2.4.0.200808151550
>>
>> osgi>
>>
>> // Notice javax.servlet is RESOLVED; I didn't put it there, and our
>> helloworld appears ready to go.
>>
>> // Go to the browser
>> http://localhost:8080/bridge/sp_test
>>
>> // Return
>>
>> Servlet delegate registered -
>> org.eclipse.equinox.http.servlet.HttpServiceServlet
>>
>> // So far so good.
>> // Now we try
>>
>> http://localhost:8080/bridge/helloworld.html
>>
>> // We get the dreaded 404
>>
>> Simon Kaegi wrote:
>>
>>> I just noticed you hava a javax.servlet bundle in your install.
>>> Remove it -- when running under the servletbridge the servlet api comes
>>> from the app server.
>>
>>> HTH
>>> -Simon
>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>> news:ae13973ec507d3dfb49c2fa6e3a7eaf8$1@www.eclipse.org...
>>>> Geoffry Roberts wrote:
>>>>
>>>>> Simon,
>>>>
>>>>> I do appreciate the help thus far but things are not working. I have
>>>>> two bridge setups, (1) in a stand alone Tomcat instance and another in
>>>>> my workbench. Both yield a 404. In both, html, jsp, servlets, etc
>>>>> that don't use the bridge work.
>>>>
>>>>> Standby, I'm going to dig in and see if I can figure it out.
>>>>
>>>> Here's what I don't understand:
>>>>
>>>> When I call: http://localhost:8080/bridge/helloworld.html
>>>>
>>>> public class BridgeServlet...
>>>> ..
>>>> protected void service...
>>>> if (req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) == null) {
>>>> String pathInfo = req.getPathInfo();
>>>>
>>>> // At this point, pathInfo = "/helloworld.html"
>>>>
>>>> // Check ...
>>>> if (pathInfo == null && isExtensionMapping(req.getServletPath()))
>>>> req = new ExtensionMappingRequest(req);
>>>> if (enableFrameworkControls) {
>>>> if (pathInfo != null && pathInfo.startsWith("/sp_")) {
>>>> if (serviceFrameworkControls(req, resp)) {
>>>> return;
>>>> }
>>>> }
>>>> }
>>>> } else {...
>>>> ...
>>>> // This is a call to a service method in
>>>> javax.servlet.http.HttpServlet
>>>> servletReference.service(req, resp);
>>>> ...
>>>>
>>>> I find nothing in this code's path of execution that can reach either
>>>> ProxyServlet or HttpServiceImpl much less how a servlet of mine would be
>>>> called.
>>>>
>>>>> Simon Kaegi wrote:
>>>>
>>>>>> Hi Geoffry,
>>>>
>>>>>> Everything looks alright to me except possibly the URL.
>>>>
>>>>>> Try:
>>>>>> http://localhost:8080/bridge/helloworld and
>>>>>> http://localhost:8080/bridge/helloworld.html
>>>>
>>>>>> --
>>>>
>>>>>> The BridgeServlet is just a front controller for the real work which
>>>>>> is
>>>> done
>>>>>> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.
>>>>
>>>>>> You might want to look at the service and processAlias methods if
>>>>>> you're interested in understanding what's going on.
>>>>
>>>>>> My favorite places to set breakpoints are in the two register methods
>>>>>> in HttpServiceImpl as well as the handleRequest call in
>>>>>> ProxyServlet.processAlias.
>>>>>> After seeing your servlets and resources registered and still having a
>>>> tough
>>>>>> time understanding what is (or isn't getting called) walk through
>>>>>> ProxyServlet.service.
>>>>
>>>>>> HTH
>>>>>> -Simon
>>>>
>>>>
>>>>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>>>>> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>>>>>>> Geoffry Roberts wrote:
>>>>>>>
>>>>>>>> The "e" in locale was a typo in the posting. I have in fact the
>>>>>>>> correct spelling in my browser.
>>>>>>>
>>>>>>>> Assuming I can get localhost spelled correctly, the correct URL for
>>>>>>>> accessing a servlet via the bridge should be:
>>>>>>>
>>>>>>>> http://localhost/bridge/HelloWorldServlet
>>>>>>>
>>>>>>>> Correct? This would be logical, but I keep getting a 404. I am
>>>>>>>> trying to determine if the bridge is doing something unexpected.
>>>>>>>
>>>>>>> I replied to myself here so I could include the config.ini and the
>>>>>>> our put of osgi> ss.
>>>>>>> I've been stepping through BridgeServlet and I don't see how another
>>>>>>> servlet gets called from the service method.
>>>>>>> config.ini:
>>>>>>>
>>>>>>> #Eclipse Runtime Configuration File
>>>>>>> osgi.bundles=org.eclipse.equinox.common@2:start,
>>>>>>> org.eclipse.update.configurator@start,
>>>>>>> org.eclipse.equinox.http.servletbridge@start,
>>>>>>> org.eclipse.equinox.http.registry@start
>>>>>>> osgi.bundles.defaultStartLevel=4
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> osgi> ss
>>>>>>>
>>>>>>> Framework is launched.
>>>>>>>
>>>>>>> id State Bundle
>>>>>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>>>>>> Fragments=11
>>>>>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>>>>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>>>>>> 3 ACTIVE
>>>>>>> org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>>>>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>>>>>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>>>>>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>>>>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>>>>>> 11 RESOLVED
>>>>>>> org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>>>>>> Master=0
>>>>>>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>>>>>>> 15 ACTIVE sample.http_1.0.0
>>>>>>>
>>>>
>>>>
>>
>>
Re: Really Basic Equinox/Servlet Bridge Problem [message #116376 is a reply to message #116371] Thu, 21 August 2008 21:08 Go to previous message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
Simon,

I would seem that Tomcat was holding on to javax.servlet in its work
directory. It's been a while since I've developed with Tomcat and I had
forgotten about it. I cleaned out work/ and javax.servlet appears no more.

Geoffry Roberts wrote:

> Simon,

> My bridge.war file does not contain a javax.servlet bundle. When I drop
> it into Tomcat's webapp directory and let it deploy, then do ss from the
> osgi console, that's when I see the javax.servlet bundle. It lists as
> resolved.

> I downloaded my bridge.war from the web page:

> Equinox in a Servlet Container/Quickstart
> http://www.eclipse.org/equinox/server/http_in_container.php



> Simon Kaegi wrote:

>> It's no problem, I don't mind helping at all especially in cases like this
>> where it's usually something simple.

>> I'm not sure where you're getting the WAR file but it should definitely not
>> contain a javax.servlet bundle.
>> This would lead to the sorts of problems you're seeing since the
>> http.registry bundle would not be able to see the Http Service provided by
>> the servlet bridge. OSGi will do some service filter to remove
>> incompatabilites and in this case different instances of the Servlet API
>> would do this.

>> Every Servlet API import should be wired to
>> org.eclipse.equinox.servletbridge.extensionbundle.
>> You can use the console to figure out how things are wired up running the
>> consoles "bundle" command.
>> e.g. bundle org.eclipse.osgi.services
>> or if you've used "ss" and know the bundle id -- bundle 7 -- or even -- b 7

>> HTH
>> -Simon


>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>> news:0c1801c94709fe3829b3abc3b7eb4903$1@www.eclipse.org...
>>> Simon,
>>>
>>> Thank for you help so far. My persistence in this is driven by the fact
>>> that I have an OSGi app that I would love to give web access to if I can
>>> just get my head around the problem with this bridge.
>>>
>>> Also, I must remind you of my efforts to step through the BridgeServlet as
>>> I described in an earlier post. I set break points as you suggested and
>>> they were never reached.
>>> For right now, let's address this most basic of problems wrt helloworld.
>>> You suggested removing javax.servlet, which I did with an osgi> uninstall
>>> to no avail. I noticed javax.servlet in the equinox container seems to be
>>> a part of the deployment of bridge.war.
>>>
>>> To wit:
>>>
>>> // Start a clean Tomcat 5.5.26, plain vanilla, // like its right out of
>>> the box.
>>>
>>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.AprLifecycleListener
>>> lifecycleEvent
>>> INFO: The Apache Tomcat Native library which allows optimal performance in
>>> production environments was not found on the java.library.path: C:Program
>>>
>
FilesJavajdk1.6.0_04bin;.;C:WINDOWSSunJavabin;C:WINDOWSsyste m32;C:WINDOWS;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32W bem;C:Program
>>> FilesMySQLMySQL Server 5.0bin;C:Program
>>> FilesSubversionbin;C:antbin;C:mavenbin;C:Program
>>> FilesJavajdk1.6.0_04bin;C:Program
>>> FilesApacheSoftwareFoundationTomcat5.5.26bin;C:Program
>>> Filescvsnt;C:Program FilesCommon FilesGTK2.0bin;C:Program
>>> FilesQuickTimeQTSystem;
>>> Aug 20, 2008 8:21:53 AM org.apache.coyote.http11.Http11BaseProtocol init
>>> INFO: Initializing Coyote HTTP/1.1 on http-8080
>>> Aug 20, 2008 8:21:53 AM org.apache.catalina.startup.Catalina load
>>> INFO: Initialization processed in 531 ms
>>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardService start
>>> INFO: Starting service Catalina
>>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardEngine start
>>> INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
>>> Aug 20, 2008 8:21:53 AM org.apache.catalina.core.StandardHost start
>>> INFO: XML validation disabled
>>> Aug 20, 2008 8:21:54 AM org.apache.coyote.http11.Http11BaseProtocol start
>>> INFO: Starting Coyote HTTP/1.1 on http-8080
>>> Aug 20, 2008 8:21:54 AM org.apache.jk.common.ChannelSocket init
>>> INFO: JK: ajp13 listening on /0.0.0.0:8009
>>> Aug 20, 2008 8:21:54 AM org.apache.jk.server.JkMain start
>>> INFO: Jk running ID=0 time=0/15 config=null
>>> Aug 20, 2008 8:21:54 AM org.apache.catalina.storeconfig.StoreLoader load
>>> INFO: Find registry server-registry.xml at classpath resource
>>> Aug 20, 2008 8:21:54 AM org.apache.catalina.startup.Catalina start
>>> INFO: Server startup in 1047 ms
>>>
>>> // Server started, everything works, lets drop bridge.war into the webapps
>>> // directory.
>>>
>>> Aug 20, 2008 8:23:14 AM org.apache.catalina.startup.HostConfig deployWAR
>>> INFO: Deploying web application archive bridge.war
>>>
>>> osgi> ss
>>>
>>> Framework is launched.
>>>
>>> id State Bundle
>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>> Fragments=11
>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>> 3 ACTIVE
>>> org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>> 11 RESOLVED
>>> org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>> Master=0
>>> 12 RESOLVED org.eclipse.osgi.services_3.1.100.200704022148
>>> 15 RESOLVED sample.http.registry_1.0.0
>>> 16 ACTIVE sample.http_1.0.0
>>> 17 RESOLVED javax.servlet_2.4.0.200808151550
>>>
>>> osgi>
>>>
>>> // Notice javax.servlet is RESOLVED; I didn't put it there, and our
>>> helloworld appears ready to go.
>>>
>>> // Go to the browser
>>> http://localhost:8080/bridge/sp_test
>>>
>>> // Return
>>>
>>> Servlet delegate registered -
>>> org.eclipse.equinox.http.servlet.HttpServiceServlet
>>>
>>> // So far so good.
>>> // Now we try
>>>
>>> http://localhost:8080/bridge/helloworld.html
>>>
>>> // We get the dreaded 404
>>>
>>> Simon Kaegi wrote:
>>>
>>>> I just noticed you hava a javax.servlet bundle in your install.
>>>> Remove it -- when running under the servletbridge the servlet api comes
>>>> from the app server.
>>>
>>>> HTH
>>>> -Simon
>>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>>> news:ae13973ec507d3dfb49c2fa6e3a7eaf8$1@www.eclipse.org...
>>>>> Geoffry Roberts wrote:
>>>>>
>>>>>> Simon,
>>>>>
>>>>>> I do appreciate the help thus far but things are not working. I have
>>>>>> two bridge setups, (1) in a stand alone Tomcat instance and another in
>>>>>> my workbench. Both yield a 404. In both, html, jsp, servlets, etc
>>>>>> that don't use the bridge work.
>>>>>
>>>>>> Standby, I'm going to dig in and see if I can figure it out.
>>>>>
>>>>> Here's what I don't understand:
>>>>>
>>>>> When I call: http://localhost:8080/bridge/helloworld.html
>>>>>
>>>>> public class BridgeServlet...
>>>>> ..
>>>>> protected void service...
>>>>> if (req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) == null) {
>>>>> String pathInfo = req.getPathInfo();
>>>>>
>>>>> // At this point, pathInfo = "/helloworld.html"
>>>>>
>>>>> // Check ...
>>>>> if (pathInfo == null && isExtensionMapping(req.getServletPath()))
>>>>> req = new ExtensionMappingRequest(req);
>>>>> if (enableFrameworkControls) {
>>>>> if (pathInfo != null && pathInfo.startsWith("/sp_")) {
>>>>> if (serviceFrameworkControls(req, resp)) {
>>>>> return;
>>>>> }
>>>>> }
>>>>> }
>>>>> } else {...
>>>>> ...
>>>>> // This is a call to a service method in
>>>>> javax.servlet.http.HttpServlet
>>>>> servletReference.service(req, resp);
>>>>> ...
>>>>>
>>>>> I find nothing in this code's path of execution that can reach either
>>>>> ProxyServlet or HttpServiceImpl much less how a servlet of mine would be
>>>>> called.
>>>>>
>>>>>> Simon Kaegi wrote:
>>>>>
>>>>>>> Hi Geoffry,
>>>>>
>>>>>>> Everything looks alright to me except possibly the URL.
>>>>>
>>>>>>> Try:
>>>>>>> http://localhost:8080/bridge/helloworld and
>>>>>>> http://localhost:8080/bridge/helloworld.html
>>>>>
>>>>>>> --
>>>>>
>>>>>>> The BridgeServlet is just a front controller for the real work which
>>>>>>> is
>>>>> done
>>>>>>> in org.eclipse.equinox.http.servlet.internal.ProxyServlet.
>>>>>
>>>>>>> You might want to look at the service and processAlias methods if
>>>>>>> you're interested in understanding what's going on.
>>>>>
>>>>>>> My favorite places to set breakpoints are in the two register methods
>>>>>>> in HttpServiceImpl as well as the handleRequest call in
>>>>>>> ProxyServlet.processAlias.
>>>>>>> After seeing your servlets and resources registered and still having a
>>>>> tough
>>>>>>> time understanding what is (or isn't getting called) walk through
>>>>>>> ProxyServlet.service.
>>>>>
>>>>>>> HTH
>>>>>>> -Simon
>>>>>
>>>>>
>>>>>>> "Geoffry Roberts" <geoff.roberts@qinetiq-na.com> wrote in message
>>>>>>> news:2e2be73e673a9cb3760f59d1d51bb691$1@www.eclipse.org...
>>>>>>>> Geoffry Roberts wrote:
>>>>>>>>
>>>>>>>>> The "e" in locale was a typo in the posting. I have in fact the
>>>>>>>>> correct spelling in my browser.
>>>>>>>>
>>>>>>>>> Assuming I can get localhost spelled correctly, the correct URL for
>>>>>>>>> accessing a servlet via the bridge should be:
>>>>>>>>
>>>>>>>>> http://localhost/bridge/HelloWorldServlet
>>>>>>>>
>>>>>>>>> Correct? This would be logical, but I keep getting a 404. I am
>>>>>>>>> trying to determine if the bridge is doing something unexpected.
>>>>>>>>
>>>>>>>> I replied to myself here so I could include the config.ini and the
>>>>>>>> our put of osgi> ss.
>>>>>>>> I've been stepping through BridgeServlet and I don't see how another
>>>>>>>> servlet gets called from the service method.
>>>>>>>> config.ini:
>>>>>>>>
>>>>>>>> #Eclipse Runtime Configuration File
>>>>>>>> osgi.bundles=org.eclipse.equinox.common@2:start,
>>>>>>>> org.eclipse.update.configurator@start,
>>>>>>>> org.eclipse.equinox.http.servletbridge@start,
>>>>>>>> org.eclipse.equinox.http.registry@start
>>>>>>>> osgi.bundles.defaultStartLevel=4
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> osgi> ss
>>>>>>>>
>>>>>>>> Framework is launched.
>>>>>>>>
>>>>>>>> id State Bundle
>>>>>>>> 0 ACTIVE org.eclipse.osgi_3.3.0.200704022148
>>>>>>>> Fragments=11
>>>>>>>> 1 ACTIVE org.eclipse.equinox.common_3.3.0.200704022148
>>>>>>>> 2 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322
>>>>>>>> 3 ACTIVE
>>>>>>>> org.eclipse.equinox.http.servletbridge_1.0.0.200704022148
>>>>>>>> 4 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148
>>>>>>>> 5 RESOLVED javax.servlet_2.4.0.200808151435
>>>>>>>> 9 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148
>>>>>>>> 10 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318
>>>>>>>> 11 RESOLVED
>>>>>>>> org.eclipse.equinox.servletbridge.extensionbundle_1.0.0
>>>>>>>> Master=0
>>>>>>>> 12 ACTIVE org.eclipse.osgi.services_3.1.100.200704022148
>>>>>>>> 15 ACTIVE sample.http_1.0.0
>>>>>>>>
>>>>>
>>>>>
>>>
>>>
Previous Topic:Extracted Bundle Classpath location question
Next Topic:OSGi Service Listener
Goto Forum:
  


Current Time: Thu Apr 25 16:41:21 GMT 2024

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

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

Back to the top