Showing posts with label Problem. Show all posts
Showing posts with label Problem. Show all posts

Wednesday, May 22, 2013

Jboss Esb - Imported file can not be resolved


I was working on an application that was built in Jboss Esb. I changed my source code and uploaded the jar, which was built using ant files.

As soon as I uploaded the file, Jboss bombed while starting it. It threw the exception mentioned below
The import com.XYZ.adapter.abc cannot be resolved.

I am new to JBOSS Esb. It was an urgent requirement and I needed to fix it ASAP. I did not have any idea to solve the issue in JBOSS ESB. I was cusring JBOSS and developer who thought to use the application. So I had to depend on Mr Reliable Google.

I search on google, and most of the people said that I have not build the jar in the correct manner. Whereas I was sure that I have build it correctly. I researched more. When Google stopped responding to my queries with satisfactory answers, then I started searching the answers at my own, and finally I found the solution for the problem.

I found that my class file did not have corresponding import statement(Which I lost while merging the file with version control tool). But my question was then how I got jar file. So I troubleshooted the ant scripts and found following.

-> My ant script was not deleting old class files. So instead compiling java source file, it was zipping already compiled files.
-> My Eclipse project did not show error, because auto building was disabled.
-> My Eclipse project and Ant Script was building class file at the same location. I.e. Both were building at ${basedir}/bin.

Keep it in mind, whatever technology you are using, it is based on one specific language. Irrespective of technology, the language concepts will always hold true.

The import com.XYZ.adapter.abc cannot be resolved.

Error listed above shows that there are compilation problems with the jar, so rebuild the jar with additional care.

Tuesday, July 31, 2012

Eclipse Starting with a Specific workspace


As I am working for different client at one given point of time, so sometimes it becomes cumbersome to switch the workspaces for different clients. Even sometime it is mandatory to open more than one eclipse and work with them in parallel. So managing them and switching between workspaces not only consumes times but also irritates.

I wanted to tackle this issue by creating different shortcuts for each workspace. Eclipse has easy solution for my problem.

To create shortcut to open eclipse with a particular workspace follow the steps mentioned below.

1. Browse to eclipse installation folder and right click on eclipse.exe.


2. You will see a shortcut at your desktop. Open the shortcut properties menu which pops up a shortcut properties.

3.In the target add the following text -data <YOUR_WORKSPACE_LOCATION>


4.Click on OK.

Now once you click on the shortcut, it would not prompt you to select the workspace and it will open the workspace associated to the location specified.
Now you can create as many as shortcut you want and refrain from switching between the different workspaces.

Thursday, September 22, 2011

Eclipse/ANT Error Specified VM install not found



My company provided me new laptop and happily I moved from my old rusted desktop to new shining, powerful and portable laptop. Everything was copied without problem and I started working. But is not it strange to see everything working perfectly fine? I was stunned but happy as well. 

I started using the installed application. Eclipse was working fine until I tried building (Using ant) my application. Ant showed me a scary popup displaying "Specified VM Not found..." 



Simple solution, there is JDK/JRE problem with the system. Correct the JRE and JDK of the project. I did, but it did not work. I googled and found following 2 solutions.

You might even face this problem when you upgrade ant plug-in.

Solution 1
Remove the file which stores build information about the project and restart the eclipse. You can find the respective file in "${PROJECT_WORKSPACE}/.metadata/.plugins/org.eclipse.debug.core/.launches/${PROJECT_NAME} build.xml.launch"

Solution 2 (Location and Screen Shot may differ for different Eclipse Version. Following screen shot and paths are valid for Eclipse Version 3.7)

Go to RUN->External Tools ->External Tools Configurations… 


It will open console below. Select your build.xml(in my case it is abc build.xml). Move to JRE tab. 



Select the appropriate JRE.



Apply the changes and run the build xml. No need to restart eclipse, and you will not face the problem again.

Bmmm, Solved. Saved time.