users@glassfish.java.net

Glassfish V3 - Can anyone explain SnifferAdapter cannot map themself.

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 Apr 2010 16:07:45 PDT

I've spent 10 days solid trying to figure out how to make the Sniffer 'happy'.

It's just plain 'broken' - there is NO way anyone is using this in a production
multi domain environment. If you get one domain to work - just add another one and they all break - NOT good enough for production.

There is NO info available on how the sniffer works.
There is NO feedback in the logs as to what it doesn't like.
There is NO info available on how to debug the sniffer.

Does anyone out there know what the sniffer is doing (in detail)??

- Sun Sparc Solaris 10, virgin install. (NOT X86 !!!!!)
- Glassfish V3 virgin install.
- This is a MULTI-DOMAIN (multiple IP's & virtual servers & multiple apps) configuration.
- Started with Sun GlassFish Enterprise Server (build 74.2)
- Now running GlassFish 3 (build 12) (build date 04/01/10) - same issues.

We have run GF v2.1 with multi-domain since 04/01/2009 (over 10 domains).

Easy to reproduce problem - out of the box new GF install- using GUI...
(just freshly unzipped build 12)

1. create 3 test apps in 3 separate directories...
- explode hello.war into directories hello1, hello2, hello3
- change each sun-web.xml context-root
- change each web.xml display-name

=== using GUI ===
2. create 2 new listeners real IP's on port 80, defaults
(yes 2 real IP's, both port 80)
3. create 2 virtual servers (with hosts name), assign to listeners, defaults
4. DIRECTORY deploy 2 apps, specify virtual server (precompile,verify,force)
5. assign default virtual server to each protocol
6. assign apps as default web module for each virtual

7. manually stop-domain & start-domain

8. browse to each http://www.domain.com/hello1/index.jsp (1 and 2)

- maybe they work - maybe they don't - I've seen both cases
- SO - IF you think it works
- then ADD a 3rd IP - same steps as above (do stop/start)
- I GUARANTEE either case won't work
- be sure and look at diff of domain.xml files - all scrambled

I have had all three hello domains functioning - then made a simple change
and - then nothing would work anymore - even after a reboot.

I'm not making this up - there is a serious problem with the sniffer and
multiple domains.

Just make a change to virtual or listeners, save, then compare the domain.xml one from prior server run - it randomly swaps the middle xml fields - making it difficult to do a 'diff' on saved
domain.xml files. Even CLI loading rearranges domain.xml entries.

I'm thinking the xml rearrangement is messing with the sniffer - but I have
no way of knowing what the sniffer is un-happy about.

I can get all of our apps to 'individually' run on a single listener - no problem. Just can't have multiple virtual servers running different apps. Sniffer looses it's brain somehow.


======================================================
Essentially this is domain.xml: (abbreviated - the rest is default)

<application context-root="/hello1" location="file:/web/server/OurDomainOne/hello1/" directory-deployed="true" name="hello1" object-type="user">
<property name="defaultAppName" value="hello1" />
<module name="hello1">
<application context-root="/hello2" location="file:/web/server/OurDomainTwo/hello2/" directory-deployed="true" name="hello2" object-type="user">
<property name="defaultAppName" value="hello2" />
<module name="hello2">

<application-ref ref="hello1" virtual-servers="OurDomainOne" />
<application-ref ref="hello2" virtual-servers="OurDomainTwo" />

<virtual-server id="OurDomainOne" hosts="www.OurDomainOne.com" default-web-module="hello1" network-listeners="http-OurDomainOne" />
<virtual-server id="OurDomainTwo" hosts="www.OurDomainTwo.com" default-web-module="hello2" network-listeners="http-OurDomainTwo" />

<protocol name="http-OurDomainOne-protocol">
<http default-virtual-server="OurDomainOne" />
<protocol name="http-OurDomainTwo-protocol">
<http default-virtual-server="OurDomainTwo" />

<network-listener port="80" protocol="http-OurDomainOne-protocol" transport="tcp" address="NN.NNN.NN.41" name="http-OurDomainOne" thread-pool="http-thread-pool" />
<network-listener port="80" protocol="http-OurDomainTwo-protocol" transport="tcp" address="NN.NNN.NN.35" name="http-OurDomainTwo" thread-pool="http-thread-pool" />

======================================================
Continually see this error - no matter HOW I configure GF or applications:

[#|2010-04-05T13:11:15.724-0400|SEVERE|glassfish3.0|null|_ThreadID=36;_ThreadName=Thread-1;|Exception while mapping the request
java.lang.RuntimeException: SnifferAdapter cannot map themself.
at com.sun.enterprise.v3.services.impl.SnifferAdapter.service(SnifferAdapter.java:163)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)



Thanks for anyones help with this. Otherwise - it's back to GF V2.1 :-)
[Message sent by forum member 'htsguru']

http://forums.java.net/jive/thread.jspa?messageID=395390