Hi,<br><br>I want to call CmsShell from from a custom ant task, like this:<br><br>String tArgs[] = new String[3];<br>tArgs[0] = "-base=" + webInfPath;<br>tArgs[1] = "-defaultWebApp=opencms";<br>tArgs[2] = "-servletMapping=opencms";<br>
<br>CmsShell.main( tArgs );<br><br><br>The class path for the task is set to the OpenCMS WEB-INF/lib folder and the JBoss lib folder (for servlet-api.jar etc.).<br><br>The parameters seem to work, since the opencms.properties file is read, for example.<br>
<br>However, there is a class loading problem:<br><br>java.lang.ClassNotFoundException: org.opencms.configuration.CmsSystemConfiguration<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)<br> at java.security.AccessController.doPrivileged(Native Method)<br>
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)<br>
at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)<br> at org.apache.commons.digester.Rule.begin(Rule.java:175)<br> at org.apache.commons.digester.Digester.startElement(Digester.java:1453)<br>
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)<br> at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)<br> at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)<br>
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)<br> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)<br> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)<br>
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)<br> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)<br> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)<br>
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)<br> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)<br> at org.apache.commons.digester.Digester.parse(Digester.java:1765)<br>
at org.opencms.configuration.CmsConfigurationManager.loadXmlConfiguration(CmsConfigurationManager.java:507)<br> at org.opencms.configuration.CmsConfigurationManager.loadXmlConfiguration(CmsConfigurationManager.java:342)<br>
at org.opencms.main.OpenCmsCore.initConfiguration(OpenCmsCore.java:970)<br> at org.opencms.main.OpenCmsCore.upgradeRunlevel(OpenCmsCore.java:1699)<br> at org.opencms.main.CmsShell.<init>(CmsShell.java:458)<br>
<br><br>Calling CmsShell from an ant task with the very same classpath works:<br><br><java classname="org.opencms.main.CmsShell" fork="true" input="shell.input"><br> <classpath><br>
<fileset dir="${opencms.lib.dir}"><br> <include name="**/*.jar"/> <br> </fileset><br> <fileset dir="${jboss.server.dir}/lib"><br>
<include name="**/*.jar"/> <br> </fileset><br> </classpath><br> <arg value="-base=${opencms.web.dir}" /><br> <arg value="-defaultWebApp=opencms" /><br>
<arg value="-servletMapping=opencms" /><br> </java><br><br>Any ideas why it doesn't work from a custom task?<br><br>Thanks in advance.<br>