dev@glassfish.java.net

Re: GFv3 b41 and Grizzly 1.9.10 and ssl implementations

From: Henry Story <Henry.Story_at_Sun.COM>
Date: Thu, 26 Mar 2009 22:57:28 +0100

On 26 Mar 2009, at 21:48, Kedar Mhaswade wrote:

> Henry,
>
> You might be actually caught up into this bad naming of things
> in GlassFish configuration. The things you think are Java system-
> properties
> are in fact not ;), they are just <system-property> elements which are
> not sent as -D's to the Java command line when you start the server.
> Thus, they won't be available to System.getProperty() calls.

I was worried about that for a while. But then I found that setting
the property to a non existent implementation such as

$bin/asadmin list-system-properties
com
.sun
.grizzly
.ssl
.sslImplementation
=org.jsslutils.extra.apachetomcat6.JSSLutilsImplementation

would end up throwing an exception such as

[#|2009-03-26T20:00:35.322+0100|SEVERE|glassfish|grizzly|
_ThreadID=16;_ThreadName=Thread-1;|Unable to load class org.jsslutils
.extra.apachetomcat6.JSSLutilsImplementation
java.lang.ClassNotFoundException:
org.jsslutils.extra.apachetomcat6.JSSLutilsImplementation
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
374)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:247)
         at
com.sun.grizzly.util.ClassLoaderUtil.load(ClassLoaderUtil.java:166)
         at
com.sun.grizzly.util.ClassLoaderUtil.load(ClassLoaderUtil.java:154)
         at
com
.sun
.grizzly
.http
.SelectorThreadConfig.configureProperties(SelectorThreadConfig.java:364)
         at
com
.sun
.grizzly.http.SelectorThreadConfig.configure(SelectorThreadConfig.java:
378)
         at
com.sun.grizzly.http.SelectorThread.initEndpoint(SelectorThread.java:
1026)
         at
com
.sun
.enterprise
.v3
.services
.impl.GrizzlyServiceListener.start(GrizzlyServiceListener.java:67)
         at com.sun.enterprise.v3.services.impl.GrizzlyProxy
$1.run(GrizzlyProxy.java:211)
|#]

So that it did look like grizzly was picking up on that system property.


> So, please use create/delete/list-jvm-options command to do what you
> need.

Thanks for pointing out that command. That is good to know of.

> I am assuming that you do want to make these entities as Java System
> Properties (-D's).

Well if I try that, after removing the system-properties

hjs_at_bblfish-2:0$ bin/asadmin list-jvm-options
-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/
login.conf
-Dcom.sun.grizzly.ssl.auth=need
-XX: LogVMOutput
-XX: UnlockDiagnosticVMOptions
-
Dcom
.sun
.enterprise
.config
.config_environment_factory_class
=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks
-XX:NewRatio=2
-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/
cacerts.jks
-client
-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}$
{com.sun.aas.javaRoot}/jre/lib/ext${path.separator}$
{com.sun.aas.instanceRoot}/lib/ext${path.separator}$
{com.sun.aas.derbyRoot}/lib
-Xmx512m
-XX:MaxPermSize=192m
-
Dcom
.sun
.grizzly
.ssl
.sslImplementation=org.jsslutils.extra.grizzly.JSSLutilsImplementation
-Djava.endorsed.dirs=${com.sun.aas.installRoot}/lib/endorsed
-XX:LogFile=${com.sun.aas.instanceRoot}/logs/jvm.log

It still loads the org.jsslutils.extra.grizzly.JSSLutilsImplementation

$ grep -i jss domains/domain1/logs/server.log
[#|2009-03-26T22:50:41.588+0100|FINE|glassfish|
org.jsslutils.extra.grizzly|
_ThreadID=18;_ThreadName=Thread-1;ClassName=null;MethodName=null;|
org.jsslutils.extra.grizzly.JSSLutilsImplementation instantiated.|#]
[#|2009-03-26T22:50:42.292+0100|FINE|glassfish|
org.jsslutils.extra.grizzly|
_ThreadID=21;_ThreadName=Thread-1;ClassName=null;MethodName=null;|
org.jsslutils.extra.grizzly.JSSLutilsImplementation instantiated.|#]
[#|2009-03-26T22:50:42.307+0100|FINE|glassfish|
org.jsslutils.extra.grizzly|
_ThreadID=22;_ThreadName=Thread-1;ClassName=null;MethodName=null;|
org.jsslutils.extra.grizzly.JSSLutilsImplementation instantiated.|#]

If I remove that jvm option the above log entries do not appear. So
clearly it does not matter in this case if one adds them to the system-
properties or the jvm-properties.

But thanks for the thought,

        Henry

>
>
> Regards,
> Kedar
>
> PS - I don't have a way to address this as yet :(