Ceren KOKSAL wrote:
I tried the example with apacheds-1.0.0 , it has worked:)
While building, build.xml copies jars from apacheds-1.0.0.
Thanks Ceren, This is great news!
So when I try to run the example, it connects apacheds-1.0.0. How I will
obtain it to connect apacheds-1.5.0?
I looked at the code but I couldn't see anything about the apacheds
path.I think example connects to the apacheds version whom jars are used
while building the example.Is it like that?And what must I do:) Can
there be any problem with the apacheds-1.5.0 's jars?
The interesting thing is, that the servlet connects to the ApacheDS,
which is *embedded* in the WebApp. The listener code starts and stops
it. Therefore the servlet connects to the version which is included in
the libs, the 1.0.1 in case of
http://directory.apache.org/apacheds/1.0/embedding-apacheds-as-a-web-application.html
Your problem has something to do with the build.xml, which copies the
relevant jars to the webapp in target "copyApacheDsLibs". There is a
difference in between what is needed in 1.0 and 1.5.
For instance, the apacheds-schema-*.jar files are currently not copied
in the build.xml, which causes the problem.
It is now working in my env with 1.5, but I had to modify the build.xml
for ApacheDS 1.5. Find the one I used attached. Please let us know,
whether it works (you have to adjust paths to apacheds and tomcat).
We have to create another version of this page for the 1.5 documentation
I'll create a JIRA for that.
I hope that helps, Greetings,
Stefan
<?xml version="1.0" encoding="UTF-8"?>
<project name="./ApacheDsWebApp" default="webapp" basedir=".">
<property name="apacheds.home" value="C:/java/apacheds-1.5.1-SNAPSHOT/" />
<property name="tomcat.home" value="C:/java/apache-tomcat-5.5.20/" />
<property name="apacheds.lib" value="${apacheds.home}/lib" />
<property name="apacheds.bin" value="${apacheds.home}/bin" />
<property name="servlet-api.jar" value="${tomcat.home}/common/lib/servlet-api.jar" />
<property name="dir.src" value="./src" />
<property name="dir.war" value="./WebContent" />
<property name="dir.classes" value="${dir.war}/WEB-INF/classes" />
<property name="dir.lib" value="${dir.war}/WEB-INF/lib" />
<property name="target.war" value="./ApacheDS.war" />
<!-- create target dirs -->
<target name="prepare">
<mkdir dir="${dir.classes}" />
<mkdir dir="${dir.lib}" />
</target>
<target name="copyApacheDsLibs">
<copy todir="${dir.lib}">
<fileset dir="${apacheds.lib}">
<include name="antlr-*.jar" />
<include name="apacheds-*.jar" />
<include name="backport-util-concurrent-*.jar" />
<include name="commons-collections-*.jar" />
<include name="commons-lang-*.jar" />
<include name="jdbm-*.jar" />
<include name="mina-core-*.jar" />
<include name="mina-filter-ssl-*.jar" />
<include name="shared-asn1-*.jar" />
<include name="shared-asn1-codec-*.jar" />
<include name="shared-ldap-*.jar" />
</fileset>
<fileset dir="${apacheds.bin}">
<include name="logger.jar" />
</fileset>
</copy>
</target>
<target name="compile" depends="prepare,copyApacheDsLibs">
<javac srcdir="${dir.src}" destdir="${dir.classes}" includes="**/*.java">
<classpath>
<pathelement location="${servlet-api.jar}" />
<fileset dir="${dir.lib}">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
<copy todir="${dir.classes}">
<fileset dir="${dir.src}">
<filename name="log4j.properties" />
</fileset>
</copy>
</target>
<!-- create WAR-File -->
<target name="webapp" depends="compile">
<jar destfile="${target.war}">
<fileset dir="${dir.war}" />
</jar>
</target>
<target name="clean">
<delete dir="${dir.classes}" />
<delete dir="${dir.lib}" />
<delete file="${target.war}" />
</target>
</project>