Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException: org.dllearner.autosparql.server.util.SimpleHTMLLayout #15

Open
ziodave opened this issue Jun 18, 2014 · 4 comments

Comments

@ziodave
Copy link

ziodave commented Jun 18, 2014

Hello,

When I run mvn install -N in autosparql I get the following error:

Running org.aksw.autosparql.server.CacheTest
log4j:ERROR Could not instantiate class [org.dllearner.autosparql.server.util.SimpleHTMLLayout].
java.lang.ClassNotFoundException: org.dllearner.autosparql.server.util.SimpleHTMLLayout

Is there a way to fix this?

@LorenzBuehmann
Copy link
Contributor

I can not find any occurrences of class SimpleHTMLLayout in CacheTest, see https://github.com/AKSW/AutoSPARQL/blob/master/autosparql/src/test/java/org/aksw/autosparql/server/CacheTest.java. Do you use the latest version?

@ziodave
Copy link
Author

ziodave commented Jun 18, 2014

This is the full stack trace:

Running org.aksw.autosparql.server.CacheTest
log4j:ERROR Could not instantiate class [org.dllearner.autosparql.server.util.SimpleHTMLLayout].
java.lang.ClassNotFoundException: org.dllearner.autosparql.server.util.SimpleHTMLLayout
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at org.apache.log4j.helpers.Loader.loadClass(Loader.java:198)
    at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:326)
    at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:123)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:764)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
    at org.apache.log4j.Logger.getRootLogger(Logger.java:135)
    at org.aksw.autosparql.server.CacheTest.fillCacheTest(CacheTest.java:78)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Running a grep on all files I can see the following:

$ find . -type f -exec grep "SimpleHTMLLayout" {} \; -print
public class SimpleHTMLLayout extends HTMLLayout {
./src/main/java/org/aksw/autosparql/server/util/SimpleHTMLLayout.java
log4j.appender.html.layout=org.dllearner.autosparql.server.util.SimpleHTMLLayout
./src/main/resources/log4j.properties
org/aksw/autosparql/server/util/SimpleHTMLLayout.class
./target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
log4j.appender.html.layout=org.dllearner.autosparql.server.util.SimpleHTMLLayout
./war/WEB-INF/classes/log4j.properties
Binary file ./war/WEB-INF/classes/org/aksw/autosparql/server/util/SimpleHTMLLayout.class matches
./war/WEB-INF/classes/org/aksw/autosparql/server/util/SimpleHTMLLayout.class

If it possibile that the SimpleHTMLLayout is referenced by the log4j configuration?

I'll try to comment it out.

@ziodave
Copy link
Author

ziodave commented Jun 18, 2014

As a temporary workaround I replaced this - although I suspect that user_sessions.html is important 😄 :

log4j.appender.html=org.apache.log4j.DailyRollingFileAppender
log4j.appender.html.File=logs/user_sessions.html
log4j.appender.html.layout=org.dllearner.autosparql.server.util.SimpleHTMLLayout
log4j.appender.html.threshold=INFO
log4j.appender.html.Append=true

with this:

log4j.appender.html=org.apache.log4j.FileAppender
log4j.appender.html.File=logs/user_sessions.html
log4j.appender.html.layout=org.apache.log4j.PatternLayout
log4j.appender.html.layout.ConversionPattern=%d{ABSOLUTE} %-5p %C{1}: %m%n
log4j.appender.html.threshold=INFO
log4j.appender.html.Append=true

@ziodave
Copy link
Author

ziodave commented Jun 18, 2014

Compilation still fails with the following error:

Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.3.0:compile (default) on project autosparql: GWT Module org.dllearner.autosparql.Application not found in project sources or resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants