Classpath problem when compiling customized Modules
dontrango Aug 26, 2004 10:53 PMHi, sorry for this cross-posting. While looking through this devel forum, I realize that my post may have been more relevant here.
This is the post on "http://www.jboss.org/index.html?module=bb&op=viewtopic&t=53467" :
I'll update this page once I try the suggestions given by theute.
I have this module GetAttrs that extends ModuleSupport; it's been successfully deployed.
The compilation is done using the build.xml provided by the source, "nukes-1.1.0-RC3-src/nukes/build.xml".
Nukes
|-nukes/src/main
| |- org.jboss.nukes.addons.modules.linkmodule
| |-GetAttrs.java
|
|- nukes/build.xml
|
|- ldapjdk.jar
I have written an LDAP client class; it's successfully compiled and run. The librariy I use is ldapjdk.jar.
When I merge the code and compile using the "nukes/build.xml", I got these error messages:
[javac] Nukes/nukes/src/main/org/jboss/nukes/addons/modules/linkmodule/GetAttrModule.java:9: package netscape.ldap does not exist
[javac] import netscape.ldap.*;
[javac] ^
[javac] Nukes/nukes/src/main/org/jboss/nukes/addons/modules/linkmodule/GetAttrModule.java:23: cannot resolve symbol
[javac] symbol : class LDAPConnection
[javac] location: class org.jboss.nukes.addons.modules.linkmodule.GetAttrModule
[javac] LDAPConnection ld = null;
[javac] ^
I have added ldapjdk.jar to my Nukes java build path and the directory "netscape/ldap" exists in the ldapjdk.jar.
When I use init.verbose=true, the target in ant shows the following:
buildmagic:init:show-environment:
[echo] build.compiler: ${build.compiler}
[echo] java.home: /usr/local/opt/j2sdk/j2sdk1.4.2_04/jre
[echo] java.class.path: /usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-antlr.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-apache-bsf.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-apache-resolver.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-commons-logging.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-commons-net.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-icontract.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jai.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jakarta-bcel.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jakarta-log4j.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jakarta-oro.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jakarta-regexp.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-javamail.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jdepend.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jmf.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-jsch.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-junit.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-launcher.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-netrexx.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-nodeps.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-starteam.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-stylebook.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-swing.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-trax.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-vaj.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-weblogic.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-xalan1.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-xalan2.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.apache.ant_1.6.1/lib/ant-xslp.jar:/usr/local/opt/ide/eclipse-SDK-3.0/plugins/org.eclipse.ant.ui_3.0.0/lib/remoteAnt.jar:/usr/local/opt/j2sdk/j2sdk1.4.2_04/lib/tools.jar
[echo] java.version: 1.4.2_04
[echo] java.vendor: Sun Microsystems Inc.
[echo] java.vm.version: 1.4.2_04-b05
[echo] java.vm.name: Java HotSpot(TM) Client VM
[echo] java.vm.info: mixed mode
So the ldapjdk.jar is not in the ${java.class.path}, can somebody help point out where is this variable specified? I read through buildmagic.ent and the dependent files, but I saw no part that calls this variable. May have missed something here.
I guess I need to modify the classpath. So I've gone to "Nukes/tools/etc/buildfragments" and modified ${classpath} in task.properties but it doesn't work. I tweaked some classpath variables but I still got the error message.
So here I am posting the message to the forum.
Has somebody met this problem? Is it possible to create our own module with our own libraries without modifying the build scripts that come with the source? This will make the module hard to maintain with the subsequent releases of Nukes.