users@grizzly.java.net

Re: Grizzly configuration on Glassfish v3

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Tue, 06 Oct 2009 13:19:45 +0200

Hi Mohamed,

my fault, please try following config:

       <network-config>
         <protocols>
           <protocol name="pu-protocol">
             <port-unification>
               <protocol-finder protocol="http"
classname="com.sun.grizzly.http.portunif.HttpProtocolFinder"
name="http-finder" />
               <protocol-finder protocol="rpc"
classname="scedev.grizzly.protocols.TCPProtocolFinder" name="rpc-
protocol-finder" />
             </port-unification>
           </protocol>
           <protocol name="http">
             <http max-connections="250" default-virtual-
server="server" server-name="" />
           </protocol>
           <protocol name="rpc">
             <protocol-chain-instance-handler>
               <protocol-chain>
                 <protocol-filter
classname="scedev.grizzly.protocols.TCPProtocolFilter" name="rpc-
filter" />
               </protocol-chain>
             </protocol-chain-instance-handler>
           </protocol>
           <protocol name="http-listener-1">
             <http max-connections="250" default-virtual-
server="server" server-name="">
               <file-cache enabled="false" />
             </http>
           </protocol>
           <protocol security-enabled="true" name="http-listener-2">
             <http max-connections="250" default-virtual-
server="server" server-name="">
               <file-cache enabled="false" />
             </http>
             <ssl ssl3-enabled="false" cert-nickname="s1as" />
           </protocol>
           <protocol name="admin-listener">
             <http max-connections="250" default-virtual-
server="__asadmin" server-name="">
               <file-cache enabled="false" />
             </http>
           </protocol>
         </protocols>
         <network-listeners>
           <network-listener port="8787" protocol="pu-protocol"
transport="tcp" name="tcprpc-listener" thread-pool="thread-pool-1" />
           <network-listener port="8080" protocol="http-listener-1"
transport="tcp" name="http-listener-1" thread-pool="http-thread-pool" />
           <network-listener port="4848" protocol="admin-listener"
transport="tcp" name="admin-listener" thread-pool="thread-pool-1" />
         </network-listeners>
         <transports>
           <transport name="tcp" />
         </transports>
       </network-config>

WBR,
Alexey.

On Oct 6, 2009, at 12:53 , melshami wrote:

>
> Hi Alexey,
>
> Thanks for bearing with me, still no luck. I tried your suggestion
> and I
> tried different variations of configuration protocol element.
>
> here is my current configuration:
> <network-config>
> <protocols>
> <protocol name="pu-protocol">
> <port-unification>
> <protocol-finder protocol="http"
> classname="com.sun.grizzly.http.portunif.HttpProtocolFinder"
> name="http-finder" />
> <protocol-finder protocol="rpc"
> classname="scedev.grizzly.protocols.TCPProtocolFinder"
> name="rpc-protocol-finder" />
> </port-unification>
> </protocol>
> <protocol name="http" />
> <protocol name="rpc">
> <protocol-chain-instance-handler>
> <protocol-chain>
> <protocol-filter
> classname="scedev.grizzly.protocols.TCPProtocolFilter" name="rpc-
> filter" />
> </protocol-chain>
> </protocol-chain-instance-handler>
> </protocol>
> <protocol name="http-listener-1">
> <http max-connections="250" default-virtual-server="server"
> server-name="">
> <file-cache enabled="false" />
> </http>
> </protocol>
> <protocol security-enabled="true" name="http-listener-2">
> <http max-connections="250" default-virtual-server="server"
> server-name="">
> <file-cache enabled="false" />
> </http>
> <ssl ssl3-enabled="false" cert-nickname="s1as" />
> </protocol>
> <protocol name="admin-listener">
> <http max-connections="250" default-virtual-
> server="__asadmin"
> server-name="">
> <file-cache enabled="false" />
> </http>
> </protocol>
> </protocols>
> <network-listeners>
> <network-listener port="8787" protocol="pu-protocol"
> transport="tcp" name="tcprpc-listener" thread-pool="thread-pool-1" />
> <network-listener port="8080" protocol="pu-protocol"
> transport="tcp" name="http-listener-1" thread-pool="http-thread-
> pool" />
> <network-listener port="4848" protocol="pu-protocol"
> transport="tcp" name="admin-listener" thread-pool="thread-pool-1" />
> </network-listeners>
> <transports>
> <transport name="tcp" />
> </transports>
> </network-config>
>
> Oleksiy Stashok wrote:
>>
>> Hi Mohamed,
>>
>> hmm, this is a bug - I'll fix it for coming GF release.
>> Meanwhile you can workaround this issue by declaring http protocol,
>> within the port unification declaration, together with rpc protocol,
>> like:
>>
>> <protocol name="pu-protocol">
>> <port-unification>
>> <protocol-finder name="http-finder"
>> classname="com.sun.grizzly.http.portunif.HttpProtocolFinder"
>> protocol="http"/>
>> <protocol-finder name="rpc-protocol-finder"
>> classname="scedev.grizzly.protocols.TCPProtocolFinder"
>> protocol="rpc"/>
>> </port-unification>
>> </protocol>
>>
>> <protocol name="http">
>> </protocol>
>>
>>
>> WBR,
>> Alexey.
>>
>> On Oct 6, 2009, at 10:55 , melshami wrote:
>>
>>>
>>> Hi Alexey,
>>>
>>> I Can't seem to get this right, here is my configuration:
>>>
>>> <network-config>
>>> <protocols>
>>> <protocol name="pu-protocol">
>>> <port-unification>
>>> <protocol-finder protocol="rpc" name="rpc-protocol-
>>> finder"
>>> classname="scedev.grizzly.protocols.TCPProtocolFinder" />
>>> </port-unification>
>>> </protocol>
>>> <protocol name="rpc">
>>> <protocol-chain-instance-handler>
>>> <protocol-chain>
>>> <protocol-filter name="rpc"
>>> classname="scedev.grizzly.protocols.TCPProtocolFilter" />
>>> </protocol-chain>
>>> </protocol-chain-instance-handler>
>>> </protocol>
>>> <protocol name="http-listener-1">
>>> <http default-virtual-server="server" max-
>>> connections="250"
>>> server-name="">
>>> <file-cache enabled="false" />
>>> </http>
>>> </protocol>
>>> <protocol security-enabled="true" name="http-listener-2">
>>> <http default-virtual-server="server" max-
>>> connections="250"
>>> server-name="">
>>> <file-cache enabled="false" />
>>> </http>
>>> <ssl ssl3-enabled="false" cert-nickname="s1as" />
>>> </protocol>
>>> <protocol name="admin-listener">
>>> <http default-virtual-server="__asadmin" max-
>>> connections="250"
>>> server-name="">
>>> <file-cache enabled="false" />
>>> </http>
>>> </protocol>
>>> </protocols>
>>> <network-listeners>
>>> <network-listener port="8787" protocol="pu-protocol"
>>> transport="tcp" name="tcprpc-listener" thread-pool="http-thread-
>>> pool" />
>>> <network-listener port="8080" protocol="http-listener-1"
>>> transport="tcp" name="http-listener-1" thread-pool="http-thread-
>>> pool" />
>>> <network-listener port="8181" protocol="http-listener-2"
>>> transport="tcp" name="http-listener-2" thread-pool="http-thread-
>>> pool" />
>>> <network-listener port="4848" protocol="admin-listener"
>>> transport="tcp" name="admin-listener" thread-pool="http-thread-
>>> pool" />
>>> </network-listeners>
>>> <transports>
>>> <transport name="tcp" />
>>> </transports>
>>> </network-config>
>>>
>>> GlassFish won't start due to this exception:
>>>
>>> #|2009-10-06T09:48:46.654+0100|SEVERE|glassfish|null|
>>> _ThreadID=11;_ThreadName=Thread-3;|Unable
>>> to start v3. Closing all ports
>>> java.lang.NullPointerException
>>> at
>>> com
>>> .sun
>>> .grizzly
>>> .config
>>> .GrizzlyServiceListener
>>> .initializeListener(GrizzlyServiceListener.java:83)
>>> at
>>> com
>>> .sun
>>> .grizzly
>>> .config
>>> .GrizzlyServiceListener.configure(GrizzlyServiceListener.java:
>>> 77)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .v3.services.impl.GrizzlyListener.configure(GrizzlyListener.java:59)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .v3.services.impl.GrizzlyProxy.configureGrizzly(GrizzlyProxy.java:
>>> 125)
>>> at
>>> com
>>> .sun
>>> .enterprise.v3.services.impl.GrizzlyProxy.<init>(GrizzlyProxy.java:
>>> 116)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .v3
>>> .services
>>> .impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:
>>> 344)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:
>>> 266)
>>> at
>>> com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:
>>> 174)
>>> at com.sun.hk2.component.ConstructorWomb
>>> $1.run(ConstructorWomb.java:
>>> 91)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>>
>>> I have set the classpath for the custom protocol filter and finder
>>> in the
>>> JVM classpath settings.
>>>
>>> Is there anything else I am missing?
>>>
>>> Regards,
>>> Mohamed
>>>
>>> melshami wrote:
>>>>
>>>>
>>>> It's not a problem at all, am still testing we have enough time
>>>> before
>>>> production so I hope there will be a new release soon. I will try
>>>> that and
>>>> will get back to you.
>>>>
>>>> Thanks for your help:)
>>>>
>>>>
>>>> Oleksiy Stashok wrote:
>>>>>
>>>>>> I think since I am using glassfish-prelude v3 it still uses v2
>>>>>> configuraiton
>>>>>> scheme, if I am correct it's sun-domain_1_3.dtd which has all
>>>>>> network
>>>>>> configuration under the <http-service> element. So I am not sure
>>>>>> where to
>>>>>> set the protocol-finder name under this scheme.
>>>>> I think there is no way to use port unification with prelude :(
>>>>> Will it be a problem for you to use latest promoted GFv3 [1]?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> WBR,
>>>>> Alexey.
>>>>>
>>>>> [1] http://download.java.net/glassfish/v3/promoted/
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Mohamed
>>>>>>
>>>>>> Oleksiy Stashok wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> you can take a look at config module in grizzly workspace [1].
>>>>>>> There you can find unit tests with different configurations like
>>>>>>> [2],
>>>>>>> which actually has port unification enabled, but you can
>>>>>>> redefine
>>>>>>> config to use X-protocol directly without port unification.
>>>>>>>
>>>>>>> WBR,
>>>>>>> Alexey.
>>>>>>>
>>>>>>>
>>>>>>> [1] svn checkout
>>>>>>> https://www.dev.java.net/svn/grizzly/trunk/code/modules/config
>>>>>>> [2]
>>>>>>> <network-config>
>>>>>>> <transports>
>>>>>>> <transport name="tcp"/>
>>>>>>> </transports>
>>>>>>> <protocols>
>>>>>>> <protocol name="pu-protocol">
>>>>>>> <port-unification>
>>>>>>> <protocol-finder name="http-finder"
>>>>>>> classname="com.sun.grizzly.http.portunif.HttpProtocolFinder"
>>>>>>> protocol="http"/>
>>>>>>> <protocol-finder name="X-protocol-finder"
>>>>>>> classname="com.sun.grizzly.config.XProtocolFinder" protocol="X-
>>>>>>> protocol"/>
>>>>>>> </port-unification>
>>>>>>> </protocol>
>>>>>>>
>>>>>>> <protocol name="http">
>>>>>>> <http enable-comet-support="true"/>
>>>>>>> </protocol>
>>>>>>>
>>>>>>> <protocol name="X-protocol">
>>>>>>> <protocol-chain-instance-handler>
>>>>>>> <protocol-chain>
>>>>>>> <protocol-filter name="x-filter"
>>>>>>> classname="com.sun.grizzly.config.XProtocolFilter"/>
>>>>>>> </protocol-chain>
>>>>>>> </protocol-chain-instance-handler>
>>>>>>> </protocol>
>>>>>>>
>>>>>>> </protocols>
>>>>>>> <network-listeners>
>>>>>>> <thread-pool name="defaultThreadPool"/>
>>>>>>> <network-listener name="http-listener" port="38082"
>>>>>>> transport="tcp" protocol="pu-protocol" thread-
>>>>>>> pool="defaultThreadPool"/>
>>>>>>> </network-listeners>
>>>>>>> </network-config>
>>>>>>>
>>>>>>>
>>>>>>> On Oct 5, 2009, at 15:14 , melshami wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Hi Alexey,
>>>>>>>>
>>>>>>>> Thanks very much for the prompt reply. I am a bit confused to
>>>>>>>> be
>>>>>>>> honest
>>>>>>>> since I am new to Grizzly. But I wish to configure a listener
>>>>>>>> which
>>>>>>>> listens
>>>>>>>> to custom TCP based protocol. As a starting point I am trying
>>>>>>>> to
>>>>>>>> configure a
>>>>>>>> simple echo server which replies to socket connections on
>>>>>>>> GlassFish
>>>>>>>> v3.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Mohamed
>>>>>>>>
>>>>>>>>
>>>>>>>> Oleksiy Stashok wrote:
>>>>>>>>>
>>>>>>>>> Hi Mohamed,
>>>>>>>>>
>>>>>>>>>> I can't seem to find any documentation for how to configure
>>>>>>>>>> grizlly
>>>>>>>>>> listeners and connectors on GlassFish v3.
>>>>>>>>> Currently doc team is working on that.
>>>>>>>>>
>>>>>>>>>> So far I can find only this page
>>>>>>>>>> http://wiki.glassfish.java.net/Wiki.jsp?
>>>>>>>>>> page=GrizzlyConfigOnePager,
>>>>>>>>>> which
>>>>>>>>>> refers to a new scheme and it's not complete yet.
>>>>>>>>>>
>>>>>>>>>> Anyone can help with this please?
>>>>>>>>> Do you have any specific item in mind you'd like to configure?
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>> WBR,
>>>>>>>>> Alexey.
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> BR,
>>>>>>>>>> Mohamed
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://www.nabble.com/Grizzly-configuration-on-Glassfish-v3-tp25750048p25750048.html
>>>>>>>>>> Sent from the Grizzly - Users mailing list archive at
>>>>>>>>>> Nabble.com.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-
>>>>>>>>>> unsubscribe_at_grizzly.dev.java.net
>>>>>>>>>> For additional commands, e-mail: users-
>>>>>>>>>> help_at_grizzly.dev.java.net
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>>>>>>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/Grizzly-configuration-on-Glassfish-v3-tp25750048p25750628.html
>>>>>>>> Sent from the Grizzly - Users mailing list archive at
>>>>>>>> Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>>>>>>> For additional commands, e-mail: users-
>>>>>>>> help_at_grizzly.dev.java.net
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Grizzly-configuration-on-Glassfish-v3-tp25750048p25752899.html
>>>>>> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>>>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Grizzly-configuration-on-Glassfish-v3-tp25750048p25765021.html
>>> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Grizzly-configuration-on-Glassfish-v3-tp25750048p25766557.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>