You shouldn't need htmlunit-core-js-2.2.jar. These are the dependencies that are currently required for the htmlunit part:
<dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.3</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>rhino</groupId> <artifactId>js</artifactId> <version>1.7R1</version> </dependency> <dependency> <groupId>net.sourceforge.cssparser</groupId> <artifactId>cssparser</artifactId> <version>0.9.5</version> </dependency> <dependency> <groupId>net.sourceforge.nekohtml</groupId> <artifactId>nekohtml</artifactId> <version>1.9.9</version> </dependency> <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>2.7.0</version> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency>
If you investigate and are still stuck, please post the full stack trace.
thanks for your answer. I followed your advice and checked that an old jar was not in the classpath. It seems that not as:
- I removed htmlUnit-core and leave js-1.7R1, the error was the same
- I removed both jars from the classpath and I got a NoClassDefFound error. Thus I'm sure that there is no other old jar in the classpath.
I cannot copy/past the stackTrace as our environment is secured but here is a more detailed stackTrace:
Hope It's enough to help.
Are you running JDK 1.5 or higher? The class was compiled for JDK 1.5, so it won't run properly with JDK 1.4.
Perhaps you should examine the class yourself with a byte code viewer. The one I use is jclasslib. You can get it at http://www.ej-technologies.com/products/jclasslib/overview.html
I followed again your advices and checked the JVM version I'm running. I'm using JRockitR27-2.3 which is BEA improved version mixing classes from several JDK (Indeed I'm using Weblogic as AppServ).
I used jclassLib to check that the method is in the js-1.7R1 and it is, with the correct signature! Note that I'm only using the js-1.7R1 jar and not HTMLUnit-core-js jar.
Do I have to use a specific JDK version or do I have to configure something special? It seems you right that the problem comes from my runtime environnement which seems to be not compatible with the JSFUnit libs?
many thanks again.
One way to do it is to turn on verbose mode. I'm not sure if JRockit has something like this, but, for example, you can do this with Sun's JDK to see where java.util.ArrayList was loaded from:
c:\>java -verbose |grep java.util.ArrayList [Loaded java.util.ArrayList from c:\jdk1.5.0_16\jre\lib\rt.jar]
Stan, you're right! But I'm afraid I'll be stuck now...
Indeed, thanks to the new stackTrace I had a look to the Context class and not the ContextFactory class. I used a class that gives me the .class location and I found the Context class in the weblogic.jar archive...
I used jclasslib to check the existence of the call method and this method does not exist: we've found the problem!
However, now that it's in the weblogic.jar I have no options about that, I can't remove it from the weblogic library so I guess I'm quiet stuck. Maybe my environment is not compatible with the last version of JSFUnit? For information I'm running with:
- Weblogic 9.2 (JEE 1.4 compliant)
- JSF 1.1
I cannot upgrade to JSF 1.2 as we are stuck with weblogic 9.2.
Do you confirm that my environment is not compatible?
you've been very helpful stan, thanks again!
We have many community developers running JSFUnit on Weblogic, but I have no way of knowing if they are using your version.
If the above does not work, then I would contact Weblogic and as which version of the org.mozilla.javascirpt library they are using. If it is an earlier version than 1.7R1 then ask them how it can be upgraded.
Hi All ,
I tried to resolve the same issue by placing js-1.7R1 in the PRE_CLASSPATH in setDomainEnv.cmd
But here is the new Error I get
FYI:I am using htmlunit-core-js-2.2.jar.
Any help ?
I'm going to release JSFUnit 1.0 GA in the next day or two. It uses HtmlUnit 2.4 along with its own version of Rhino. Let's wait and see what effect that has.
I tried the 1.0 GA implementation (from the maven repo) and it causes the same problem as described above. I'm using BEA weblogic 10, so weblogic.jar seems to stay a problem.
For test purposes I removed org.mozilla.* from weblogic.jar. After restarting the server, the problem is gone, so I can confirm that weblogic.jar is still the problem.
After some more investigation I found a workable solution for my situation:
I added htmlunit-core-js-2.4.jar in the classpath BEFORE weblogic.jar.
Another solution could be to add a weblogic.xml to the webproject containing the following line: <prefer-web-inf-classes>true</prefer-web-inf-classes>.
The second solution can cause other errors caused by other version incompatabilities.
Thanks for letting us know the solution.