DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page problem in plugin develpment in eclipse
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Feb 2009
Exclamation problem in plugin develpment in eclipse - 02-18-2009, 11:04 PM

i created a plugin and accessing the database it gives me ClassNotFound Exception even though i added the jar file in JavaBuild Path as external jar. give me a solution to get rid out of it. but when i try on a single java program it works.
Reply With Quote
  (#2 (permalink)) Old
Moderator
 
Posts: 119
Thanks: 0
Thanked 10 Times in 9 Posts
Join Date: Jan 2008
Default 02-19-2009, 07:08 AM

You'll need to add it to the classpath section in Dependencies under plugin.xml
The typical Project Build Path settings won't work for a plugin

James
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Feb 2009
Default 02-20-2009, 12:16 AM

Hi James,
Thanks for your answer , please could you elobarate it. i am new to eclipse
Reply With Quote
  (#4 (permalink)) Old
Moderator
 
Posts: 119
Thanks: 0
Thanked 10 Times in 9 Posts
Join Date: Jan 2008
Default 02-20-2009, 06:43 AM

Sorry,
What you'll need to do in steps:
- open the plugin.xml (or Manifest.MF if there is no plugin.xml) for your plugin
- navigate to the Runtime tab
- Add the jar to the classpath section (on the bottom right hand side)

If you need more info, let me know
James
Reply With Quote
  (#5 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Feb 2009
Default 02-23-2009, 12:42 AM

Thanks James,
But still now i am getting the same error. Let me explain you the in detail.
1) Created a plugin project using wizard "Hello world"
1.1) i added the mysql.jar in runtime tab as you said.
2) Now i added the mysql.jar file in javabuild bath as external jar.
3) created a method for database connection check.
4) if i click the toolbar item in runtime. it gives me the error class not found.


Thanks & Regards
Davenci
Reply With Quote
  (#6 (permalink)) Old
Moderator
 
Posts: 119
Thanks: 0
Thanked 10 Times in 9 Posts
Join Date: Jan 2008
Default 02-23-2009, 02:43 AM

That's a bit strange. Could you send me your plugin.xml file so I can take a closer look?
Reply With Quote
  (#7 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Feb 2009
Default 02-23-2009, 04:11 AM

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>

<extension
point="org.eclipse.ui.commands">
<category
name="Sample Category"
id="com.tcs.tools.jpsentitygen.commands.category" >
</category>
<command
name="Sample Command"
categoryId="com.tcs.tools.jpsentitygen.commands.ca tegory"
id="com.tcs.tools.jpsentitygen.commands.sampleComm and">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="com.tcs.tools.jpsentitygen.commands.sam pleCommand"
class="com.tcs.tools.jpaentitygen.handlers.SampleH andler">
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="com.tcs.tools.jpsentitygen.commands.sam pleCommand"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+6"
schemeId="org.eclipse.ui.defaultAcceleratorConfigu ration">
</key>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menurg.eclipse.ui.main.menu?after=a dditions">
<menu
label="Sample Menu"
mnemonic="M"
id="com.tcs.tools.jpsentitygen.menus.sampleMenu">
<command
commandId="com.tcs.tools.jpsentitygen.commands.sam pleCommand"
mnemonic="S"
id="com.tcs.tools.jpsentitygen.menus.sampleCommand ">
</command>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbarrg.eclipse.ui.main.toolbar?a fter=additions">
<toolbar
id="com.tcs.tools.jpsentitygen.toolbars.sampleTool bar">
<command
commandId="com.tcs.tools.jpsentitygen.commands.sam pleCommand"
icon="icons/sample.gif"
tooltip="Say hello world"
id="com.tcs.tools.jpsentitygen.toolbars.sampleComm and">
</command>
</toolbar>
</menuContribution>
</extension>

</plugin>


Thanks & Regards
Davenci
Reply With Quote
  (#8 (permalink)) Old
Moderator
 
Posts: 119
Thanks: 0
Thanked 10 Times in 9 Posts
Join Date: Jan 2008
Default 02-23-2009, 04:35 AM

Sorry - I meant to say Manifest.MF

You should have something like this in the manifest:

Bundle-ClassPath: lib/mysqlconnection.jar,
Reply With Quote
  (#9 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Feb 2009
Default 02-23-2009, 04:58 AM

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JPAEntityGen Plug-in
Bundle-SymbolicName: com.xyz.tools.jpsentitygen; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: com.xyz.tools.jpaentitygen.JPAEntityGen
Bundle-Vendor: XYZ
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.console,
org.eclipse.jface.text
Eclipse-LazyStart: true
Bundle-ClassPath: ojdbc14.jar,
mysql-connector-java-5.1.5.jar


Thanks & Regards
Davenci

Last edited by davenci; 02-23-2009 at 05:24 AM.
Reply With Quote
  (#10 (permalink)) Old
Member
 
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Join Date: Feb 2009
Default 02-23-2009, 05:58 AM

Hai James, The Problem has beeen resolved
Thanks a lot.


Thanks & Regards
Davenci
Reply With Quote
Reply

Tags
database, plugin

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing plugin over local update site zmajmatic Eclipse 0 10-19-2008 12:27 PM
problem with classloader from plugin nev.clark Eclipse 9 09-30-2008 01:54 PM
Plugin SearchEngine problem oziransky Eclipse 0 09-17-2008 12:05 PM
runing plugin writen in eclipse 3.3 under eclipse 3.2 eladfein@yahoo.com Eclipse 0 07-27-2008 02:37 AM
Problem in creating plugin for RCP workdesk03 Eclipse 0 07-22-2008 03:42 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com