Skip to main content

Can't start Glassfish using Solaris 10 SMF

5 replies [Last post]
whartung
Offline
Joined: 2003-06-13

Following http://blogs.sun.com/bloggerkedar/entry/app_server_and_solaris_10 I created an SMF file for Glassfish V1b14 running on Solaris 10 w/ JDK 1.5_07 in a Solaris Zone.

When I run the asadmin from the command line, the domain starts right up.

But when I try and start it up using SMF, it goes in to maintenance mode because the server says there's a conflict with port 80.

I can assure you that there's no conflict. My domain is configured to start on port 80, however.

But if I do:

$ asadmin start-domain ...

$ asadmin stop-domain ...
$ svcadm clean mydomainservice

The service will try to start but bump in to port 80.

The SMF xml file looks pretty blunt and straightforward. Nothing really clever appears to be going on in there.

Any ideas why this is flailing?

P.S. Kudos for adding the create-service command to integrate with SMF.

Server log details:

[#|2007-04-03T21:33:51.937-0700|INFO|sun-appserver-pe9.0|javax.enterprise.tools.launcher|_ThreadID=10;_ThreadName=main;|
/usr/jdk/instances/jdk1.5.0/jre/../bin/java
-client
-Xmx512m
-XX:NewRatio=2
-Dcom.sun.aas.defaultLogFile=/opt/local/java/domains/mydomain/logs/server.log
-Djava.endorsed.dirs=/opt/local/java/glassfish/lib/endorsed
-Djava.security.policy=/opt/local/java/domains/mydomain/config/server.policy
-Djava.security.auth.login.config=/opt/local/java/domains/mydomain/config/login.conf
-Dsun.rmi.dgc.server.gcInterval=3600000
-Dsun.rmi.dgc.client.gcInterval=3600000
-Djavax.net.ssl.keyStore=/opt/local/java/domains/mydomain/config/keystore.jks
-Djavax.net.ssl.trustStore=/opt/local/java/domains/mydomain/config/cacerts.jks
-Djava.ext.dirs=/usr/jdk/instances/jdk1.5.0/jre/../jre/lib/ext:/opt/local/java/domains/mydomain/lib/ext:/opt/local/java/glassfish/javadb/lib
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
-Dcom.sun.enterprise.taglisteners=jsf-impl.jar
ng.jar,commons-launcher.jar
-Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,dbschema.jar,j2ee-svc.jar
-Dcom.sun.aas.classloader.serverClassPath.ee=%HADB_HOME%/lib/hadbjdbc4.jar,/opt/local/java/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbm.jar,%HADB_HOME%/lib/hadbmgt.jar,%MFWK_HOME%/lib/mfwk_instrum_tk.jar
-Dcom.sun.aas.configName=server-config
-Ddomain.name=mydomain
-Djmx.invoke.getters=true
-Dcom.sun.aas.promptForIdentity=true
-Dcom.sun.aas.classloader.optionalOverrideableChain.ee=
-Dcom.sun.aas.instanceRoot=/opt/local/java/domains/mydomain
-Dcom.sun.aas.domainName=mydomain
-Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,/usr/jdk/instances/jdk1.5.0/jre/../lib/tools.jar,install/applications/jmsra/imqjmsra.jar,commons-launcher.jar,/opt/local/java/glassfish/imq/lib/jaxm-api.jar,/opt/local/java/glassfish/imq/lib/fscontext.jar,/opt/local/java/glassfish/imq/lib/imqbroker.jar,/opt/local/java/glassfish/imq/lib/imqjmx.jar,/opt/local/java/glassfish/imq/lib/imqxm.jar,/opt/local/java/glassfish/lib/ant/lib/ant.jar,appserv-ws.jar,mail.jar,jsf-api.jar,jsf-impl.jar,appserv-jstl.jar,appserv-env.jar,jmxremote_optional.jar,/opt/local/java/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,commons-logging.jar,activation.jar,appserv-rt.jar,appserv-admin.jar,appserv-cmp.jar
-Dcom.sun.aas.classloader.sharedChainJars.ee=appserv-se.jar,appserv-ee.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbjdbc4.jar,jgroups-all.jar,%MFWK_HOME%/lib/mfwk_instrum_tk.jar
-Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
-Dcom.sun.enterprise.overrideablejavaxpackages=javax.xml.bind,javax.help,javax.portlet
-Dcom.sun.aas.classloader.serverClassPath=/opt/local/java/glassfish/lib/install/applications/jmsra/imqjmsra.jar,/opt/local/java/glassfish/imq/lib/jaxm-api.jar,/opt/local/java/glassfish/imq/lib/fscontext.jar,/opt/local/java/glassfish/imq/lib/imqbroker.jar,/opt/local/java/glassfish/imq/lib/imqjmx.jar,/opt/local/java/glassfish/lib/ant/lib/ant.jar,/opt/local/java/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar
-Dcom.sun.aas.classloader.appserverChainJars.ee=
-Dcom.sun.aas.configRoot=/opt/local/java/glassfish/config
-Djava.library.path=/usr/jdk/instances/jdk1.5.0/jre/lib/i386/server:/usr/jdk/instances/jdk1.5.0/jre/lib/i386:/usr/jdk/instances/jdk1.5.0/jre/../lib/i386:/opt/local/java/glassfish/lib:/usr/lib/lwp:/usr/jdk/instances/jdk1.5.0/jre/lib/i386/server:/usr/jdk/instances/jdk1.5.0/jre/lib/i386:/usr/jdk/instances/jdk1.5.0/jre/../lib/i386:/opt/local/java/glassfish/lib:/opt/local/java/glassfish/lib:/opt/local/java/glassfish/lib::/usr/lib
-Dcom.sun.aas.instanceName=server
-Dcom.sun.aas.processLauncher=SE
-Dcom.sun.aas.installRoot=/opt/local/java/glassfish
-Dcom.sun.aas.ClassPathPrefix=
-Dcom.sun.aas.ClassPathSuffix=
-Dcom.sun.aas.ServerClassPath=
-cp
:/opt/local/java/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start|#]

[#|2007-04-03T21:33:52.638-0700|INFO|sun-appserver-pe9.0|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Starting Sun Java System Application Server Platform Edition 9.0_01 (build b14) ...|#]

[#|2007-04-03T21:33:54.102-0700|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;80;|A conflict occured on port 80 . Server is shutting down.|#]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Binod


One more *very* important thing you'd be able to achieve -- if you are
not a root user and still want to use the privileged ports (<1024). SMF
provides a hook called * "net_privaddr" *, you'd be able to listen on
privileged ports! You can just pass this flag on --serviceproperties on
the create-service command line like: create-service --serviceproperties
netaddr_priv ...

It is not clear from your post , whether you have taken care of the
above portion from Kedar's blog...

Did you?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

whartung
Offline
Joined: 2003-06-13

I'm running svcadm from root. I don't know what user the smf will start under (I'm not super familiar with it). But I will try that and see if it starts to work. That makes good sense.

kedar

On Apr 3, 2007, at 10:24 PM, glassfish@javadesktop.org wrote:

> I'm running svcadm from root. I don't know what user the smf will
> start under (I'm not super familiar with it). But I will try that
> and see if it starts to work. That makes good sense.
>

Hi whartung,

Can you please try to have a domain with a port other than 80, first?
Like Binod said, it is correct that we have to use the netaddr_priv,
but if
- the domain's owner (the OS user who owns domain's folder) is root, and
- you are doing everything as root,

there shouldn't be any problem and you should be able to use domain with
port and you do have special privileges.

Alternatively, if you do want to use the port 80, can you add the
following option
to domain.xml and see if it works:
com.sun.enterprise.server.ss.ASQuickStartup=false options>

I vaguely remember the "conflict on port xxxx" message ...

Please let me know if this works.

Regards,
Kedar

PS - Glad that you like SMF integration

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

whartung
Offline
Joined: 2003-06-13

I think I got it.

The key I think is this (from the manifest XML):

group=":default"
privileges="basic"/>

This is the default Glassfish configuration. Even though it says it's using "root", the privileges of "basic" prevents the use of port 80.

I changed it (by hand) to this:

group=":default"
privileges="basic,net_privaddr"/>

and reimported with svccfg. Then I cleared maintenance mode with svcadm, and it came up.

When I looked at some of the other manifests, they leave the privileges clause off, so they default to I guess whatever comes with root. But by specifying "basic", you immediately restrict the "power of root".

Mind, I'm making most of the up -- it's really late here and I'm not the SMF wizard. But that's what I'm guessing is happening. However, it seems to be starting at the moment and that's enough for now. My only concern now is what other rights is "root" missing that I'm assuming it may already have.

I may simply punt on that and create a glassfish user anyway, but it's still a bit of a question I need to answer one way or the other.

Thanx for the fast responses.

kedar

I am not so sure, but good, if it works for you :)

Maybe the default configuration of the manifest XML should say
netaddr_priv?

Once you have "solaris.smf.*" privileges, I think we should make
netaddr_priv available by default. I will think more and ask the
smf-discuss alias on opensolaris.

Kedar

On Apr 3, 2007, at 10:54 PM, glassfish@javadesktop.org wrote:

> I think I got it.
>
> The key I think is this (from the manifest XML):
>
> > group=":default"
> privileges="basic"/>
>
> This is the default Glassfish configuration. Even though it says
> it's using "root", the privileges of "basic" prevents the use of
> port 80.
>
> I changed it (by hand) to this:
>
> > group=":default"
> privileges="basic,net_privaddr"/>
>
> and reimported with svccfg. Then I cleared maintenance mode with
> svcadm, and it came up.
>
> When I looked at some of the other manifests, they leave the
> privileges clause off, so they default to I guess whatever comes
> with root. But by specifying "basic", you immediately restrict the
> "power of root".
>
> Mind, I'm making most of the up -- it's really late here and I'm
> not the SMF wizard. But that's what I'm guessing is happening.
> However, it seems to be starting at the moment and that's enough
> for now. My only concern now is what other rights is "root" missing
> that I'm assuming it may already have.
>
> I may simply punt on that and create a glassfish user anyway, but
> it's still a bit of a question I need to answer one way or the other.
>
> Thanx for the fast responses.
> [Message sent by forum member 'whartung' (whartung)]
>
> http://forums.java.net/jive/thread.jspa?messageID=211186
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net