It's all about the answers!

Ask a question

Server-side extension and Spring


Sola Otudeko (4511316) | asked Nov 08 '12, 5:39 a.m.
edited Nov 08 '12, 5:44 a.m.
Hi, I'm developing a server-side extension based on the Extensions lab to call out to Spring Integration services. Problem is in the local debug instance, the plugin is not seeing the spring classes.

"... Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext ..."



I've used Add External Jars and Add External Class Folder, also created a lib folder in the project, added all jars to it and included them on the Build tab of the plugin.xml, Add Extra Classpath Entries. (My system CLASSPATH also includes the path to the jars). Still getting above error. Anyone know how I need to configure the class path?
Thanks
Sola

Accepted answer


permanent link
Ralph Schoon (58.5k23642) | answered Nov 08 '12, 7:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Nov 08 '12, 7:57 a.m.
Sola,

there are several approaches. See http://robertvarttinen.blogspot.de/2007/01/adding-third-party-jar-to-your-eclipse.html for example. I have seen several similar posts.

  1. Create a new plug-in from the Jar. And add the project as dependency and deploy it with the rest.
  2. Include the Jar in the project.
Although 2 seems simple, it did not easily work for me. I had to redo it several times. Here what I think worked.
  1. Put the Jar into the root folder or in another folder in this example lib.
  2. In the plug-In editor runtime tab add the folder then press new and add the jar file
  3. Save the change
  4. On the Project use PDE-Tools>Update Classpath
  5. Check the build tab for exporting the jar.

This should look like this screenshot.

After PDE-Tools>Update Classpath, make sure that the Jar starts showing up in your plugin and can be seen like in the image below.


You don't add the dependency as an external Jar. If you have done that, remove the external or whatever Jar's you had added.

If after doing those steps your Jar does not show up, what worked for me (after swearing a lot, I must confess) was remove all the changes 1..4 from the plugin save and try everything again, until the compile errors went away.
Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
sam detweiler (12.4k6182201) | answered Nov 08 '12, 6:51 a.m.
edited Nov 08 '12, 6:51 a.m.
can u look at the contents of your jar file (I use WinRAR) and make sure the class jar file is included? (as it should be from the check Binary Build checkbox on the build tab.. )


Your answer


Register or to post your answer.