Deployed java program runs into error after being copied to a different machine

I have this program I’ve been asked to manage. It’s a Java + Apache Camel program which is running via a windows service. The program sends and receives XML messages and saves them to SQL server. For the most part I have some Java experience but I’m still new and I don’t know too much about camel (other then that it looks to be the Interface between the Java core and any sort of network traffic)

It currently runs fine on its own deployed on a specific machine, but I want to run it on a different windows machine to play around with. So I copied over the entire root folder that contains all the jar files/configuration files etc, edited the configuration (so all pathnames are correct for the new location, and points to a different SQL database), and I created the new windows service (using prunsrv and prunmgr) and edited the service to have similar parameters to the existing windows service.

It all looks like I am 99% done, but when I run the service, the program generates some error, where there was an error creating a bean for some class and at the bottom mentioning a Java lang class not found exception for org.apache.camel.component.sql.swlcomponent

I don’t quite see what the issue is if I copied everything over. I went one step ahead and copied over all the Java and apache maven folders from the original machine to the new one and set up the environment variables to pick up from these folders instead but the issue still remains

If I build a jar file from the original codebase, then surely it should hold this sqlcomponent class in it already?

Any advice would be appreciated

My suspicion is there may be something I need to change during the build, and then copy over this new jar into the deploy location

My other approach is that given I know this has successfully been deployed on two different machines (one for testing and one as a QA copy), I’m also considering praying through every file to see the difference between both machines (perhaps there is some parameter relating to the machine itself). While I know how to build the project’s jar file from the core base, i don’t actually know much about how to deploy this program as a windows service on a new machine (the original person who manages it has long left), despite that I’m feeling optimistic
Dilen PatAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
but when I run the service, the program generates some error,
http://technojeeves.com/index.php/aliasjava1/17-errors
Please post it
0
CEHJCommented:
I don't get it - why would you post that as an image, externally and not here, as text in code tags?

Anyway, the problem is you don't have all the Camel jars in the classpath
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Dilen PatAuthor Commented:
Using the app on my phone rather than my laptop sorry.
All the jars are in the libs folder in the root directory of the deployed program (the windows service picks up from the libs folder). On the machine where the program works, all the jars are there. These jars were then copied over (along with the entire root folder + subfolders) to a new machine, so at least in this location there shouldn't be missing jars. Does this mean there are jars being referenced that are outside the folder? I looked at the specific SQL related jars and I can see them in the folder

Part 1: https://scontent.fsin1-1.fna.fbcdn.net/v/t35.18174-12/s2048x2048/30768865_10212009715411472_369957849_o.jpg?_nc_cat=0&oh=41dd3d0f0865f2d14fffa7fce89fe1de&oe=5ADED598

Part 2: https://scontent.fsin1-1.fna.fbcdn.net/v/t35.18174-12/s2048x2048/30771815_10212009715371471_1310983688_o.jpg?_nc_cat=0&oh=ff3163df06f23d17791f043a6c095bd5&oe=5ADE7FD6
0
Dilen PatAuthor Commented:
I can even see the two SQL related jars referenced by the pom (camel-sql-2.14.0.jar and sqljdbc4-4.0.2206.100.jar)
0
Dilen PatAuthor Commented:
If I were to open up command line on both machines and enter: "SET | FindStr CLASSPATH" I would see the same result
0
CEHJCommented:
I can only tell you the 'raw facts' without delving into specific details to which i have no access
0
Dilen PatAuthor Commented:
Ah thank you, I think I found the issue when you mentioned camel jars (made me think of the second SQL jar). I ran the prunmgr //ES// command for my service and I can see both SQL jars referenced on the good machine, but I only see one in the bad one. Even when I copied the arguments (which has all 169 filenames) again between both machines, the bad machine still sees only one. It looks like prunmgr has some sort of character limitation on the had machine
0
CEHJCommented:
With any luck, you don't mean 169 jars ;)
0
Dilen PatAuthor Commented:
Oh definitely. So on prunmgr //ES// when specifying the java class path, currently all 169 jars are specified (semi colon delimited e.g "D:/OmProgram/lib/test.jar;D:/OmProgram/lib/test2.jar....."). I think the combination of having 169 full paths to specify, as well as the fact that the path on the new machine is a little longer, means that the entire character length is much longer now, and is possibly something that prunmgr cannot handle. Is it a red flag to have so many jars being referenced?  At the moment, I'm testing out using a shorter service name and shorter foldername (shorter than what is originally being used) and checking if that works
0
Dilen PatAuthor Commented:
So I shortened the foldername I used and shortened the service name just in case and it worked! Thank you for your help
0
CEHJCommented:
Well it's not brilliant to have too long a path. I'm not sure if there are any limits as such or what they are. But with that (and also for reasons of portability) I would probably do

set LIB=D:\OmProgram\lib
..
%LIB%\test.jar;%LIB%\test2.jar

Open in new window

etc
1
CEHJCommented:
So I shortened the foldername
See above (not portable)
0
Dilen PatAuthor Commented:
Class path is a one line text field, whereas your script is multi line. I tried using semi colon as end of line and as a delimiter but it didn't work sadly
0
Dilen PatAuthor Commented:
Even setting LIB as a local environment variable and just referencing it in the java class path (in prunmgr but) doesn't seem to work sadly
0
Dilen PatAuthor Commented:
My mistake, setting environment variable does work! Thanks again
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.