The Source for Java Technology Collaboration
User: Password:



Dru Devore's Blog

Community: Java Enterprise Archives


Web Service Creation error with Glassfish 2

Posted by ddevore on February 28, 2008 at 05:40 PM | Permalink | Comments (1)

Lately I have been working with EJB 3.0, and I love it. For quick tests and to see what is being returned I threw web services around them. The services ended up being a really nice and easy test though it pointed out a bug in Glassfish 2. The bug has beenentered as an issue in Glassfish here if you are interested. Basically the problem is that if you have two services with operations that have the same name the WSDL generation becomes confused and creates the WSDL definition for one of the operations and uses it for both of the services. This leads to a problem that one of the operations will always throw an exception. If this isn't bad enough the duplicated operation is not always the same one, this took a while to track down why my service was erroring because sometimes it would throw an exception and sometimes it wouldn't.

Anyway I posted the problem to the Glassfish mail group and Bhakti Mehta replied and confirmed the bug and submitted it as an issue for me. He also found a workaround for me. So if you are having a problem simply add the following two annotations to the operations that are having the problem.

@RequestWrapper(className="servicetwoRequest")@ResponseWrapper(className="servicetwoResponse")

Thanks Bhakti for the help.



JBoss - The Basics

Posted by ddevore on April 20, 2006 at 01:52 PM | Permalink | Comments (0)

This is not for the experienced JBoss application server user. It is meant to give the JBoss beginner the basics to running and deploying applications to JBoss 4.0.3 SP1. There is also information on how to improve efficiency when working with NetBeans and Creator.

JBoss Layout

JBoss is easy to understand if you know the way the directories are setup and how to work with them. First everything you will do to JBoss is in the install directory.

bin directory

The most important one here is the run.bat or run.sh. This will run the application server and display debug and information messages to the user in the session it is started in. To start JBoss simply use the run command from this directory. To stop the server do a CTRL-C in the session it was started in. There are also some other files there but this is the basics only so I will not discuss them.

lib directory

This is the "root" server lib directory. You don't usually have to nor want to do anything with these libs.

server directory

This is where the directories for the server instances are. This is where you will do most of your work.

default directory

The default directory is the directory for the default instance. This is the instance which is started if you do not specify an instance. If you are in need of multiple instances then you will need to duplicate this directory. So if you think that you will need more instances do yourself a favor and make a backup of this directory before doing anything else.

I will go through this directory and tell you a little about it and give you a little information which may come in handy in the future.

conf

This is where all the configuration files for the paticular instance reside. These are more or less needed but you don't need to do much with them to work with the server. The only one I have changed in this directory is the log4j.xml because I wanted to add some different appenders to keep more concise logs.

data

This directory I have never done anything in and never even navigated to tell I decided to write this. The only think I could see of any interest is the wsdl directory which will hold a sub directory for each archive which holds a web service which holds the wsdl and wsdd files for each service.

deploy

This is the most important directory. It contains all the deployed applications archive files and the jbossweb-tomcat55.sar directory, if you ready my other blogs you will see references to the jbossweb-tomcat55.sar directory. The most important thing in the jbossweb-tomcat55.sar directory is the server.xml. This is the file which will need to be modified if you are going to have multiple instances running. If you do run multiple instances make sure you change the listening ports in the server.xml, refeer to the JBoss site for information on changing ports. To run a server with a different name use this command run -c instance_name. The next important directory is lib. It is where the archive files need to be put for the instance to find them. For instance if you are going to be using databases the database lib goes here. The log directory is next, it is where the logs for the instance get put. The temp and work are where the applications get expanded to and run from.

others

There are other directories but these are all you really need to worry about when getting started.

JBoss Deployment

Under my normal development I use NetBeans and Creator with JBoss. I don't normally use the deploy ability of NetBeans, Creator does not currently support JBoss, because of the ease of doing a manual deployment. I have found that if I open a command prompt and run the copy command it is faster to deploy than through NetBeans. Since JBoss hot deploys new applications it works very will for me. I simply build the project and then use a script to deploy it from a command prompt. If you are going to use this method do not have the command prompt open in the dist directory because it will lock the directory and cause a Clean and Build to fail.

If you have any questions or need any more information please see JBoss.org or add a comment.



Databases with JBoss

Posted by ddevore on April 20, 2006 at 07:48 AM | Permalink | Comments (1)

This is not a difficult topic but one which I needed to include to have a more complete JBoss enterprise setup.

Needed Information

JNDI Name
Connection URL
    Server Name
    Port
    Database Name
Driver Class
User Name
Password

The ???-ds.xml file

JBoss provides all kinds of ???-ds.xml files ready to be customized in the JBOSS_INSTALL/docs/examples/jca directory. There is one for just about every database you would ever need. For the most part they use the information mentioned above with some of them needing a little more. JBoss did a good job with giving descriptive names where the XML does not explicitly state what it is looking for. They all have the standard start of the Connection URL also such as jdbc:oracle:thin:@ for Oracle and jdbc:mysql:// for MySQL as well as the default port. So if you don't change the default port on the database all you need to do is change the Server Name, Database Name, Driver Class, User Name, and Password and in most cases the Driver Class will not need to be changed either. Once this information is correct put the ???-ds.xml file in the deploy directory for the server you need the Database connection on.

The Library

You will need to add the jar for the Database you are using in the lib directory for the server you need the Database connection on. This is in the
JBOSSS_INSTALL/server/SERVER_INSTANCE/lib directory.

Happy Connections

You should now have a connection to the Database you need.

DataSources with Sun Java System Creator and JBoss

Posted by ddevore on April 19, 2006 at 02:15 PM | Permalink | Comments (0)

We are currently using Creator to create a testing and QA front end for the enterprise application we are developing. After success with working with services we finally needed to hit a configuration database to show all the configuration options available to different applications and users.

The Data Source

We started by putting 2 simple drop down on the screen and tried to attach a data source to them. Since we are using MySQL for this configuration database we had to add the data source, which is very simple. Select the Servers tab and right click on the Data Sources and you will see an Edit... button to the right of the drop down for the Server Type select this and in the dialogue which comes up select New on the bottom left. Then simply browse to the jar file for the data source you are adding, for us it is mysql-connector-java-3.1.12-bin.jar, and select Open. Give it a name and for MySQL put in com.mysql.jdbc.Driver for the Driver Class Name, if you select suggest it will suggest an older driver named org.gjt.mm.mysql.Driver. In the URL Template put in the following jdbc:mysql://#HOSTNAME:3306/#DATABASE changing the 3306 to the appropriate port and select close. Give the data source a name and fill in the fields with the proper information and select Add.

The JBoss XML

For JBoss to work correctly with your datasources from Creator you need to tell JBoss the references for the data sources. To do this you need a jboss-web.xml file in the creator_project/web/WEB-INF directory. Create this file, or download below, and put it in the creator_project/web/WEB-INF directory.


<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
  <resource-ref>
    <res-ref-name>jdbc/myDataSource</res-ref-name>
    <jndi-name>java:/myDataSource</jndi-name>
  </resource-ref>
</jboss-web>

Make sure to change the myDataSource name to the actual jndi name in your JBoss configuration. Don't forget the "/" in the front of the datasource without this it will not work correctly.

The Binding

Once this is done you are ready to bind the data to the drop down. Simply put a drop down on your page and right click in and select Bind to Data.. Select Add Data Provider and select the proper table from your data source. Make sure that it selected the correct value and display fields and select OK.

Clean and Build

If you have not gotten any errors up to this point you should be able to clean and build the project and deploy to your JBoss directory. If you get errors under deploying make sure you set the data source correctly in JBoss Databases with JBoss and setup JBoss to work with creator How to setup JBoss to work with Sun Java Studio Creator

Happy Creating

Download jboss-web.xml file



EJB Creation and Consumption with NetBeans and JBoss

Posted by ddevore on January 10, 2006 at 08:02 AM | Permalink | Comments (2)

At the time of writing this guide NetBeans IDE was in version 5.0 Beta. This guide was written using the latest development build #200601052030 to take advantage of the bug fixes since NetBeans IDE 5.0 went into beta. Also, NetBeans officially supports JBoss Application Server 4.0.3 so this guide will walk through the JBoss Application Server 4.0.3sp1 setup. If you are using a previous version of JBoss I suggest switching to 4.0.3sp1 because of some support changes in JBoss for Web Services which will be discussed when I get to Web Services. If you have not setup NetBeans to work with JBoss please see NetBeans with JBoss Setup.

Creating Projects
Now that you have NetBeans setup with JBoss you can create a project to create and consume EJBs. The EJB Module is the only project which NetBeans will allow you to create EJBs. There is an Enterprise Application project which by default creates an EJB Module and Web Module, used for Web Services and pages, as sub projects. Since most project now days will not have only EJBs this guide will use the Enterprise Application project as the main project, though you can use the same methods for a project without the use of the Enterprise Application project.

Creating a Enterprise Application Project
To create an Enterprise Application either right click in the project view and select New Project or from the main menu select File | New Project. Both will bring up the New Project dialog. In this dialog select the Enterprise node and Enterprise Application from the list of projects on the right and select Next. In the next screen enter the project name, location and server. Because of the incomplete implementation of JAX-RPC in JBoss NetBeans will not create a web service with the JBoss server as the target. So to create an Enterprise Application project which will have Web Services the target server of the Web Module of the Enterprise Application must be the Sun Java System Application Server this can be changed later. If you choose the JBoss server at this stage the target server will have to be changed in the Web Module to create Web Services. You also have the opportunity to change the name of the EJB Module and Web Module which will be created with this project. For this guide I am leaving the default names for these modules and naming the project NBJBossApplication. Once this is done click Finish. This will create the project and open them up in the projects tab see Figure 1 below.

projectview1.jpg
Figure 1

You can see in Figure 1 above that NetBeans created not only the NBJBossApplication project but the NBJBossApplication-EJBModule and NBJBossApplication-WebModule as well. The directory structure of the NBJBossApplication project with the sub projects can be seen in Figure 2 below.

fileview1.jpg
Figure 2

As you can see by simply looking at the file layout in Figure 2 Enterprise Application projects are a very good way of organizing large applications which is why I am using them in this guide. A complete discussion of the Enterprise Application project is outside the scope of this guide and will not be discussed here.

Creating a EJB Module
You create an EJB Module the same way as the Enterprise Application. Right click in the project view and select New Project or from the main menu select File | New Project. Both will open the New Project dialog. In this dialog select the Enterprise node on the left and then the EJB Module on the right and click Next. Enter the project name, location and server. This also allows you to add this module to an Enterprise Application project if you wish. This can be very useful if you are making an enterprise project with all components contained in the same parent project. If you are adding this project to an Enterprise Application you do not need to put it in the Enterprise Application directory though it may prove easier to put it in the same directory for organization.

Working with EJBs and JBoss
Working with EJBs in NetBeans for JBoss is not really any different from working with any other server. You create and consume them the same way as any other targeted server. When I am developing both EJBs and Web Services I usually use the Sun Java System Application Server as the target and deploy the project manually, mostly because NetBeans will not compile a Web Service correctly with the JBoss server as the target.

Creating EJBs
To create an EJB you can use either the New | File/Folder from the main menu or use the context menu for the EJB Module by right clicking on the EJB Module. You can also select the specific bean type from the EJB Module, if it is in the list under the New option. If you selected the New File option you will get the New File dialog, select the Enterprise node on the left and the bean type on the right. This guide will walk through the creation of a Session Bean, though we will not be creating other beans they are created in the same manner though the information in the wizards is slightly different.

Session Beans
In the New Session Bean dialog enter the EJB name and the package name. You can also select the source location if you have multiple source locations setup in the project. Mark the correct session type and the interface types to create. If you are not going to be calling this bean from a remote server you only need to select the local interface, though I usually select both remote and local interfaces for flexibility just in case. For the guide I created a stateless EJB with the name NBJBossSession in the package com.nbjboss.ejb.session with both remote and local interfaces. This gives the following structure in the Projects view see Figure 3.

sessionejb1.jpg
Figure 3

As you can see this creates all the files needed for a remote interface as well as a local interface. You will also notice a NBJBossSessionSB node under the Enterprise Beans node with Remote Methods and Local Methods nodes. These nodes allow you to create new business methods for both the remote and local interfaces. That is all there is to creating an EJB.

Working with EJBs
Once you have an EJB created expand the Enterprise Beans node for the module you created the bean in. You will see the bean you created if you then expand the node you will see the interfaces you created for the bean. You can add a business method to the bean by right clicking on the bean and select Add | Business Method. This will bring up a dialog for adding the method information. Enter the method name, return type, which interface to add it to, and any parameters and exceptions for the method. For this example I used the simple sayHello business method with a String return type and String parameter named name. As you can see in Figure 4 it added the business method to the remote and local interfaces for me.

sessionejb2.jpg
Figure 4

You can access the business method by double clicking on the method name in either the remote or local interfaces and entering the logic, both of these nodes take you to the same file. The following is the code I added to the method for the sayHello logic.

    public String sayHello(java.lang.String name) {
        return "Hello " + name;
    }

Code 1

As you can see I simply returned the input name concatenated onto Hello.

Deploying and Testing
Once you have the logic you need in the EJB build the project to check for any errors, deploying will automatically build the module also. If you have JBoss setup as the target server you can right click on the module and select deploy to deploy it directly to JBoss.

Deploying
Before you deploy the first time you want to check the target server to insure the correct server is selected. If you followed the setup guide for NetBeans with JBoss the target server will likely be the Sun Java System Application Server and will need to be changed. To do this you need to right click on the EJB Module and select properties. Then select the Run node and make sure the server dropdown is set to the correct JBoss server see Figure 5.

targetserver.jpg
Figure 5

Once this is done you need to right click on the EJB Module and select Deploy Project. The server will be started and the project will be deployed. If the server is running outside of NetBeans you will get a deployment error so make sure you do not have a server running outside of NetBeans. If all goes well you can go to the server and get the default JBoss screen. If you are running locally use localhost:portfor the address. The Output tab on the bottom of NetBeans will also allow you to start, start in debug, restart, stop and refresh on the server at the appropriate times by using the icons on the left of the output tab for the target server.

Testing
For testing the EJB you will need to have something to call it. I will do it from a web page within a web application which will be a part of the NBJBossApplication project used as the parent to the NBJBossApplication-EJBModule. So create a Web Application by selecting New Project and selecting the Web node on the left of the dialog and Web Application on the right and select Next. Then enter the name NBJBossTestWebApplication, set the location to the NBJBossApplication directory and add it to the NBJBossApplication project and select Finish see Figure 6.

testwebapp.jpg
Figure 6

You will then have the default web application module created and opened as a project and need to make a call to the EJB. There are 2 ways NetBeans will write the code to cal the EJB for you. The first is through a Service Locator pattern from the J2EE design patterns. The second is to create a class to call the service from, right click in the class and select Enterprise Resource | Call Enterprise Bean. In the dialog select the NBJBossSessionBean, select remote or local interface and click OK. This will create the required code to do a lookup on the bean you selected. To call this from a JSP you will have to either add a wrapper method or change the method to public. The second method is only available to the EJB module project or a project within the same Enterprise Project. For this guide we will look at the first method though I included the JSP code for the second method below. Both methods use the remote interface to access the EJB.
Create a Service Locator by right clicking on the NBJBossTestApplication node and selecting New | File/Folder. On the right side select Enterprise and Service Locator from the list on the right. Name the Service Locator ServiceLocator and make the package com.nbjboss.util and click Finish see Figure 7.

servicelocator.jpg
Figure 7

Next you need to enter the code into the JSP. To do this Expand the project and the Web Pages node. You will see an index.jsp page there, open this and enter the following code just above the </body> tag. You may want to change the parameter from Dru unless your name is Dru also.

    <h4>Calling NBJBossSessionBean sayHello()</h4>
    <%
        com.nbjboss.util.ServiceLocator sl =
            new com.nbjboss.util.ServiceLocator();
        com.nbjboss.ejb.session.NBJBossSessionRemote bean =
                ((com.nbjboss.ejb.session.NBJBossSessionRemoteHome)
                sl.getRemoteHome("java:comp/env/ejb/NBJBossSessionBean",
                com.nbjboss.ejb.session.NBJBossSessionRemoteHome.class)).create();
        out.println(bean.sayHello("Dru"));
    %>

Code 2

Before you build the project you will need to add the EJB Module to the Libraries. To do this right click on the project and select Properties and select the Libraries node and click Add Project on the right. Browse to the EJB project and select Add Project JAR Files. If you are going to deploy this and the EJB Module to the same server you will need to uncheck the package button.

For the second method add the following code to the JSP and create a class as mentioned above.

    <h4>Calling NBJBossSessionBean sayHello()</h4>
    <%
        com.nbjboss.util.ServiceLookup sl =
            new com.nbjboss.util.ServiceLookup();
        com.nbjboss.ejb.session.NBJBossSessionRemote bean =
                sl.lookupNBJBossSessionBean();
        out.println(bean.sayHello("Dru"));
    %>

Code 3

Now we have the bean being called we need to get it deployed but we need to set the libs correctly. To do this right click on the project and select Properties in the properties dialog select the libraries node and uncheck the checkbox next to the NBJBossApplication-EJBModule. This will tell NetBeans not to include the EJB Module with the war file created for the test application if it is included you will get a class cast exception. Now if the EJB Module is still deployed simply deploy the NBJBossTestApplication. If not then deploy the NBJBossApplication-EJBModule first then deploy the Test Application. Another option is to deploy them both with the NBJBossApplication parent project. This is possible if the EJB Module and the Test Application are both included in the Enterprise Application project. To check to see if they are right click on the NBJBossApplication and select Properties then select the Packaging node under the Build node. This will list all the projects which are part of the parent project. Now point your browser to the server for the Test Application. If you have followed this guide and the server is local with port number 8080 then the address will be http://localhost:8080/NBJBossTestWebApplication/ make sure the port is correct for your installation.

Conclusion
NetBeans has setup the easiest way of working with EJBs of any IDE that I have seen and with the built in support for the servers it towers above any other IDE. Once you start working with EJBs in NetBeans you will see that the development is easy and consuming them is even easier. With the work that NetBeans has done with writing the code and XML for you it allows you the time to do the real work.
You can download the source for this project here.

NOTE: If you deployed the individual modules through NetBeans and attempt to deploy the Enterprise Project you will get an error. This is due to JBoss wanting to deploy the individual modules with the Enterprise Project which will cause duplicate deployments. To fix this go to the deploy directory of the server you are using and delete the module files before deploying the Enterprise Project. Also, please note that this will work if you are deploying to Sun Java System Application Server. All you need to do is to change the target to the Sun Java System Application Server and deploy.

NetBeans with JBoss Setup

Posted by ddevore on January 06, 2006 at 10:59 AM | Permalink | Comments (2)

This guide describes the setup necessary to setup NetBeans IDE 5.0 work with JBoss in preparation for developing EJBs and Web Services targeting the JBoss runtime. Once you have completed the instructions in this setup guide you will be able to create and consume EJBs and Web Services with the JBoss application server through NetBeans IDE 5.0. This will also allow you to do it all without doing any manual deployments to the JBoss application server. For more information on creating and consuming EJBs and Web Services for the JBoss server through NetBeans IDE 5.0, please see the other guides for NetBeans IDE 5.0 and JBoss.

At the time of writing this guide NetBeans IDE was in version 5.0 Beta. This guide was written using the latest development build #200601052030 to take advantage of the bug fixes since NetBeans IDE 5.0 went into beta. Also, NetBeans officially supports JBoss Application Server 4.0.3, but due to business requirements I have to use JBoss Application Server 4.0.1. So, this guide will walk through the JBoss Application Server 4.0.1 setup as well as the JBoss 4.0.3 setup.

Download Required Files
First you need to download the files needed for setup. You will need JDK 5.0, NetBeans IDE 5.0 (latest build), JBoss Application Server 4.0.3, and Sun Java System Application Server Platform Edition 8.1.

JDK 5.0
The latest JDK 5.0 can be downloaded from here http://java.sun.com/j2se/1.5.0/download.jsp. Download the latest update of the JDK. NOTE: Until NetBeans IDE 5.0 reaches final release, do not download the NetBeans IDE / JDK bundle from this page because the version of NetBeans IDE on this page is currently the final release version of NetBeans IDE 4.1. This document covers JBoss setup with NetBeans IDE 5.0 Beta version.

NetBeans IDE Version 5.0
The NetBeans 5.0 version IDE can be downloaded from the NetBeans web site at http://www.netbeans.info/downloads/download.php?a=n&p=1. You will need the latest daily build or release, which ever is newer for, version 5.0 or the 5.0 version once it has reached final release. Select the NetBeans IDE installer from the list.

JBoss Application Server 4.0.3sp1
The JBoss application server can be downloaded from SourceForge at http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=16942. Please select version JBoss version 4.0.3sp1. This guide may work with earlier versions of JBoss, but they have not been tested.

Sun Java System Application Server 8.1 Platform Edition
The Sun Java System Application Server 8.1 Platform Edition is needed to create services correctly since JBoss currently does not fully support JAX-RPC. This can be downloaded at http://java.sun.com/j2ee/1.4/download.html#sdk. Select the separate bundles Sun Java System Application Server Platform Edition 8.1 2005Q2 UR2.

Installation
Although the order of installation could be done alternatively, the suggested and easiest installation is too; install the JDK first then install the NetBeans IDE 5.0. Then, proceed to install the JBoss Application Server and Sun Java System Application Server. Make note of the admin name and password you enter when you install the Sun Java System Application Server. You will need the admin name and password when you register the application server in the NetBeans IDE a little later in this guide. If you are using the JBoss installer make sure you choose the all option A full J2EE server profile with enterprise extensions. Then select the options needed for your installation. For this guide the default options were selected.
NOTE: The JBoss installer is an executable jar file to run this file use
java jar jar_file_name

Setting Up Your Environment Setting up the environment is only needed if you plan to build the project outside the NetBeans environment. The environment setup shown here is geared toward the Windows platform. If you are using another operating system please make changes as appropriate. Also, the settings can all be set in the system properties. For setting the variables in the system properties go to the Control Panel and open the System dialog then go to the advanced tab and select Environment Variables. Here you can add the variables in the user or system variables.
To do this, set the environment variable ANT_HOME to the directory where you have Ant installed. If you have not installed Ant, then set ANT_HOME to <NETBEANS_INSTALL_DIR>\ide6\ant. Then add ANT_HOME\bin to your PATH environment variable. For my installation I have NetBeans installed in C:\Program Files\netbeans-5.0dev so for me the correct setting would be.

set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_05

set ANT_HOME= C:\Program Files\netbeans-5.0dev\ide6\ant set PATH=%PATH%;ANT_HOME\bin

If you have ant installed and would like to use it instead of the version provided by NetBeans change the ANT_HOME above appropriately.

NetBeans Setup
Once you have NetBeans started, go to the Runtime tab at the top of the navigation pane and expand the Servers node you will notice the only server listed is a bundled Tomcat server. Right click on the Servers node and select Add Server. This will by default select the Sun Java System Application Server as the server. Since that is one that we want to add click Next. Enter the location for the installation for the server in the next screen and click Next. Enter the proper information in the next screen for the admin name and password and click Finish. The admin name and password to enter here are the admin name and password you entered during the installation of the Sun Java System Application Server.

JBoss Server Setup
The JBoss setup about the same as the Sun Server setup, but because of the different server versions there are some things that must be considered when registering a JBoss Application Server with the NetBeans IDE. In the NetBeans IDE, first right click on the Server node in the runtime tab and select Add Server. Select JBoss Application Server 4.0.3 and click Next, since this is the only JBoss setup available you must select it no matter what version of JBoss you are using; again this has been tested with JBoss 4.0.3sp1 only. Enter the installation directory for the JBoss server such as c:\jboss-4.0.3sp1 and click Next. Select the domain; it defaults to 'default'. If you are using JBoss 4.0.3 the port number is read from the configuration file and put in the port field automatically and cannot be changed in the dialog. If you are using a JBoss installation previous to JBoss 4.0.3sp1 the configuration is not read in and will only work with the default settings. If you wish to change the port numbers for JBoss 4.0.3sp1, look in:

<JBOSS_INSTALLATION_DIR>\server\default\deploy\jbossweb-tomcat55.sar\server.xml

On line 12 you will see the definition for the JBoss port number,

Change the Connector Port to your desired port number. I suggest you change this port number or the Sun Java System Application Server port number because of conflicts with the listening port. By default, both JBoss and Sun Java System Application Server listen to port number 8080. If you are using a previous version of JBoss you cannot change the default port number if you are going to deploy directly from NetBeans. If you do not change the JBoss Application Server or Sun Application Server port number please be careful when deploying the applications since you may experience some unexpected behavior such as deployments not being successful. You need to be sure you do not have both application servers running at the same time if the ports are not changed on either server.
To save yourself some potential deployment issues with using JBoss version 4.0.3, it is easiest to change the JBoss port number via the JBoss server.xml file as described above.

Server Setup
About a month ago there were some changes which made changes to the server unnecessary. So what this means is that JBoss 4.0.3sp1 works out of the box. After the server is setup in NetBeans you can deploy and test with the JBoss 4.0.3sp1 server. Keep in mind though that JBoss 4.0.3sp1 does not support documentliteral correctly for web services so if you are developing web services please insure that you set them to rpcliteral.

Conclusion
This is all there is to the setup for working with NetBeans and JBoss. Once this is done you can create and consume EJBs and Web Services with the JBoss application server through NetBeans IDE 5.0. This will also allow you to do it all without doing any manual deployments to the JBoss application server. For more information on creating and consuming EJBs and Web Services for the JBoss server through NetBeans IDE 5.0, please see upcoming blogs for NetBeans IDE 5.0 and JBoss.

Next
EJB Creation and Consumption with NetBeans and JBoss



Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds