I was using HTMLParser Version 1.42 (Release Build Jul 27, 2004)
and my code was working
than I changed to HTMLParser Version 1.5 (Integration Build Mar 13, 2005)
why my code doesn't work anymore?
I'm using JDK 1.3.1
and this is the exception
java.lang.UnsupportedClassVersionError: org/htmlparser/filters/HasAttributeFilter (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at com.ktec.xmlmodules.acquisition.HTMLParser.parse2XML(HTMLParser.java:171)
at com.ktec.xmlmodules.acquisition.Test.main(Test.java:23)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It doesn't seem like anything from HtmlParser is on the exception stack except for the mention of the org/htmlparser/filters/HasAttributeFilter which apparently failed deserialization.
Maybe you could serialize it again.
The class did change to support the FilterBuilder application.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What means "It doesn't seem like anything from HtmlParser" ? I don't understand!
maybe you need more informations. I'll try to be more clear.
This error comes out when I use the HasAttributeFilter class ...
It seems that my JVM can't load that class
Source code at HTMLParser.java:171 is:
cl = t.getChildren().extractAllNodesThatMatch(new AndFilter(
new TagNameFilter("OPTION"),
new HasAttributeFilter("selected")));
No errors comes out if i don't use HasAttributeFilter and instead use TagNameFilter again.
any ideas?
where am I wrong?
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There must be some older version of the HasAttributeFilter on your classpath, or baked into your code.
I can't debug your problem for you.
Start with a simple test case:
import org.htmlparser.filters.HasAttributeFilter;
class Test
{
public static void main (String[] args)
{ HasAttributeFilter x = new HasAttributeFilter ("selected"); }
Compile it and run it.
Then add your classpath and run it.
Put that statement as the first one in your mainline and run it.
Move the statement around in your program temporally, closer and closer to the error location and run it.
At some point it will replicate the problem.
Use a binary search between the last two runs to find out why.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was using HTMLParser Version 1.42 (Release Build Jul 27, 2004)
and my code was working
than I changed to HTMLParser Version 1.5 (Integration Build Mar 13, 2005)
why my code doesn't work anymore?
I'm using JDK 1.3.1
and this is the exception
java.lang.UnsupportedClassVersionError: org/htmlparser/filters/HasAttributeFilter (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at com.ktec.xmlmodules.acquisition.HTMLParser.parse2XML(HTMLParser.java:171)
at com.ktec.xmlmodules.acquisition.Test.main(Test.java:23)
It doesn't seem like anything from HtmlParser is on the exception stack except for the mention of the org/htmlparser/filters/HasAttributeFilter which apparently failed deserialization.
Maybe you could serialize it again.
The class did change to support the FilterBuilder application.
What means "It doesn't seem like anything from HtmlParser" ? I don't understand!
maybe you need more informations. I'll try to be more clear.
This error comes out when I use the HasAttributeFilter class ...
It seems that my JVM can't load that class
Source code at HTMLParser.java:171 is:
cl = t.getChildren().extractAllNodesThatMatch(new AndFilter(
new TagNameFilter("OPTION"),
new HasAttributeFilter("selected")));
No errors comes out if i don't use HasAttributeFilter and instead use TagNameFilter again.
any ideas?
where am I wrong?
thanks
There must be some older version of the HasAttributeFilter on your classpath, or baked into your code.
I can't debug your problem for you.
Start with a simple test case:
import org.htmlparser.filters.HasAttributeFilter;
class Test
{
public static void main (String[] args)
{ HasAttributeFilter x = new HasAttributeFilter ("selected"); }
Compile it and run it.
Then add your classpath and run it.
Put that statement as the first one in your mainline and run it.
Move the statement around in your program temporally, closer and closer to the error location and run it.
At some point it will replicate the problem.
Use a binary search between the last two runs to find out why.