java - Log Factory error -
java - Log Factory error -
i using hibernate on eclipse , continually next error message when seek compile:
build.xml:39: java.lang.noclassdeffounderror: org/apache/commons/logging/logfactory
i have commons-logging.jar
file within libs folder, , here classpath file:
<?xml version="1.0" encoding="utf-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.jre_container"> <attributes> <attribute name="owner.project.facets" value="java"/> </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimetarget/apache tomcat v6.0"> <attributes> <attribute name="owner.project.facets" value="jst.web"/> </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind="src" path="flex_src"/> <classpathentry kind="output" path="build/classes"/> </classpath>
i tried printing class path within build.xml
file, , commons-logging.jar
appears within there well, right directory. here build.xml file farther reference:
<project name="project" default="main"> <property file="build.properties" /> <xmlproperty file="${project-root}/src/meta-inf/persistence.xml" collapseattributes="true" /> <description>generate cdb files</description> <target name="force"> <property name="force.build" value="true" /> <antcall target="maininternal" /> </target> <target name="main"> <property name="force.build" value="false" /> <antcall target="maininternal" /> </target> <target name="maininternal"> <antcall target="generatehibernatecfg" /> <antcall target="compileentities" /> <antcall target="findannotations" /> <antcall target="compileserviceinterfaces" /> <antcall target="generatedtos" /> <antcall target="generateservices" /> <antcall target="generateflex" /> <antcall target="generateblazedsconfig" /> </target> <target name="generatehibernatecfg"> <xslt in="${project-root}/src/meta-inf/persistence.xml" style="${project-root}/cdb_build/src/hibernate.cfg.xsl" out="${project-root}/src/hibernate.cfg.xml" force="${force.build}" /> </target> <target name="compileentities"> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <echo message="classpath = ${cp}"/> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <script language="javascript"> <![cdata[ var includes = ""; var entitiesstring = project.getproperty("persistence.persistence-unit.class"); if (entitiesstring) { var entities = entitiesstring.split(","); (entity in entities) { if (entities[entity] != null && entities[entity] != "") { includes += string(entities[entity]).replace(/\./g, '/') + ".java,"; } } } project.setproperty("entities.include", includes); ]]> </script> <mkdir dir="${project-root}/build/classes" /> <javac includes="${entities.include}" srcdir="${project-root}/src" destdir="${classes-folder}" classpath="${cp}" debug="on" /> </target> <target name="findannotations"> <file name="annotated.xml" id="annotated.xml" /> <echo file="annotated.xml" message="<annotated-types/>" /> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <path id="cfg-xml-path"> <fileset file="${project-root}/src/hibernate.cfg.xml" /> </path> <pathconvert property="cfg-xml" refid="cfg-xml-path" /> <apt classpath="${cp}" compile="false" factory="com.farata.cdb.annotations.processor.cdbfullannotationprocessor" srcdir="${project-root}/src" sourcepath="${project-root}/src"> <option name="com.faratasystems.cdb.annotations.file" value="annotated.xml"/> <option name="com.faratasystems.cdb.configuration.file" value="${cfg-xml}"/> <include name="**/*.java"/> </apt> </target> <target name="compileserviceinterfaces"> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <xmlproperty file="annotated.xml" collapseattributes="true" /> <script language="javascript"> <![cdata[ var includes = ""; var typenamesstring = project.getproperty("annotated-types.annotated-type.name"); if (typenamesstring) { var annotationnamesstring = project.getproperty("annotated-types.annotated-type.annotations.annotation.name"); var annotationnames = annotationnamesstring.split(","); var typenames = typenamesstring.split(","); (annotationname in annotationnames) { if (annotationnames[annotationname] != null && annotationnames[annotationname] != "") { if (annotationnames[annotationname] == "clear.cdb.annotations.cx_service") { includes += string(typenames[annotationname]).replace(/\./g, '/') + ".java,"; } } } } project.setproperty("entities.include", includes); ]]> </script> <javac includes="${entities.include}" srcdir="${project-root}/src" destdir="${classes-folder}" classpath="${cp}" debug="on" /> </target> <target name="generatedtos"> <xmlproperty file="annotated.xml" collapseattributes="true" /> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <xslt classpathref="build.class.path" in="annotated.xml" style="src/service-dto-all.xsl" out="tmp.txt" force="true"> <param name="outputfolder" expression="${project-root}src" /> <param name="force" expression="${force.build}" /> </xslt> <script language="javascript" src="${basedir}/scripts.js"> <![cdata[ var includes = getservicesdtos(); includes += getservicesdtosubclasses(); project.setproperty("entities.include", includes == ""? "none":includes); ]]> </script> <javac includes="${entities.include}" srcdir="${project-root}/src" destdir="${classes-folder}" classpath="${cp}" debug="on" failonerror="false" /> </target> <target name="generateservices"> <xmlproperty file="annotated.xml" collapseattributes="true" /> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <xslt classpathref="build.class.path" in="annotated.xml" style="src/service-impl-all.xsl" out="tmp.txt" force="true"> <param name="outputfolder" expression="${project-root}src" /> <param name="force" expression="${force.build}" /> </xslt> <script language="javascript" src="${basedir}/scripts.js"> <![cdata[ var includes = getservices(); includes += getservicessubclasses(); project.setproperty("entities.include", includes == ""? "none":includes); ]]> </script> <javac includes="${entities.include}" srcdir="${project-root}/src" destdir="${classes-folder}" classpath="${cp}" debug="on" /> </target> <target name="generateflex"> <xmlproperty file="annotated.xml" collapseattributes="true" /> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <xslt classpathref="build.class.path" in="annotated.xml" style="flex_src/flex-all.xsl" out="tmp.txt" force="true"> <param name="flexoutputfolder" expression="${flex-output-folder}" /> <param name="javasrcfolder" expression="${project-root}src" /> <param name="force" expression="${force.build}" /> </xslt> <xslt classpathref="build.class.path" in="annotated.xml" style="flex_src/application-all.xsl" out="tmp.txt" force="true"> <param name="javasrcfolder" expression="${project-root}src" /> <param name="testfolder" expression="${project-root}test" /> <param name="force" expression="${force.build}" /> </xslt> </target> <target name="generateblazedsconfig"> <xmlproperty file="annotated.xml" collapseattributes="true" /> <path id="build.class.path"> <fileset dir="${project-root}/webcontent/web-inf/lib" /> <pathelement path="${classes-folder}" /> </path> <pathconvert property="cp" refid="build.class.path" /> <path id="srcfiles"> <fileset dir="${project-root}/src"> <include name="**/*.java" /> </fileset> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" " /> <script language="javascript" src="${basedir}/scripts.js"> <![cdata[ generateremotingconfig(); generatemessagingconfig(); ]]> </script> </target> </project>
i think might have provide more details on project structure. how did bundle project? (does contain ear ejb module packaged...)
pretty class loading problem. or possible jar not packaged final deployable archive. easiest prepare solution re-create , paste common-logging.jar file in server's lib directory. (for tomcat believe under catalina_home folder.. not sure)
java hibernate
Comments
Post a Comment