6 Replies Latest reply on Dec 21, 2006 5:54 PM by nick.powers

    Sun Creator and JBoss

    nick.powers

      I've been developing a Java Server Faces application with Sun Creator and have had to get over many bumps. I figured I'd share my experiences for all to see, so they may find the answers quicker.

      I created a document that will be updated as I go along. I call it JBoss And Sun Creator Idiosyncrasies and it can be accessed by the following url:
      http://docs.google.com/View?docid=dn97rq7_9c55w6t


      If you have any questions on how I did something, I will try and answer them.
      Keep in mind this is a working document.

        • 1. Re: Sun Creator and JBoss
          genman

          Thanks for the doc.
          Is there some reason you're using Sun Creator? Can you explain the compatibility issues?

          • 2. Re: Sun Creator and JBoss
            nick.powers

            I've been doing Java development for about 2 years in the J2EE and POJO space. I am yet to get into web development, until now. I found Sun Creator and wanted to try it out. It seemed like the best solution to create JSF applications.

            Do you know of a better IDE?

            • 3. Re: Sun Creator and JBoss
              thejavafreak

               

              "nick.powers@att.com" wrote:
              Do you know of a better IDE?

              Have you tried:
              1. Netbeans 5.5
              2. Eclipse with myEclipse plugin

              • 4. Re: Sun Creator and JBoss
                nick.powers

                I downloaded and installed NetBeans and I like it very much. It seems to have all the same functionality, but with some of the same fuss. I am still having the same issues with the JSF jars not being compatible with JBoss 4.0.5-GA. Following the same instructions, regarding the JSF Jars, I am able to get it to work.

                I'll mess with it more and perhaps add or change the guide.

                • 5. Re: Sun Creator and JBoss
                  thejavafreak

                   

                  I am still having the same issues with the JSF jars not being compatible with JBoss 4.0.5-GA.


                  JBoss 4.0.5 uses myfaces library while Netbeans 5.5 uses JSF RI library. You will find problems with compatibility of the library unless you set up your own development environment under Netbeans, e.g using Ant. Then you create new project with Netbeans with the Ant's build.xml file you have set up.

                  • 6. Re: Sun Creator and JBoss
                    nick.powers

                    Instead of trying to keep this document available, I'll just post what I have here. Also, at the advice of the nice people on the forum, I have switched to using NetBeans 5.5 and it integrates with JBoss very nicely.

                    JBoss And Sun Creator Idiosyncrasies
                    by Nick Powers

                    Reference
                    * JBoss Appliction Server - version 4.0.5.GA in the default configuration.
                    - I installed it using the JEMS installer.
                    * MySQL - version 4.1.22
                    * JConnection - version 3.0.17

                    Purpose
                    This document will list all of the funny configurations I have to do to setup the JBoss server.

                    Deploy a JSF project via Sun Creator
                    JBoss has components called JBossFaces that work like JFaces, but are not compatible with Sun Creator's version. There is an article that references these problems. The old way to replace the files and an Alternative Tomahawk option and Replacement option. I only got the Table and action components to work if I replaced the JSF jars with Sun's as described below.

                    * Delete the jsf-libs directory under the following:

                    <jboss_home>\server\default\deploy\jbossweb-tomcat55.sar

                    * Add jstl.jar and standard.jar into following directory:
                    <jboss_home>\server\default\deploy\jbossweb-tomcat55.sar

                    * Leave the sun JSF jars in the web/lib directory.
                    * Create a jboss-web.xml that has the following lines:
                    <jboss-web>
                     <resource-ref>
                     <res-ref-name>jdbc/MySQLDS</res-ref-name>
                     <jndi-name>java:/jdbc/MySQLDS</jndi-name>
                     </resource-ref>
                    </jboss-web>
                    

                    - This defines the data source. Place it into the web\WEB-INF directory of the Creator project

                    * Enter the following lines to the web.xml of the Creator project:
                    <listener><listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class></listener>
                    

                    - You can not put this into the web.xml file in your Sun Creator project. It will not deploy.
                    - This will be placed in the WEB-INF directory.
                    * Remove the log4j jar from the WEB-INF/lib directory as it causes problems with the one defined in the JBoss Server.

                    Make jmx-console Work Again

                    * insert the following into the
                    <jboss_home>\server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF\jboss-web.xml

                    file:
                    <jboss-web>
                     <!-- Uncomment the security-domain to enable security. You will
                     need to edit the htmladaptor login configuration to setup the
                     login modules used to authentication users.
                     -->
                     <security-domain>java:/jaas/jmx-console</security-domain>
                     <depends>jboss.admin:service=PluginManager</depends>
                    </jboss-web>