ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: ibator question about <commentGenerator> element
Date Fri, 29 Aug 2008 15:58:27 GMT
This is a limitation in the eclipse plugin - the classpath for the "Generate
iBATIS Artifacts" menu option is hardcoded in the plugin.xml file.  You have
these options:

1. Add your class to the JAR as you are doing
2. Package your class as a seperate plugin and add it to the Abator UI
plugin.xml dependancies
3. Use the integrated Ant task rather than the menu option - because you can
set the class path with the Eclipse Ant support

#3 is the best option now.  When I finally get to releasing ibator, I plan
on doing away with the menu option completely and using a launch
configuration instead (Run As->Ibator Build).  This will give you better
control over the classpath for situations like these.

BTW - I'm in the midst of a major refactoring of ibator now.  This is the
cause of the delay in releasing.

Jeff Butler



On Fri, Aug 29, 2008 at 10:42 AM, Steven R. Baturin <steve_baturin@yahoo.com
> wrote:

>   Hello:
>
> I have created a specialization of the DefaultCommentGenerator class and
> over-ridden the addFieldComment method.
>
> Using Eclipse, I "Generate iBATIS Artifacts" and everything works fine as
> long as I add my class file to the abator.jar file in
> ./eclipse/plugins/org.apache.ibatis.abator.core_1.1.0.
>
> When I change the plugin.xml file in
> ./eclipse/plugins/org.apache.ibatis.abator.core_1.1.0 to include an
> additional <library> element to refer to my class file, I get the following
> run-time error (in the Eclipse PDE Runtime Error Log).
>
>
> java.lang.RuntimeException: Cannot instantiate object of type
> aces.ibatis.DefaultCommentGenerator
> at
> org.apache.ibatis.abator.internal.AbatorObjectFactory.createObject(AbatorObjectFactory.java:66)
> at
> org.apache.ibatis.abator.internal.AbatorObjectFactory.createCommentGenerator(AbatorObjectFactory.java:180)
> at
> org.apache.ibatis.abator.config.AbatorContext.getCommentGenerator(AbatorContext.java:448)
> at
> org.apache.ibatis.abator.internal.java.dao.BaseDAOGenerator.getDAOImplementation(BaseDAOGenerator.java:238)
> at
> org.apache.ibatis.abator.internal.java.dao.BaseDAOGenerator.getGeneratedJavaFiles(BaseDAOGenerator.java:222)
> at
> org.apache.ibatis.abator.config.AbatorContext.generateFiles(AbatorContext.java:272)
> at org.apache.ibatis.abator.api.Abator.generate(Abator.java:208)
> at org.apache.ibatis.abator.api.Abator.generate(Abator.java:124)
> at
> org.apache.ibatis.abator.ui.actions.RunAbatorThread.run(RunAbatorThread.java:79)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1779)
> at
> org.apache.ibatis.abator.ui.actions.RunAbatorAction$AbatorRunner.run(RunAbatorAction.java:140)
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
> Caused by: java.lang.ClassNotFoundException:
> aces.ibatis.DefaultCommentGenerator
> at java.lang.ClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at
> org.apache.ibatis.abator.internal.AbatorObjectFactory.createObject(AbatorObjectFactory.java:61)
> ... 12 more
>
>
> Any help is appreciated.
>
> Sincerely,
>
> Steve
>
>

Mime
View raw message