The scenario here is that I have an Eclipse Workspace where I am creating an Enterprise Application (EAR) that has a single Web Module (WAR). The EAR project and WAR are created using the standard Eclipse Wizard. A package and class are created to create an annotated POJO that is made a web service by using the @WebService annotation available in Java 1.6.

Looking at the servers already known by Eclipse Juno, we see the following:

This is no good to use as we want to validate/test against a WAS 8 server. Now the current tools don’t know about WAS 8 as they did not exist when the Tools plugin was created, so we want to see if it possible to get a plugin from IBM. Until recently his was not possible unless you used MyEclipse Blue or Rational Application Developer. But IBM has finally started to release these Eclipse plugins for this who choose to develop in Eclipse and not license the IBM RAD product.

I could have used 8.5, but I wanted to try 8 first, later you can try 8.5.

The instructions below show my experience of the process.

http://marketplace.eclipse.org/content/ibm-websphere-application-server-v80-developer-tools#.UJZ-ZYajLng

FYI, Update Site is as follows: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/V8.5

Click Next , Read and Accept the License Agreement

The download process requires a good internet connection for this to work. It took about 1 hour or so even on my high-speed internet connection.

We can also use the Standard Eclipse Software Updater, however does take time to download either way. Link is mentioned earlier if that’s the way you wish to go.

Once the installer download process has completed it will prompt if you are OK to trust an unsigned download. Click OK and the install will occur.

You will need to restart Eclipse for the changes to take effect.

Creating a WebSphere Profile

Now we can create a server definition for WAS 8.

Create a new WAS 8 Base installation to get a WAS 8 Server Profile for use in the wizard.

Here is the command line to create a profile silently using a Windows BAT file.

createAppServer01.bat
echo Creating a standalone Application Server Profile

set WAS_BINARY_DIR=c:\was8nd

set PROFILE_NAME=AppServer01_Prof

set WAS_PROFILE_DIR=c:\was8nd\profiles

set CELL_NAME=Cell01

set HOST=localhost

set NODE_NAME=Cell01AppServer01

set ADMIN_USER=wasadmin

set ADMIN_PASSWORD=wasadmin

@REM This example is creating an insecure WAS 8 Standalone Server Profile

%WAS_BINARY_DIR%\bin\manageprofiles.bat -create -profileName %PROFILE_NAME% -profilePath %WAS_PROFILE_DIR%\%PROFILE_NAME% -templatePath %WAS_BINARY_DIR%\profileTemplates\default -cellName %CELL_NAME% -hostName %HOST% -nodeName %NODE_NAME% -isDefault

@REM This example is creating a secure WAS 8 Standalone Server Profile

@REM %WAS_BINARY_DIR%\bin\manageprofiles.bat -create -profileName %PROFILE_NAME% -profilePath %WAS_PROFILE_DIR%\%PROFILE_NAME% -templatePath %WAS_BINARY_DIR%\profileTemplates\default -cellName %CELL_NAME% -hostName %HOST% -nodeName %NODE_NAME% -isDefault -enableAdminSecurity true -adminUserName %ADMIN_USER% -adminPassword %ADMIN_PASSWORD%

Result of running command
<record>

<date>2012-11-04T04:22:11</date>

<millis>1352046131074</millis>

<sequence>5372</sequence>

<logger>com.ibm.wsspi.profile.WSProfileCLI</logger>

<level>INFO</level>

<class>com.ibm.wsspi.profile.WSProfileCLI</class>

<method>invokeWSProfile</method>

<thread>0</thread>

<message>Returning with return code: INSTCONFSUCCESS</message>

</record>

Creating a Server definition, so we can deploy to WAS

Right-mouse click in the Server view as seen below and create a new Server definition.

I have installed WAS 8 ND from the IBM trial; you can see many blog articles at http://www.themiddlewareshop.com or watch some of my You Tube videos at http://www.youtube.com/user/WebSphereTraining where you can see how to install WAS 8 ND.

The server create wizard will detect the WAS profiles associated with this particular set of WebSphere Application Server Network Deployment binaries.

We can see that I have chosen my stand alone Application Server profile as created with the manageprofiles.bat command earlier on.

Testing with a sample Application.

The Sample I have used to test this configuration is from my WebSphere Application Server 8 New Features for Developers workshop available from http://www.themiddlewareshop.com

Right-mouse click the WAS 8 server and click Start

Once started you will see that the Console tab appears and you will see the output from the application severs SystemOut.log.

If you get the following error then we need to change your project settings as we are using WAS 8, not WAS 8.5.

What we can do is change the Eclipse Workspace for refer to a different installed JRE

The WAS 8 Developer Tool (Plugin) we installed has created a new WAS 8 JRE for us. We had to do this manually in the past.

We also need to set the complier level. Change from 1.7 the default for Eclipse Juno to 1.6 which is what WAS 8 is certified for.

<?xml
version=“1.0”
encoding=“UTF-8”?>

<faceted-project>


<fixed
facet=“jst.web”/>


<fixed
facet=“wst.jsdt.web”/>


<fixed
facet=“java”/>


<installed
facet=“java”
version=“1.7”/>


<installed
facet=“jst.web”
version=“3.0”/>


<installed
facet=“wst.jsdt.web”
version=“1.0”/>

</faceted-project>

<?xml
version=“1.0”
encoding=“UTF-8”?>

<faceted-project>


<fixed
facet=“jst.web”/>


<fixed
facet=“wst.jsdt.web”/>


<fixed
facet=“java”/>


<installed
facet=“java”
version=“1.6”/>


<installed
facet=“jst.web”
version=“3.0”/>


<installed
facet=“wst.jsdt.web”
version=“1.0”/>

</faceted-project>

Everything seems to work fine. It all depends on how you create your project.

Just make sure that when you create your EAR project that you set the runtime to be WebSphere Application Server 8, so the facts are set correctly. If you start your project using the Eclipse JRE runtime then you will get issues like my JDK 1.7 vs 1.6 and also the IBM WebSphere Facets used may get confused and the wgen commands do not run and you may get issues with testing your annotated web-services.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply