Thursday, March 1, 2012

Working with RAD - Common errors & fixes

I am documenting some of the common issues that we face while setting up your project workspace with an IDE like RSA/RAD. Basically all the Java development IDEs(like JBoss Developer Studio, Weblogic Workshop) are developed with Eclipse as their base. So most the problems and solutions are similar.


Please post your comments on how you liked this posting.


1) Deployment descriptor cannot be loaded :
“The deployment descriptor of the module yourAppplication.war cannot be loaded”

Soln: You would have to refresh the workspace and do a clean build. If that doesnt work, you should remove the WAR entry thats causing problem in the application.xml(deployment descriptor of EAR project) and then try adding the web module back to the EAR. This should solve the issue.




2) While running the server, if you get an error saying some file not found exception or EAR not found error and if you are sure that you dont need any EAR of that name, you can remove the EAR from the WAS profile folder that you are working on.


Eg path: 
C:\IBMSDP70\runtimes\base_v61\profiles\ThisProfile\config\cells\<>\applications


If you still keep getting the errors on server startup , you can ignore them as they wont cause any issue. If you would like to get rid of them anyhow, remove the lines that reference it from the serverindex.xml. The tags to look for is .
This file can be found under
C:\IBMSDP70\runtimes\base_v61\profiles\ThisProfile\config\cells\<>\nodes\<>





3) Class not found exceptions java.lang.ClassNotFoundException
    Could not instantiate class XXX


Soln: 
a)Try to see if you are able to find that class in the workspace using "Open Resource" option(Ctrl+Shift+R). If it is expected to be within a jar, then try finding the class using "Open Resource" option(Ctrl+Shift+T), you will surely find it (if the source code ins SCM is integral/complete). Once you find the class, identify the jar that owns it and try to put it in the buildpath of the project.


b) If the above solution doesnt work, then place those jar files under C:\IBMSDP70\runtimes\base_v61\lib\ext. The path may vary depending on your RAD & app server version. This solution makes the jar files available for all the EARs, all the profiles that would be deployed to the application server(if put inside WAS6 , it will not be available for WAS6.1 version profiles) 




4) If you get any error like ,Error loading deployment.xml for URApplicationEAR: com.ibm.ws.exception.ConfigurationWarning , then chances are that the application, URApplicationEAR is missing in the deployment folder for RAD, but mentioned in serverindex.xml. Remove that entry from that file and re-run the server


File location: C:\IBMSDP70\runtimes\base_v61\profiles\ThisProfile\config\cells\UrPCNameNode01Cell\nodes\UrPCNameNode01


5) Some times you get an error, ERROR IWAE0053E "explaining" that an internal error occured. Sometimes you also get a pointer that an validation error occured with your EAR or WAR. 


---com.ibm.etools.validation.ValidationException: CHKJ3008E: Missing or invalid WAR file.


If you have taken the code fresh from SCM repository (SVN/CVS/VSS etc) and it is a valid code, then the problem just lies in our workspace. To fix this issue, just refresh the projects in your project explorer. If that doesnt work, do a clean & build. 


In one of my projects, the error went away when I manually removed all the WAR and EJB references in the EAR project application.xml and then adding them back. But in another project of mine, I couldnt find the EJB reference after removing it from EAR. So clean build worked here.

Saturday, February 25, 2012

The Jungle is mine!





The jungle is dark
My journey's all alone!
The night is long,
But I ain't gonna groan!

The hyenas are out
With the werewolves along,
They are going on a stroll !
Should be having a ball..
Until I own them all !


With no help near
You can try to strike me with fear.
You can sure see me crouch!
Its just one of my tricks,
Many in my pouch !
With my quick hard clout,
U r never gonna make it count !!!



The night is dark,
But the jungle is mine !
Stay away bitches !!!
U r not looking at a bloody fat swine !


I never needed to tout
Cos when the "Tiger" is out,
There's hardly a bout !!!


P.S: This is my attempt to write something similar to the rap song that comes in Sivaji Mottai boss introduction, sic, "You can neva take me , break me and neva gonna get away ....". Let me know how  you liked it.

Thursday, January 5, 2012

Copying Websphere Environments settings to a new workspace

Time and again, you might be facing a situation where you would have to setup a new workspace in RAD/RSA (or any Eclipse based, IBM's Rational application development tool) and you would find it tiring to set up all the JNDI configurations like datasource, message queues, security etc from the scratch.

If your server settings are going to be similar to the one that you have already created in another workspace or another PC, we have an option to copy(reproduce exactly) the same settings in the new workspace(provided you are using RAD versions 7.x or above). It is technically known as importing WAS profile. The server settings that you want to copy(export) are copied into a archive file called CAR(Configuration archive).

Please post your comments on how you liked this posting.

Importing a server configuration settings to your workspace is ironically called Exporting Server configuration. It uses the same functionality as wsadmin AdminTask importWasprofile.

For experts who are just looking for quick rehash on how to do it, just follow the next 2 points.
1) Import the CAR as a project using general->existing File system
2) Select the server while it is stopped, right click and choose Export server configuration to server and select the project that has the CAR.

For others who are looking for more details, I have presented the extra details from IBM support documentation. If any of the readers face any issues, please drop a comment and I shall try to help you.

The Export process actually incorporates an existing server configuration into an WebSphere Test Environment whereas the Import mechanism actually creates the .car file from an existing server configuration.

You must therefore run the Import wizard first to create a .carfile from a WebSphere Test Environment and thereafter run the Export mechanism to adopt this into the target server, as detailed below.

Steps to adopt existing Server configuration in new WebSphere Test Environment:

1. Select the Import configuration option by right-clicking the applicable WebSphere Test Environment and select Import Server Configuration from Server
2. Name the .car file that will be created with the preferred name within the wizard and save it within the workspace in an existing project.

Result: The creation wizard will then run and Rational Application Developer status bar will show the import progress until the completion of the wizard. On completion the Console view will output any errors with the import process where applicable. On successful completion, the generated .car file will be located in the target project.

3. Import the .carfile into a new workspace directly to an existing project. The .car file should be located within the workspace so the Export wizard can access it.

7. Implement the Export server configuration to Server option pointing at the existing .car
file.

Result: On successful completion of the Export wizard the server configuration from .car
file will then be merged with the existing server configuration of the target WebSphere Test Environment.


Please post your comments on how you liked this posting.



Thursday, December 22, 2011

Design Patterns in java - part 2

Session Facade vs Business Delegate - both do the same function of hiding the implementation details from the caller object. But the main difference is Session Facade must be an EJB object and it will reside on the server side( you can put the transaction limitations on the session facade). On the other hand the Business Delegate can be anything that doesn't involve EJBs and transaction boundaries; eg, a business delegate that accepts input from the web layer(JSF/JSP beans ) and forwards it to Service.

Tuesday, December 6, 2011

Using Data source Explorer in Eclipse

All java developers would mostly be using some IDE based on Eclipse for their day to day coding activities. Nearly 50% of these developer would have to work with backend databases like Oracle or DB2 using tools like Oracle SQL Developer, TOAD(Tool for Oracle App Development), DB Visualizer or Squirrel. If you are into JEE development, you may have to get software installation requests or special admin rights from your company's network administration to install the additional softwares like SQl Developer or DB Visualizer. If you are looking for a shortcut or workaround for this scenario, this posting is for you. Another USP is the comfort to access the database tables directly from your Java IDE(Eclipse/RAD/WASD/JBoss App Dev Studio or any major IDE based on Eclipse).

All the latest releases of IDEs(mentioned previously) come with an option called Data Source Explorer which can be navigated via Window-> Show View -> Data Management -> Data source Explorer. If you are in Jave EE perspective you should be able to see it as a tab next to console or problems tab at the bottom of the Eclipse. You can connect to the database tables by creating a DB connection. You would have to select the appropriate DB and JDBC driver details from the dialog box and then enter the connection string details (authentication and sever IP/port details and service name)

P.S: If you are using Oracle RAC as the backend DB, then instead of selecting Oracle Thin Driver, just select "Other Driver" option and enter the connection string detail

Saturday, October 1, 2011

Connecting Vonage to your home network

Draft post:

The usual logic of connecting the new device to the router or to the modem ports doesnt work for vonage phone lines.
  1. You have to connect just the Vonage modem to the cable modem. 
  2. Connect the wireless router to the vonage modem. 
  3. Connect the phone to the Vonage modem.

Your set up of vonage phone for your home wireless network is done. Throw away those huge manuals from vonage ;)