Version 19

    HOWTO: Develop and deploy applications created with Sun Java Studio Creator (project Rave)

     

    Basic Setup

     

    Here is what you need to do to use JBoss as your application server when developing and deploying applications built using Sun Java Studio Creator (project Rave):

    1. Stop the Deployment server

      1. View --> Server Navigator

      2. Right-click on "Deployment Server"

      3. Choose Start/Stop Server...

    2. Copy jstl.jar and standard.jar into <jboss_home>/server/<server_name>/deploy/jbossweb-tomcat50.sar

    3. Deploy war file for your project

      1. View --> Project Navigator

      2. Right-click on the project name (root node)

      3. Choose Export WAR File

      4. Export war file to <jboss_home>/server/<server_name>/deploy/<warname>.war (note that you have to specify the name of the war when you do the export)

      5. WAR file will be hot-deployed if JBoss is already running.  Otherwise, start JBoss.

      6. Your application can be run from localhost:8080/<warname>

     

     

    Change JBoss port bindings so that they won't conflict with the Deployment Server bundled with Rave

     

    If you want to run JBoss at the same time as the bundled Deployment Server, do the following steps:

     

    1. Copy the jboss-bindings.xml file attached to this page into the <jboss_home>/server directory.

    2. Edit <jboss_home>/server/<server_name>/conf/jboss-service.xml (where server_name is either "all" or "default")

    3. Find the section of jboss-service.xml called "Service Binding".

    4. Uncomment the section and change the ServerName attribute to "all" or "default":

      <attribute name="ServerName">default</attribute>

       

    5. Change the StoreURL attribute to the location of your jboss-bindings.xml:

      <attribute name="StoreURL">${jboss.server.base.dir}/jboss-bindings.xml</attribute>

       

    6. The web application port will be 8180.  If you need to change it, edit jboss-bindings.xml.

     

    ${jboss.server.base.dir} refers to a Java system property.  Use this just as shown above.

     

     

    You can find more information about the JBoss Service Binding Manger in the JBoss Admin Guide.

     

    Using the bundled PointBase database and the sample data provided with Rave

     

    If you want to use the sample data that comes with Java Studio Creator, you will need to CreateAJDBCDataSource in JBoss that can be bound by your application.

    1. Copy pbclient.jar into <jboss_home>/server/<server_name>/lib.   Note that this is not the same as <jboss_home>/server/lib.

    2. Copy the pointbase-ds.xml file into the <jboss_home>/server/<server_name>/deploy directory.  The sample pointbase-ds.xml file is attached to this page.

    3. Copy the jboss-web.xml file into the <project_home>/src/web/WEB-INF directory.  The sample jboss-web.xml file is attached to this page.

    4. Export WAR file as described above

     

     

    Update for Sun Java Studio Creator 2

     

    • The bundled Pointbase was moved to port 29092 by default. Be sure to update the pointbase-ds.xml accordingly.

    • The newer JBoss application servers contain Apache MyFaces while the Creator .war files contain the JSF reference implementation. That might create problems.

    • I tried it with jboss-4.0.3SP1 and everything seems to be fine. But I had only one Creator application and no other application which wanted to use MyFaces.

    • But I have problems with the JBoss Portal bundle (jboss-portal-2.2.1RC2-bundled). I did not even get a simple Creator web application to run there. It looks like the Portal is using MyFaces and the two implementations stomp on each other. -> More to investigate.

     

    • Update: For Portlets or when you have the JBoss Portal installed in your JBoss server, remove the WEB-INF/lib/jsf-api.jar file from your Creator applications. That .jar file contains the javax.faces. classes and it looks like the same classes come from somewhere else. That causes ClassCastExceptions because the same `Interfaces/Classes' loaded with different class loaders are still not the same.

     

    • After that, I was able to deploy Creator applications and portlets successfully.

     

    -


     

    Update Portlets with JBoss Portal 2.2

     

    • Remove the jsf-api.jar and the portlet.jar out of your war file (WEB-INF/lib).

    • Create a WEB-INF/jboss-app.xml

    <jboss-app>     <app-name>your_app_name</app-name> </jboss-app>

     

    You can choose the your_app_name.

    • Create a WEB-INF/foo-object.xml, find a good example in the jboss-portal-2.2.1 users guide, chapter 4.1.1. The only interesting part is the <component-ref> element near the end. That value has to be your_app_name.your_portlet_name . The your_app_name is the one you have choosen above, the your_portlet_name comes from the <portlet-name> in the WEB-INF/portlet.xml.

     

    • Package everything up and deploy it;-)