Building GlassFish on FreeBSD, too...........

How to build Glassfish on FreeBSD Quick note on how to build and run Glassfish on FreeBSD

Requirement:

FreeBSD 6.0 or higher
cvs client binary
Apache ANT 1.6.5
Apache Maven 1.0.2
JDK1.5 (1.5.0_06 or higher)
i) Download the source SCSL or JRL and build from the JDK 1.5 from scratch.
   You also linux version of jdk 1.4.0 rpm bits for building JDK 1.5 .
or
ii)  Get the FreeBSD port version of JDK 1.5 - http://www.freebsdfoundation.org/downloads/java.shtml

Make sure you understand and agree to all those license agreement that goes with these software in source and binary format e.g. Apache license, GNU licence, CDDL and etc...... ;-)
Assume the target system have enough disk space and memory and the system is also configure to use the FreeBSD port collection from /usr/ports .

Start building Java EE 5 on FreeBSD

1) Install and add all those require and avaliable utilities software tools.
 
i) For installation of JDK -
Since Sun does not have official JDK 1.5 on FreeBSD platform. Therefore, we either have to build our own jdk from the source(note 1), or with the help from FreeBSD's java user group, there is a port version of jdk 1.5 being done (download and install from here).

ii) For installation of Apache Maven -
  cd  /usr/ports/devel/maven
  make install clean
 
iii) For installation of Apache ANT -
  cd /usr/ports/devel/apache-ant
  make install clean

iv) For installation of ported NSS -
  cd /usr/ports/security/nss
  make install clean

v) For installation of ported NSPR -
  cd /usr/ports/devel/nspr
  make install clean

2) Environment setting after step 1 is done :

For example:  bash shell default environment setting:
JAVA_HOME=/usr/local/diablo-jdk1.5.0
MAVEN_HOME=/usr/local/share/java/maven
ANT_HOME=/usr/local
CVSROOT=:pserver:<java.net_userid>@cvs.dev.java.net:/cvs
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
export JAVA_HOME MAVEN_HOME ANT_HOME CVSROOT PATH

3) Checking out the GlassFish source and building from scratch or download the source bundle from here 
          (Remember to check the GlassFish Build FAQ wiki if you run into problems.)
   
  1. The first step is to checkout the module dependencies and common files used in the build system and edit the properties file.
  2. % mkdir workspace
    % cd workspace
    % cvs -d :pserver:<userid>@cvs.dev.java.net:/cvs checkout glassfish/bootstrap
    This will checkout project.xml, maven.xml, project.properties, and common files referenced from project.xml.
    Edit glassfish/bootstrap/project.properties for the following properties name value:

    glassfish.os.name=Darwin (since Darwin and FreeBSD have the same family root (ancestor "BSD"), and please see FAQ 1.)
    glassfish.cvs.username=hyau (use the same login name that you have for http://glassfish.dev.java.net)
  3. Next checkout the sources.
    % cd glassfish/bootstrap
    % maven checkout (There are different tag to choose from note 4.)
  4. Bootstrap the server image (a collection of  image and jar files used to run glassfish).
  5. % maven bootstrap-all
    or
    % maven bootstrap (only if you have build before)
  6. Build the checked out source code.
  7. % maven build
  8. Configure the GlassFish Server runtime.  This step will create the asadmin script, run create-domain, etc which are needed to run the GlassFish server.
  9. % maven configure-runtime (Please read the note 2 before running this command.)
  10. Starting  up the server using the asadmin command in <glassfish.root>/publish/bin directory.

  11. <glassfish.root>/publish/bin/asadmin start-domain

  12. Start accessing the newly compile build GlassFish (Java EE).
  13.  From any browser:
    http://hostname:4848
    http://hostname:8080
Note:

1) Download these file ahead of time into /usr/ports/distfiles directory for build jdk 1.5 from source.

Patch require for using port jdk on FreeBSD - bsd-jdk15-patches-1.tar.bz2
Require jdk 1.4.2_08 for build jdk 1.5 - j2sdk-1_4_2_08-linux-i586.bin(older version)
Require jdk bin source file - jdk-1_5_0-bin-scsl.zip
Require jdk scsl source file - jdk-1_5_0-src-scsl.zip
mkdir /compat/linux/proc
Build steps:
1) cd /usr/ports/java/jdk15
2) make install clean

2) Before running the command "maven configure-runtime", please make sure to do the following:

- go to <install-dir>/lib/install/templates
- vi asadmin.template
- add -Dderby.storage.fileSyncTransactionLog="true" to the template
(https://glassfish.dev.java.net/issues/show_bug.cgi?id=8)

3) Replace those native to appropiate directories e.g certutil, pk12util , modutil, nss and nspr library files.
           ( optional: this step may go away in the future or if you are using any native security utilities)

cp /usr/local/bin/certutil <glassfish.root>/publish/lib/
cp /usr/local/bin/pk12util <glassfish.root>/publish/lib/
cp /usr/local/bin/modutil <glassfish.root>/publish/lib/
cp /usr/local/lib/libns\*.\*  <glassfish.root>/publish/lib/

cp /usr/local/bin/certutil <glassfish.root>/publish/imq/bin/
cp /usr/local/bin/ssltrap <glassfish.root>/publish/imq/bin/
cp /usr/local/lib/libns\*.\*  <glassfish.root>/publish/imq/lib/

4) As glassfish/bootstrap/project.properties has variable "glassfish.cvstag" set as "glassfish.cvstag=SJSAS90_FCS_BRANCH" FCS Branch sources will be checked out and built accordingly.

5) May require jdk 1.4 installed before using /usr/ports to install "maven" and "ant"

- Require jdk 1.4.2_08 for installing maven and ant  j2sdk-1_4_2_08-linux-i586.bin (older or newer version)
- It is not require to set any JAVA_HOME, when installing FreeBSD Ports' of "maven" or "ant".
- Or else you could download the maven 1.0.2 and ant 1.6.5 directly from their own web site respectively.

FAQ

Question 1 : How come if  I use "glassfish.os.name=FreeBSD", "maven bootstrap-all" build failed?
Answer: Yes, you will see build failed and the following error message.  Sun does not have native official ported for GlassFish for FreeBSD.
              GlassFish have build only on MacOS,  Linux,  SunOS,  SunOS,_X86 Windows.

The following will be the native core that may cause
Attempting to download imq-4.0-20060303.jar.
WARNING: Failed to download imq-4.0-20060303.jar.
Attempting to download appserv-native-9.0-b40.jar.
WARNING: Failed to download appserv-native-9.0-b40.jar.
Attempting to download nss-util-3_3_11_BETA2.jar.
WARNING: Failed to download nss-util-3_3_11_BETA2.jar.
Attempting to download NSsecurity-JES5_20050929.jar.
WARNING: Failed to download NSsecurity-JES5_20050929.jar.

BUILD FAILED
File...... /export/as9_ws/glassfish/bootstrap/maven.xml
Element... maven:reactor
Line...... 58
Column.... 40
The build cannot continue because of the following unsatisfied dependencies:

imq-4.0-20060303.jar
appserv-native-9.0-b40.jar
nss-util-3_3_11_BETA2.jar
NSsecurity-JES5_20050929.jar

Total time: 21 seconds
Finished at: Mon Apr 24 13:37:28 PDT 2006

Workaround:
Temporary workaround for this issue you have to set " glassfish.os.name=Darwin" for now.
( until the native code ready or the removal of those native code.)


Question 2:  It seems https is not working fine or keytool (java utility tool) is not working?
Answer: Yes, I have report to the FreeBSD Java user group about this issue, it is on glassfish issue.

Question 3: How to clean the build?
Answer: You could use the "maven clobber"

Question 4:  If a simple way to install and build Glassfish on FreeBSD?
Answer: Yes, I am trying to work on the porting and at the same time studying on the porters-handbook.  ;-)
        If you want to help, please me.

Question 5: How to view glassfish source?
Answer: Source code - CVS - https://glassfish.dev.java.net/source/browse/glassfish/
        FishEye for GlassFish - http://fisheye5.cenqua.com/viewrep/glassfish

Question 6: Which cvs tag source tree I have build on which version of FreeBSD?
Answer: I have try build on Glassfish build 43 on FreeBSD 6.0 and SJSAS90_FCS_BRANCH (5/13/2006)on FreeBSD 6.1.
        (At least, these are the source tag and OS version that I have build Glassfish successfully.)


Question 7: What should I do if there is a JVM crash when using the "Ported Java" from FreeBSD Foundation Java? to
Answer: I will suggest you to join and send you questions to "freebsd-java" email alias from suggestion.


Question 8: What if I could not build from glassfish source and other glassfish related issues?
Answer:  I will suggest you to join and send you enquiry to GlassFish Forum or get more GlassFish TechTips and Blog information.
             
               And as always, you should bookmark these url from latest OpenJavaEE / GlassFish new and information.
              GlassFish Community Building an Open Source Java EE 5 Application Server  - https://glassfish.dev.java.net/
               A blog about Open Source Java EE (J2EE)/GlassFish - http://blogs.sun.com/roller/page/theaquarium



Reference URL :

http://java.sun.com
http://java.sun.com/javaee

https://glassfish.dev.java.net
https://glassfish.dev.java.net/public/BuildGlassFish

http://www.freebsd.org/java/
http://www.freebsd.org/java/install.html
http://www.freebsd.org/java/links/freebsd.html
http://www.freebsdfoundation.org/downloads/java.shtml

All copyrights and trademarks have their own respective owner.


Comments:

Hello, Could you please tell me why Sun does not have official JDK 1.5 on FreeBSD platform?

Posted by Arab on February 01, 2007 at 07:08 AM PST #

First

diablo-jdk-1.5.0 does not contain sun.security.pkcs11 package. It should be jar sunpkcs11.jar in JAVA_HOME/jre/lib/ext.

so, the example where you offer set JAVA_HOME=/usr/local/diablo-jdk1.5.0 is a bit confusing.

Eventually after an hour of building of glassfish you get an error -- sun.security.pkcs11 does not exist

what you need is to install java/jdk15 -- this version contains pkcs11.
Set it as default JDK by $export JAVA_HOME=/usr/local/jdk15

-----------------------------------------------------------------
Second
checkout command is not exactly right.
we need to checkout another branch -- SJSAS91_UR1_BRANCH
$cvs -d :pserver:<login>@cvs.dev.java.net:/cvs co -r SJSAS91_UR1_BRANCH glassfish/bootstrap

------------------------------------------------------------------
Third
edit /glassfish/appserv-core-ee/appserv-core/build.xml
and change source from "${javac.source}" to "1.5"

<target name="compile-platform">
<javac srcdir="${src.dir.platform}"
....
source="1.5"

I do not exactly understand why I get error If I do not do it.

Posted by alex on January 07, 2008 at 07:05 AM PST #

Additional info to my previous post
1.
ANT_HOME setting is wrong -- it is an error building admin-gui saying that ant libs are missed
the correct ANT_HOME is:
$export ANT_HOME=/usr/local/share/java/apache-ant/

however PATH should contain /usr/local/bin folder -- where ant is placed.

----------------------------------------------------------------------
2.
I was wrong saying that port jdk-1.5 contains JAVA_HOME/jre/lib/ext/sunpkcs11.jar. It does not. So, I copied this jar from official windows jdk 1.5 installation. I think Linux installation also has it. Maybe people should try to install linux-jdk-1.5 to get this jar.

--------------------------
3. Note 2 from this instruction is not necessary (add -Dderby.storage.fileSyncTransactionLog="true" to the template) -- the bug was fixed.

After all this workrounds I was able to build and start glassfish 9.1.

Posted by alex on January 08, 2008 at 07:37 AM PST #

Hi Alex,

I would like to say "Thanks" for your comments.
It does help others who want to build GlassFish"Open source application Server".

Thanks,
Homer

Posted by Homer Yau on January 17, 2008 at 03:07 PM PST #

I started with the binary build for Mac OS X on FreeBSD with a few name changes to Darwin and got a few errors. After completing this build process (Thanks, by the way to both Homer and Alex) I get the same errors. It looks like the system is trying to start up RMI or a related service on port 0. I can't find anywhere where I can configure this. Below is my startup error. Have you seen it before and can you point me in the right direction to fix it? I'll also post this question to the glass fish lists.

[#|2008-03-09T01:47:18.792-0700|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=11;_ThreadName=pool-1-thread-2;com.sun.enterprise
.interceptor.DynamicInterceptor;|MBeanServer started: com.sun.enterprise.interceptor.DynamicInterceptor|#]

[#|2008-03-09T01:47:22.176-0700|WARNING|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;|ADM5801:Admin serv
er channel creation failed.|#]

[#|2008-03-09T01:47:22.215-0700|SEVERE|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|UnknownException during st
artup. Disable quick startup by setting system property com.sun.enterprise.server.ss.ASQuickStartup to false
com.sun.appserv.server.ServerLifecycleException: java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Can't assign requested address
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createRMIChannel(AdminChannel.java:111)
at com.sun.enterprise.admin.server.core.AdminChannelLifecycle.onInitialization(AdminChannelLifecycle.java:74)
at com.sun.enterprise.server.ss.ASLazyKernel.initializeAdminService(ASLazyKernel.java:213)
at com.sun.enterprise.server.ss.ASLazyKernel.startASSocketServices(ASLazyKernel.java:98)
at com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:92)
at com.sun.enterprise.server.PEMain.run(PEMain.java:401)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
Caused by: java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Can't assign requested address
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:184)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:155)
at com.sun.enterprise.admin.server.core.channel.AdminChannelServer.<init>(AdminChannelServer.java:102)
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createServerObject(AdminChannel.java:251)
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createRMIChannel(AdminChannel.java:106)
... 11 more
Caused by: java.net.BindException: Can't assign requested address
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at com.sun.enterprise.server.ss.provider.ASServerSocket.bind(ASServerSocket.java:296)
at com.sun.enterprise.server.ss.provider.ASServerSocketImpl.listen(ASServerSocketImpl.java:166)
at java.net.ServerSocket.bind(ServerSocket.java:320)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at com.sun.enterprise.admin.server.core.channel.LocalRMIServerSocketFactory.createServerSocket(LocalRMIServerSocketFactory.java:92)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:622)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:237)
... 21 more
|#]

[#|2008-03-09T01:47:22.456-0700|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;|java.lang.RuntimeEx
ception: Admin Server Channel is not initialized
at com.sun.enterprise.admin.server.core.channel.AdminChannel.assertAdminServerChannelNotNull(AdminChannel.java:373)
at com.sun.enterprise.admin.server.core.channel.AdminChannel.setRMIChannelAborting(AdminChannel.java:199)
at com.sun.enterprise.admin.server.core.AdminChannelLifecycle.onAbort(AdminChannelLifecycle.java:116)
at com.sun.enterprise.server.ss.ASLazyKernel.abortAdminService(ASLazyKernel.java:226)
at com.sun.enterprise.server.ss.ASLazyKernel.exitServer(ASLazyKernel.java:121)
at com.sun.enterprise.server.ss.ASLazyKernel.startASSocketServices(ASLazyKernel.java:112)
at com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:92)
at com.sun.enterprise.server.PEMain.run(PEMain.java:401)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
|#]

Posted by Jason Robey on March 08, 2008 at 04:56 PM PST #

Hi Jason,

In the domain.xml, have you try to at add the following jvm-options and restart the GlassFish?

<java-config>
......
<jvm-options>-Dcom.sun.enterprise.server.ss.ASQuickStartup=false</jvm-options>
......
</java-config>

Thanks,
Homer

Posted by Homer Yau on March 13, 2008 at 04:25 AM PDT #

Homer,

Thanks for the response. I did try that--I still get the same problem: trying to start a service on port 0. Below is the error if you have any other ideas. I'm going to have my client install Solaris, Linux, or Windows barring my getting this working. I really like the ports system of FreeBSD, but I'm not sure I can hold off productivity for too much longer. I'll greatly appreciate any help you have time to give. Thanks again for your time on this already!

Jason Robey

Start-up logs:
Mar 13, 2008 9:35:39 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
/usr/local/diablo-jdk1.5.0/jre/../bin/java
-Dcom.sun.aas.instanceRoot=/root/workspace/publish/glassfish/domains/stocker
-Dcom.sun.aas.ClassPathPrefix=
-Dcom.sun.aas.ClassPathSuffix=
-Dcom.sun.aas.ServerClassPath=
-Dcom.sun.aas.classloader.appserverChainJars.ee=
-Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,j2ee-svc.jar
-Dcom.sun.aas.classloader.excludesList=admin-cli.jar,appserv-upgrade.jar,sun-appserv-ant.jar
-Dcom.sun.aas.classloader.optionalOverrideableChain.ee=
-Dcom.sun.aas.classloader.optionalOverrideableChain=webservices-rt.jar,webservices-tools.jar
-Dcom.sun.aas.classloader.serverClassPath.ee=/lib/hadbjdbc4.jar,/root/workspace/publish/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,/lib/dbstate.jar,/li
b/hadbm.jar,/lib/hadbmgt.jar,/lib/mfwk_instrum_tk.jar
-Dcom.sun.aas.classloader.serverClassPath=/root/workspace/publish/glassfish/lib/install/applications/jmsra/imqjmsra.jar,/root/workspace/publish/glassf
ish/imq/lib/jaxm-api.jar,/root/workspace/publish/glassfish/imq/lib/fscontext.jar,/root/workspace/publish/glassfish/imq/lib/imqbroker.jar,/root/workspa
ce/publish/glassfish/imq/lib/imqjmx.jar,/root/workspace/publish/glassfish/lib/ant/lib/ant.jar,/root/workspace/publish/glassfish/lib/ant/lib/ant-launch
er.jar,/root/workspace/publish/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar
-Dcom.sun.aas.classloader.sharedChainJars.ee=appserv-se.jar,appserv-ee.jar,jesmf-plugin.jar,/lib/dbstate.jar,/lib/hadbjdbc4.jar,jgroups-all.jar,/lib/m
fwk_instrum_tk.jar
-Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,/usr/local/diablo-jdk1.5.0/jre/../lib/tools.jar,install/applications/jmsra/imqjmsra.jar,com-sun-c
ommons-launcher.jar,com-sun-commons-logging.jar,/root/workspace/publish/glassfish/imq/lib/jaxm-api.jar,/root/workspace/publish/glassfish/imq/lib/fscon
text.jar,/root/workspace/publish/glassfish/imq/lib/imqbroker.jar,/root/workspace/publish/glassfish/imq/lib/imqjmx.jar,/root/workspace/publish/glassfis
h/imq/lib/imqxm.jar,webservices-rt.jar,webservices-tools.jar,mail.jar,appserv-jstl.jar,jmxremote_optional.jar,/root/workspace/publish/glassfish/lib/SU
NWjdmk/5.1/lib/jdmkrt.jar,activation.jar,appserv-rt.jar,appserv-admin.jar,appserv-cmp.jar,/root/workspace/publish/glassfish/updatecenter/lib/updatecen
ter.jar,/root/workspace/publish/glassfish/jbi/lib/jbi.jar,/root/workspace/publish/glassfish/imq/lib/imqjmx.jar,/root/workspace/publish/glassfish/lib/a
nt/lib/ant.jar,/root/workspace/publish/glassfish/lib/ant/lib/ant-launcher.jar,dbschema.jar
-Dcom.sun.aas.configName=server-config
-Dcom.sun.aas.configRoot=/root/workspace/publish/glassfish/config
-Dcom.sun.aas.defaultLogFile=/root/workspace/publish/glassfish/domains/stocker/logs/server.log
-Dcom.sun.aas.domainName=stocker
-Dcom.sun.aas.installRoot=/root/workspace/publish/glassfish
-Dcom.sun.aas.instanceName=server
-Dcom.sun.aas.processLauncher=SE
-Dcom.sun.aas.promptForIdentity=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dcom.sun.enterprise.overrideablejavaxpackages=javax.help,javax.portlet
-Dcom.sun.enterprise.server.ss.ASQuickStartup=false
-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
-Dcom.sun.enterprise.taglisteners=jsf-impl.jar
-Dcom.sun.updatecenter.home=/root/workspace/publish/glassfish/updatecenter
-Ddomain.name=stocker
-Djava.endorsed.dirs=/root/workspace/publish/glassfish/lib/endorsed
-Djava.ext.dirs=/usr/local/diablo-jdk1.5.0/jre/../lib/ext:/usr/local/diablo-jdk1.5.0/jre/../jre/lib/ext:/root/workspace/publish/glassfish/domains/stoc
ker/lib/ext:/root/workspace/publish/glassfish/javadb/lib
-Djava.library.path=/root/workspace/publish/glassfish/lib:/root/workspace/publish/glassfish/lib:/root/workspace/publish/glassfish/lib
-Djava.security.auth.login.config=/root/workspace/publish/glassfish/domains/stocker/config/login.conf
-Djava.security.policy=/root/workspace/publish/glassfish/domains/stocker/config/server.policy
-Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
-Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
-Djavax.net.ssl.keyStore=/root/workspace/publish/glassfish/domains/stocker/config/keystore.jks
-Djavax.net.ssl.trustStore=/root/workspace/publish/glassfish/domains/stocker/config/cacerts.jks
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djmx.invoke.getters=true
-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000
-client
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-Xmx512m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=/root/workspace/publish/glassfish/domains/stocker/logs/jvm.log
-cp
/root/workspace/publish/glassfish/lib/jhall.jar:/root/workspace/publish/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start
[#|2008-03-13T21:35:41.749-0600|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Starting Sun Java System Application Server 9.1_01 (build local) ...|#]

[#|2008-03-13T21:35:41.992-0600|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=11;_ThreadName=pool-1-thread-2;com.sun.enterprise.interce
ptor.DynamicInterceptor;|MBeanServer started: com.sun.enterprise.interceptor.DynamicInterceptor|#]

[#|2008-03-13T21:35:45.289-0600|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;Java HotSpot(TM) Client VM;1.5.0;Sun Microsystems Inc.;|CORE5076: Using [Java HotSpot(TM) Client VM, Version 1.5.0] from [Sun Microsystems Inc.]|#]

[#|2008-03-13T21:35:45.816-0600|INFO|sun-appserver9.1|javax.enterprise.resource.jms|_ThreadID=12;_ThreadName=pool-1-thread-7;|Using MQ RA for Broker l ifecycle control|#]

[#|2008-03-13T21:35:45.947-0600|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=13;_ThreadName=pool-1-thread-4;|SEC1002: Securit y Manager is OFF.|#]

[#|2008-03-13T21:35:49.918-0600|WARNING|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;|ADM5801:Admin server chann el creation failed.|#]

[#|2008-03-13T21:35:49.934-0600|SEVERE|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;com.sun.enterprise.admin.server.cor
e.AdminServiceLifeCycle@13e4a5a;com.sun.appserv.server.ServerLifecycleException: java.rmi.server.ExportException: Port already in use: 0; nested excep tion is:
java.net.BindException: Can't assign requested address;|Service com.sun.enterprise.admin.server.core.AdminServiceLifeCycle@13e4a5a cannot be i nitialized! : com.sun.appserv.server.ServerLifecycleException: java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Can't assign requested address|#]

[#|2008-03-13T21:35:49.935-0600|SEVERE|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|CORE5071: An error occured during initialization
com.sun.appserv.server.ServerLifecycleException: java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Can't assign requested address
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createRMIChannel(AdminChannel.java:111)
at com.sun.enterprise.admin.server.core.AdminChannelLifecycle.onInitialization(AdminChannelLifecycle.java:74)
at com.sun.enterprise.admin.server.core.AdminService.init(AdminService.java:300)
at com.sun.enterprise.admin.server.core.AdminServiceLifeCycle.onInitialization(AdminServiceLifeCycle.java:116)
at com.sun.enterprise.server.ApplicationServer.onInitialization(ApplicationServer.java:262)
at com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:101)
at com.sun.enterprise.server.PEMain.run(PEMain.java:401)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
Caused by: java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Can't assign requested address
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:184)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:155)
at com.sun.enterprise.admin.server.core.channel.AdminChannelServer.<init>(AdminChannelServer.java:102)
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createServerObject(AdminChannel.java:251)
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createRMIChannel(AdminChannel.java:106)
... 12 more
Caused by: java.net.BindException: Can't assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at com.sun.enterprise.admin.server.core.channel.LocalRMIServerSocketFactory.createServerSocket(LocalRMIServerSocketFactory.java:92)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:622)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:237)
... 22 more
|#]

[#|2008-03-13T21:35:49.963-0600|SEVERE|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Server Startup failed. Exiting...| #]

[#|2008-03-13T21:35:49.964-0600|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Server shutdown in progress...|#]

[#|2008-03-13T21:35:50.233-0600|WARNING|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|CORE5061: Exception :
com.sun.appserv.server.ServerLifecycleException
at com.sun.enterprise.admin.server.core.JmxConnectorLifecycle.onShutdown(JmxConnectorLifecycle.java:171)
at com.sun.enterprise.server.ApplicationServer.onShutdown(ApplicationServer.java:549)
at com.sun.enterprise.server.ondemand.OnDemandServer.onShutdown(OnDemandServer.java:131)
at com.sun.enterprise.server.PEMain.run(PEMain.java:429)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
|#]

[#|2008-03-13T21:35:50.236-0600|WARNING|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|CORE5061: Exception :
java.lang.RuntimeException: Admin Server Channel is not initialized
at com.sun.enterprise.admin.server.core.channel.AdminChannel.assertAdminServerChannelNotNull(AdminChannel.java:373)
at com.sun.enterprise.admin.server.core.channel.AdminChannel.setRMIChannelStopping(AdminChannel.java:189)
at com.sun.enterprise.admin.server.core.AdminChannelLifecycle.onShutdown(AdminChannelLifecycle.java:103)
at com.sun.enterprise.admin.server.core.AdminService.stop(AdminService.java:485)
at com.sun.enterprise.admin.server.core.AdminServiceLifeCycle.onShutdown(AdminServiceLifeCycle.java:155)
at com.sun.enterprise.server.ApplicationServer.onShutdown(ApplicationServer.java:549)
at com.sun.enterprise.server.ondemand.OnDemandServer.onShutdown(OnDemandServer.java:131)
at com.sun.enterprise.server.PEMain.run(PEMain.java:429)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
|#]

[#|2008-03-13T21:35:51.702-0600|SEVERE|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Server stopped due to Server start up failure.|#]

Posted by Jason Robey on March 13, 2008 at 02:19 PM PDT #

Jason, I was able to get past the "Port already in use: 0" by setting the <jdk-options>-Djava.net.preferIPv4Stack=true</jdk-options> in the domain.xml. But, now I'm having a different start-up problem that I haven't been able to get past, see: http://forums.java.net/jive/thread.jspa?messageID=265318&#265318

If I find anything else, I'll post back on that thread.

Posted by Tommy Knowlton on March 22, 2008 at 06:03 AM PDT #

Hi Jason,

I hope Tommy Knowlton information helps to solve your issue.

Thanks,
Hyau

Posted by Homer Yau on March 28, 2008 at 02:33 PM PDT #

Hi Homer,

Finally I succesfully built this version of GlassFish

Sun Java System Application Server 9.1_01 (build local)

I had to install JDK 1.5 (JDK 1.6 didn't work) and move the sunpkcs11.jar from 1.6.

Is there any way to build the Glassfish 2.1 ?

Thanks for all.

Posted by elfrusci on February 16, 2009 at 05:43 PM PST #

Hi,

Thanks and Congrats for building your own GlassFish Server successfully.
I have not try Glassfish v2.1 on FreeBSD yet.
May I know what version FreeBSD are you using for your local build?
I think most of the steps should be the same and should work, too.

Regards,
Homer

Posted by Homer Yau on February 17, 2009 at 05:33 AM PST #

Hi Homer.

The FreeBSD version.
FreeBSD pajarote 7.1-STABLE FreeBSD 7.1-STABLE #1: Tue Feb 10 15:54:13 CET 2009 root@pajarote:/opt/obj/usr/src/sys/GENERIC i386

I've tried the procedure with v2.1. Done with no problems.
Sun GlassFish Enterprise Server v2.1 (9.1.1) (build local)
glassfish.cvstag=SJSAS91_FCS_BRANCH

BTW, which branches are available ?
I've downloaded the .zip source file (glassfish-v2.1-b60e-src.zip) from the web the tag was SGES21_FCS_BRANCH.
I was unable to build it.

Thanks for your support.

Posted by elfrusci on February 17, 2009 at 04:21 PM PST #

Hi Homer, hi freebees,
having built GlassFish on FreeBSD 7.1 and Diablo JDK 1.5 without problems:

\*\*\*\* Java Virtual Machine [App Server Instance Name: server] Summary \*\*\*\*
Operating System Information:
Name of the Operating System: FreeBSD
Binary Architecture name of the Operating System: i386, Version: 7.1-STABLE
Number of processors available on the Operating System: 1
...
JRE name: Java HotSpot(TM) Client VM Vendor: Sun Microsystems Inc. Version: diablo-1.5.0_07-b01
...
product.name = Sun Java System Application Server 9.1_02

and Derby:

--------- Informationen zu Derby Network Server --------
Version: CSS10020/10.2.2.1 - (538595) Build: 538595 DRDA-Produkt-ID: CSS10020
------------------ Java-Informationen ------------------
Java-Version: 1.5.0
Java-Anbieter: Sun Microsystems Inc.
Java-Home: /usr/local/diablo-jdk1.5.0/jre

Following notes are not relevant anymore and can be ignored: 1,2,3,5

Note 4 : With http://john.vipvip.com/blog/?p=33 I have used the SJSAS91_UR2_BRANCH

Now a FreeBSD Port/Package will be easy :) Should I try ?

Posted by Heiner Strauß on April 01, 2009 at 07:03 PM PDT #

Hi,

Thanks, I am glad you could build Sun Java System Application Server 9.1_02 (Glassfish v2) using Diablo JDK 1.5 on FreeBSD 7.1 without problems.

Anyone who wanted to try building from src should follow the latest comment and keep interesting party up-to-date by keeping commenting this blog.

Cheers and thanks,
Homer Yau

Posted by Homer Yau on April 03, 2009 at 04:02 AM PDT #

Hi,

Where to get the production GlassFish v2.1 (GlassFish AppServer 9.1.1)?

https://glassfish.dev.java.net/downloads/v2.1-b60e.html

Quote this url:

Sources
Some technologies are developed in other projects and only a binary version is available in the GlassFish project source tree. To find more information on where to find sources see this page. You can get the sources in two ways.

1. Check out the source from the CVS repository by following these steps:

% mkdir workspace
% cd workspace
% cvs -d :pserver:userid@cvs.dev.java.net:/cvs checkout -r SJSAS-9_1_1-B60E-23_Dec_2008 glassfish/bootstrap
% maven -Dglassfish.cvstag=SJSAS-9_1_1-B60E-23_Dec_2008 bootstrap checkout build build-jarinstaller

2. Use the b60e source bundle.

Be sure to check that the file size is 50560167MB. If your bundle doesn't match this, it's quite possible that the download was corrrupted so try downloading again.

Follow these steps to build the sources.

% mkdir workspace
% cd workspace
% unzip glassfish-v2.1-b60e-src.zip
% maven -Dglassfish.cvstag=SJSAS-9_1_1-B60E-23_Dec_2008 bootstrap build build-jarinstaller

Hope this information helps.

Regards,
Homer Yau

Posted by Homer Yau on April 20, 2009 at 04:40 PM PDT #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.
~

Posted by links of london jewellery on November 21, 2009 at 12:47 PM PST #

As of 2010-05-08
It seems that there is a problem on dependencies downloading with maven 1.0.1

The following dependencies are not load in to "glassfish_dependencies" folder

mfwk/jars/mfwk-2.0-b24.2.jar
cacao/jars/cacao-2.0-b15.jar
hadbjdbc/jars/hadbjdbc-4.4.3-5.jar
dbstate/jars/dbstate-4.4.3-5.jar

You need to download them manually and put it in glassfish_dependencies before
start the build process

Posted by guest on May 07, 2010 at 09:37 PM PDT #

Hello.
I downloaded Glassfish v3.
I unziped it, and when i try to run

[root@ASMA /usr/glass/glassfishv3/bin]# ./asadmin
Use "exit" to exit and "help" for online help.
asadmin> start-domain domain1
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.

I get this error.
[root@ASMA /usr/glass/glassfishv3/bin]# uname -a
FreeBSD ASMA 7.3-RELEASE-p2 FreeBSD 7.3-RELEASE-p2

[root@ASMA /usr/glass/glassfishv3/bin]# pkg_info | grep jdk
diablo-jdk-1.6.0.07.02_9 Java Development Kit 1.6.0_07.02

And, if i try to add domain i get this

[root@ASMA /usr/glass/glassfishv3/bin]# ./asadmin
Use "exit" to exit and "help" for online help.
asadmin> create-domain --adminport 31330 test
Enter admin user name [Enter to accept default "admin" / no password]>
You do not have permission to use port 31330 for test. Try a different port number or login to a more privileged account.
CLI130 Could not create domain, test
Command create-domain failed.
But i run asadmin from root...
If any can help me, i will be gratefull.

Posted by Crs on August 24, 2010 at 08:53 PM PDT #

I started with the binary build for Mac OS X on FreeBSD with a few name changes to Darwin and got a few errors. After completing this build process (Thanks, by the way to both Homer and Alex) I get the same errors. I get the same error

Posted by Laptop battery on September 16, 2010 at 07:51 PM PDT #

Are you trying Final build 3.0.1 or latest promoted build 3.1?

GA (FCS) - (General availability or General Acceptance or First Customer Shipment)
Final build for GlassFish 3.0.1
https://glassfish.dev.java.net/downloads/3.0.1-final.html

Or are you trying 3.1 ?

Current latest promoted build for GlassFish 3.1
http://dlc.sun.com.edgesuite.net/glassfish/3.1/promoted/latest-glassfish.zip

Make sure you are using JDK 1.6.0_20 or higher

The blog I have is written a while ago, and at that time is only for very early version of GlassFish release.

Build instruction have been change for GlassFish v3, 3.0.1 and 3.1.

I have yet to try it on FreeBSD platform; however, so far Mac version is working of me on my MacBook Pro and Mac Pro.

Posted by Homer Yau on September 17, 2010 at 08:33 AM PDT #

It is amazing at how far they will go! I admire you and thank you for trying to wake people up with all the great information you are putting out there.

Posted by cheap uggs on October 27, 2010 at 03:46 AM PDT #

May I know what version FreeBSD are you using for your local build?
I think most of the steps should be the same and should work, too.

Posted by AC Adapter on March 10, 2011 at 02:17 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Some information, writeup and thoughts about Java, JavaEE JavaSE, GlassFish, Open Source, Exalogic, Xen, xen hypervisor, Cloud, Elastic, OVM , OEL, OVS, Virtualization, Platform as a service (PaaS), Infrastructure as a service (IaaS), Software as a Service (SaaS), Cloud Applications, Cloud computing, and even free software .....

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today