Try with a public constructor.
| -----Original Message----- | From: [EMAIL PROTECTED] | [mailto:[EMAIL PROTECTED] On Behalf | Of [EMAIL PROTECTED] | Sent: sexta-feira, 29 de Dezembro de 2006 13:29 | To: xdoclet-plugins-interest@lists.sourceforge.net | Subject: [xdoclet-plugins-interest] PicoInitializationException when | tryingto run custom plugin | | Hi, | | I'm getting PicoInitializationException when trying to run custom | plugin with Ant (version 1.6.5) running on Eclipse. | I have tested Beaninfo plugin and it is working fine, but my own | plugin based on Beaninfo is not working. | | Here is my Plugin code (it is simply cut and pasted from Beaninfo): | ---- | package org.xdoclet.plugin.object2hashmap; | | import java.util.HashMap; | | import org.generama.QDoxCapableMetadataProvider; | import org.generama.TemplateEngine; | import org.generama.VelocityTemplateEngine; | import org.generama.WriterMapper; | import org.generama.defaults.JavaGeneratingPlugin; | | import com.thoughtworks.qdox.model.JavaMethod; | import com.thoughtworks.qdox.model.JavaParameter; | import com.thoughtworks.qdox.model.Type; | | public class Object2HashtablePlugin extends JavaGeneratingPlugin { | | protected Object2HashtablePlugin(VelocityTemplateEngine templateEngine, | QDoxCapableMetadataProvider metadataProvider, | WriterMapper writerMapper) { | super(templateEngine, metadataProvider, writerMapper); | | setMultioutput(true); | | setFileregex("\\.java"); | setFilereplace("BeanInfo.java"); | | } | | public boolean shouldGenerate(Object metadata) { | return true; | } | | public String getParameterTypes(JavaMethod method) { | StringBuffer result = new StringBuffer(); | JavaParameter[] params = method.getParameters(); | for (int i = 0; i < params.length; i++) { | if (i > 0) { | result.append(", "); | } | result.append(typeToClass(params[i].getType())); | } | return result.toString(); | } | | private String typeToClass(Type type) { | String result = type.getValue(); | if (primitiveMap.get(result) != null) { | return (String) primitiveMap.get(result); | } | | return result + ".class"; | } | | private static final HashMap primitiveMap = new HashMap(); | static { | primitiveMap.put("boolean", "Boolean.TYPE"); | primitiveMap.put("int", "Integer.TYPE"); | primitiveMap.put("long", "Long.TYPE"); | primitiveMap.put("short", "Short.TYPE"); | primitiveMap.put("float", "Float.TYPE"); | primitiveMap.put("double", "Double.TYPE"); | primitiveMap.put("byte", "Byte.TYPE"); | } | | } | ---- | | And here is my ant build.xml ---- | <project default="init" basedir="../"> | | <property name="build_config" location="config" /> | <property file="${build_config}/build.properties" /> | | <path id="generator.compile.classpath"> | <fileset dir="${xdoclet.home}"> | <include name="**/*.jar" /> | </fileset> | </path> | | <target name="xdoclet-taskdef" depends="package-generator"> | <path id="xdoclet.task.classpath"> | <fileset dir="${xdoclet.home}/lib"> | <include name="**/*.jar" /> | </fileset> | <pathelement location="${generator-bin}/generator.jar" /> | </path> | <taskdef name="xdoclet" classname="org.xdoclet.ant.XDocletTask" | classpathref="xdoclet.task.classpath" /> | </target> | | <target name="init"> | <mkdir dir="${generated}" /> | <mkdir dir="${generator-bin}/classes" /> | </target> | | <target name="generate" depends="xdoclet-taskdef"> | <xdoclet verbose="true"> | <fileset dir="${src}"> | <include name="**/*.java" /> | </fileset> | <!-- | <component classname="org.xdoclet.plugin.beaninfo.BeanInfoPlugin" | destdir="${generated}" /> | --> | <component | classname="org.xdoclet.plugin.object2hashmap.Object2HashtablePlugin" | destdir="${generated}" /> | | </xdoclet> | </target> | | <target name="compile-generator" depends="init"> | <javac srcdir="${generator-src}" destdir="${generator-bin}/classes"> | <classpath refid="generator.compile.classpath" /> | </javac> | <copy todir="${generator-bin}/classes"> | <fileset dir="${generator-src}"> | <exclude name="**/*.java" /> | </fileset> | </copy> | </target> | | <target name="package-generator" depends="compile-generator"> | <jar jarfile="${generator-bin}/generator.jar" | basedir="${generator-bin}/classes" manifest="${generator.manifest}" | /> | </target> | | </project> | ---- | | I get this error (with no message): | ---- | BUILD FAILED | C:\Documents and Settings\lsoksane\My | Documents\workspace\xdoclet-workspace\config\build.xml:60: | org.picocontainer.PicoInitializationException | ---- | where line number refers to the line: | ---- | <xdoclet verbose="true"> | ---- | | Any suggestions what should I do? | | - Lauri Oksanen | | | | | ------------------------------------------------------------------------- | Take Surveys. Earn Cash. Influence the Future of IT | Join SourceForge.net's Techsay panel and you'll get the chance to share | your | opinions on IT & business topics through brief surveys - and earn cash | http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV | _______________________________________________ | xdoclet-plugins-interest mailing list | xdoclet-plugins-interest@lists.sourceforge.net | https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ xdoclet-plugins-interest mailing list xdoclet-plugins-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest