Application Server Solutions for Microsoft IIS and ASP.NET
       solutions   products   partners   company   support   downloads         store
ServletExec Self-Help: FAQ
Back to Search >  Back to Search Results

Faq ID 96
Product JTurbo, ServletExec
Category ArcIMS Users, Class Loading/Reloading, VM Settings, VM Support, XML
Question I am trying to compile or to run my Java code but I get NoSuchMethodError or things are behaving as if I am using an incorrect version of a class or JAR file. What is wrong ?
Answer The problem may be that you have an incorrect version of a JAR file residing in the extensions folder of your JVM installation. Check places like:
  • C:\jdk1.2.2\jre\lib\ext
  • C:\jdk1.3\jre\lib\ext
  • C:\jdk1.4\jre\lib\ext
JARs placed there get added to the JVMs classpath when the JVM starts up, before other code (such as ServletExec, or such as a -classpath option of the java or javac commands) gets to append/effect the Classpath. This could prevent the correct version of classes from being recognized, in which case you should remove the incorrect JARs in the extensions folder (or at least change their extensions to something other than .jar or .zip

If that does not seem to help (even after a restart of the JVM) then there is a System property you should examine (the one named "sun.boot.class.path").
  • If you are using SE 5.0 or newer you can view all JVM System properties using the SE Admin UI.
  • If you are using SE 4.2 or older, then you can view the property of interest using Java code like this:
    System.out.println(System.getProperty("sun.boot.class.path"));
    It's value will be a list of JARs that your JVM is adding to its classpath automatically. If you see one that is not the correct version or may be conflicting with the one you want to use then remove it, or rename it with an extension other than .zip or .jar so that the JVM won't automatically add it to the classpath.
    You may also need to examine other System Properties. You could run code like the following to output all of them:
      java.util.Enumeration names = System.getProperties().propertyNames();
      String name, value;
      while(names.hasMoreElements())
      {
        name  = (String) names.nextElement();
        value = System.getProperty(name);
    
        //now output <name = value>
        System.out.println( name + " = " + value );
      }  			
      
If you are a user of ESRI software then you may be seeing an error:
NoSuchMethodError at org.apache.crimson.jaxp.DocumentBuilderImpl
The most common time that ESRI software users see this problem is when they have installed ArcIMS and ServletExec, and they try to deploy a web application (any web application) inside ServletExec.
This problem is caused by conflicting versions of jar files on your machine as described at the beginning of this FAQ. The complete details about this are:
ArcExplorer Java is responsible for placing the older jaxp.jar and parser.jar files into the extensions folder of the JVM. Even the version of ArcExplorer Java that comes with ArcIMS 4.0.1 will do this. The location of the extensions folder will depend on which version of JVM you are using and whether or not you are using JRE or JDK.
You should look in folders such as:
  • C:\jdk1.2.2\jre\lib\ext
  • C:\jdk1.3\jre\lib\ext
  • C:\jdk1.4\jre\lib\ext

or perhaps:
  • C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext (if using JRE)
for jaxp.jar and parser.jar.
Since ArcExplorer Java needs these JARs (but their presence prevents ServletExec from functioning correctly), here is what you must do:
  1. Find the jaxp and parser JARs in the ...\lib\ext folder
  2. Note the absolute path to that ...\lib\ext folder for step 5 below
  3. Move (not copy) the JARs to another location, such as C:\myJars
  4. Right-click on the shortcut used to start ArcExplorer Java and choose Properties
  5. In the Target box, insert the following just prior to the first "-X" argument:
    -Djava.ext.dirs="<full path to \lib\ext folder>;C:\myJars"
    where <full path to \lib\ext folder> is the absolute path that you noted in step 2 above.

The following is an example (each argument is shown on a separate line for clarity):
"C:\Program Files\JavaSoft\JRE\1.3.1\bin\javaw.exe"
-Djava.ext.dirs="C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext;C:\myJars"
-Xms24m
-Xmx256m
com.esri.ae.AE


ServletExec already has the correct versions of the classes provided by these JARs. By removing these files from the ...\lib\ext folder, you allow the JVM that ServletExec starts up to see ServletExec's versions, and so SE should work correctly now. And by changing the way that ArcExplorer Java starts the JVM (as shown above) you ensure that ArcExplorer Java will continue to function correctly too.
NOTE: simply renaming these files may not be sufficient. They must be removed from the \ext folder, and then the JVM must be stopped and restarted. Also, do NOT simply delete these JAR files. Because then if you need them again for some reason, they'll be gone. Save them somewhere safe, where you can find them again if needed.



   
company media information terms of use privacy policy contact us