Issue 17 in owasp-java-html-sanitizer: missing guava.jar causes hang with no exception

46 views
Skip to first unread message

owasp-java-h...@googlecode.com

unread,
Jul 25, 2013, 6:53:58 AM7/25/13
to owasp-java-html-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 17 by oliver.k...@gmail.com: missing guava.jar causes hang with
no exception
http://code.google.com/p/owasp-java-html-sanitizer/issues/detail?id=17

What steps will reproduce the problem?
1. include owasp-java-html-sanitizer.jar in the classpath but not guava.jar
2. run the code:

PolicyFactory policy = Sanitizers.FORMATTING;
logger.debug("Policy is " + policy);

What is the expected output? What do you see instead?

Expect either a thrown exception or the debug line to be printed

However, the debug line is never printed, the code just seems to hang

What version of the product are you using? On what operating system?

r198, Ubuntu Linux LTS 12

Please provide any additional information below.

This isn't a big problem, the setup instructions do after all say that
guava.jar is necessary but for troubleshooting purposes, shouldn't there be
some descriptive way of reporting the missing dependency?


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

owasp-java-h...@googlecode.com

unread,
Jul 25, 2013, 5:51:45 PM7/25/13
to owasp-java-html-...@googlegroups.com

Comment #1 on issue 17 by mikes...@gmail.com: missing guava.jar causes
When /tmp/Issue17.java is
====
import org.owasp.html.PolicyFactory;
import org.owasp.html.Sanitizers;
public class Issue17 {
public static void main(String... argv) {
PolicyFactory policy = Sanitizers.FORMATTING;
System.err.println("policy=" + policy);
}
}
====

I get

====
$ time ( \> javac \> -classpath
~/work/owasp-java-html-sanitizer/distrib/lib/owasp-java-html-sanitizer.jar \
> /tmp/Issue17.java \
> && java \
> -classpath
> /tmp:~/work/owasp-java-html-sanitizer/distrib/lib/owasp-java-html-sanitizer.jar
> \
> Issue17 \
> )
Exception in thread "main" java.lang.NoClassDefFoundError:
org/owasp/html/Sanitizers
at Issue17.main(Issue17.java:5)
Caused by: java.lang.ClassNotFoundException: org.owasp.html.Sanitizers
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 1 more

real 0m1.046s
user 0m1.739s
sys 0m0.160s
====

Does your classloader load from remote URLs, or from a slow network
file-system mount?
Running java with the -verbose:class flag might yield useful telemetry.

owasp-java-h...@googlecode.com

unread,
Jul 31, 2013, 12:55:17 PM7/31/13
to owasp-java-html-...@googlegroups.com
Updates:
Status: Invalid

Comment #2 on issue 17 by mikes...@gmail.com: missing guava.jar causes
Closing for lack of response
Reply all
Reply to author
Forward
0 new messages