One Star

Could not find or load main class

Hi,
I'm encountering an error when executing a small job in Talend Open Studio for ESB:
Error: Could not find or load main class miscellaneous.standing_orders_0_1.STANDING_ORDERS
Some points that might help shed some light:
- This error is only encountered when executing the job in TOS ESB. 
- I am unable to build a Standalone Job job. It appears to complete successfully but no zip file is produced and no error is shown. Building to an OSGI Bundle produces a file.
- The TOS ESB directory has no spaces: C:/TESB/
- My workspace is on a mapped network drive, however this also has no spaces in the name (and never caused problems with TOS ESB 5.6).
- I am using the Java 1.7 JDK
Any help would be greatly appreciated.
Thanks,
Jay

  • Talend ESB
  • Talend Studio
21 REPLIES
One Star

Re: Could not find or load main class

I just tested this again with a fresh install of TOS ESB and with a local/default workspace (i.e. inside the Studio directory) and I'm still getting the error. The job I'm testing with is just a tRowGenerator outputting to a tLogRow.
I've also:
- Emptied the C:\Users\\.m2 directory (which has repopulated with the fresh install)
- Tested with the 1.7 JDK and 1.8 JDK.
- Re-installed 1.8 JDK.
- Installed all required third-party libraries.
I forgot to mention I'm using Windows 7 Pro 64-bit.
One Star

Re: Could not find or load main class

I followed this quote in order to get Talend ESB to start, however I now think this may be part of the problem:

My system is behind a proxy and I've set the proxy up in Talend. I've restored the file names and attempted to start Talend ESB again, however I've run in to the java.lang.NullPointerException at org.talend.designer.codegen.JavaRoutineSynchronizer.doSyncRoutine(JavaRoutineSynchronizer.java:145) error again.
One Star

Re: Could not find or load main class

I followed this quote in order to get Talend ESB to start, however I now think this may be part of the problem:

My system is behind a proxy and I've set the proxy up in Talend. I've restored the file names and attempted to start Talend ESB again, however I've run in to the java.lang.NullPointerException at org.talend.designer.codegen.JavaRoutineSynchronizer.doSyncRoutine(JavaRoutineSynchronizer.java:145) error again.

Submitting the post removed my link, the original users quote is:
Hi,
I have manged to get TOS 6.0.0 working on Windows 7 64 bit by removing the suffix of ".lastUpdated" from the files maven-resources-plugin-2.7.jar.lastUpdated and maven-resources-plugin-2.7.pom.lastUpdated in the folder c:\Users\\.m2\repository\org\plugins\maven-resources-plugin
Hope this helps
Moderator

Re: Could not find or load main class

Hi JayJay29122,
Your ESB studio cannot start or you cannot execute your job successfull? Did you also get any "java.lang.NullPointerException" exception?
Did you point JDK folder to "Installed JREs" instead of JRE?
Best regards
Sabrina


One Star

Re: Could not find or load main class

Hi JayJay29122,
Your ESB studio cannot start or you cannot execute your job successfull? Did you also get any "java.lang.NullPointerException" exception?
Did you point JDK folder to "Installed JREs" instead of JRE?
Best regards
Sabrina


Hi Sabrina,
Thanks for the response.
The ESB studio cannot start (gives a Null pointer exception) while the maven-resources-plugin-2.7.jar.lastUpdated and maven-resources-plugin-2.7.pom.lastUpdated have .lastUpdated in the name. Once I rename the files, ESB starts.
Once ESB has started I can create jobs fine however none execute or build to standalone jobs; executing a job gives me an error of "could not find or load main class".  
The JDK folder was pointed at C:\Program Files\Java\jdk1.8.0_51

Thanks,
Jay
Moderator

Re: Could not find or load main class

Hi,
Did you install both JDK 1.7 and 1.8 on your machine?
Best regards
Sabrina
One Star

Re: Could not find or load main class

Hi,
Yes, JDK 1.7 and 1.8 installed, and tested with both.
Thanks,
Jay
One Star

Re: Could not find or load main class

I managed to get this working.
I had originally followed this process to get around the start-up issue due to my system being behind a proxy:
Hi,
I have manged to get TOS 6.0.0 working on Windows 7 64 bit by removing the suffix of ".lastUpdated" from the files maven-resources-plugin-2.7.jar.lastUpdated and maven-resources-plugin-2.7.pom.lastUpdated in the folder c:\Users\\.m2\repository\org\plugins\maven-resources-plugin
Hope this helps

Maven apparently uses a settings.xml file sitting in /.m2, however this neither existed nor worked when a file it was created there.
What should be done instead is there is a file called maven_user_settings.xml sitting inside /Studio/configuration
Add the proxy information to this file and then restart Talend (you may need to go through the /.m2/repository/org/plugins/ sub-directories and remove all .lastUpdated files). Maven should download a whole host of files into the /.m2 directory, Talend should start normally and you should be good to go! 
Obviously make sure Java JDK 1.8 is installed and that your JAVA_HOME environment variable is set.
Moderator

Re: Could not find or load main class

Hi jayjay2912,
Thanks a lot for your feedback. Is your "Could not find or load main class" issue also fixed ?
Could you please take a try on the 6.1.0M1 to see if everything is OK with you?

Best regards
Sabrina
One Star

Re: Could not find or load main class

Hi,
I tried to run job after adding the proxy information in maven_user_settings.xml. But still giving Error: Could not find or load main class (all .lastUpdated files from .m2 folder are also removed)
Moderator

Re: Could not find or load main class

Hi neha 1993,
Could you please also paste the whole log of this "Could not find or load main class " into forum which is helpful for us to make a further investigation on this issue?
In addition, have you tried to make a testing on the 6.1.0M1 to see if it is Ok with you?
Best regards
Sabrina
One Star

Re: Could not find or load main class

Tried with 6.1.0M1 also.Not working Smiley Sad
One Star

Re: Could not find or load main class

Hi jayjay2912,
Thanks a lot for your feedback. Is your "Could not find or load main class" issue also fixed ?
Could you please take a try on the 6.1.0M1 to see if everything is OK with you?

Best regards
Sabrina

Hi Sabrina,
Yes, the "Could not find or load main class" is fixed and I've managed to get Talend started and building jobs again.
Neha1993, all I can think of is to check the following:

Java JDK 1.8 installed.
JAVA_HOME is set to the \jre directory. Run "echo %JAVA_HOME%" in a cmd prompt (assuming you're on Windows) to confirm this. Just run "echo JAVA_HOME" if you're on Linux.
This is an example of my maven_user_settings.xml file (with the proxy address and port changed).  However as you are getting Talend to start this may not be your problem.


xmlns:xsi=""
xsi:schemaLocation=" ">


true
http
proxy.mynetwork.local
3000





Thanks,
Jay
Moderator

Re: Could not find or load main class

Hi jayjay2912,
Great it is fixed. Would you mind making a testing on the 6.1.0M1 to see if this issue is fixed without adding the proxy information in maven_user_settings.xml?
Great thanks!
Best regards
Sabrina
One Star

Re: Could not find or load main class

Hi Sabrina , 
I did all the mentioned above and it does not work for me. Could it be because of maven , I see the when i am running the job the error is thrown after the step:

Liana 
One Star

Re: Could not find or load main class

Sorry , I did not paste it : 
One Star

Re: Could not find or load main class

Liana
One Star

Re: Could not find or load main class

This is the last operation talend does
One Star

Re: Could not find or load main class

It does not paste it) so the last operation before throwing "Could not find or load main class " is : Refreshing maven model . 
Can I work without maven , if yes , how ? 
Thanks ,
Liana 
Moderator

Re: Could not find or load main class

Hi Liana,
These issues are probably caused by maven(we have changed our product underlying architecture since 6.0 ).
Does this issue still repro on studio 6.1.0M?
Best regards
Sabrina
Four Stars

Re: Could not find or load main class

Hello, i get same error : could not find or load main class when i execute job in Talend. Below are the details about talend and java installed. It used to work in my old system, however, I can't recall java version but Talend version was same. I have checked all the discussions revolving around this issue, but nothing worked. Please reply if anyone knows how to fix it. Talend V6.2 jdk1.8.0_131