20

I get this error:

java.lang.InternalError: name is too long to represent
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:259)

Which seems related to some debug functionality (in fact removing -Xdebug command line option the error disappears). I've also found some information in ASF Bugzilla. Is there a way to solve this?

Possible solutions I can think of are to change the JVM (using JRockit which should't have this issue), but I do not really know if this can solve the issue and if it can break something else.

Paolo
  • 2,461
  • 5
  • 31
  • 45
  • 2
    If it's a known bug we can't solve it either. Switching JVMs does work in general, of course you have to test against another JVM. – home Nov 21 '11 at 09:34
  • 2
    You can read the last post: https://forums.oracle.com/forums/thread.jspa?threadID=943287 – Alex K Nov 21 '11 at 09:37
  • It seems as if the bug doesn't have a resolved state in Sun's tracker, and it also has low priority. I don't think it's gonna be better in more recent JVMs. Been open since 2005, looks like they just don't care about it. – G_H Nov 21 '11 at 09:37
  • I will try JRockit, crossing my fingers :) – Paolo Nov 21 '11 at 10:09
  • I am still not able to try my software with JRockit since version for java 1.5 it seems it can't be find anywhere. – Paolo Nov 25 '11 at 11:16
  • @Paolo, are you saying that this bug is present in Sun JVM 1.5 but not in 1.6 and up? In other words, was it fixed in newer versions? – Gili Nov 26 '11 at 20:53
  • No, sorry, the bug is related to Sun JVM. I need JRockit for Java 5 because my project doesn't run on Java 6... – Paolo Nov 27 '11 at 20:36
  • Do you have deeply-nested class definitions? – Dave Newton Nov 29 '11 at 19:14

5 Answers5

10

update The bug mentioned in the original answer below has now been closed!


As noted in the article that you reference, this is a bug in the Sun/Oracle JVM implementation. At the time of writing, it is unresolved.

I can think of three ways to work around the issue:

  1. Don't generate SMAP files at all (eg: don't run with -Xdebug or use suppressSmap-like settings)
  2. Try to make sure that the size of the debug information is small (eg: reduce the size of your code)
  3. Use a different virtual machine implementation.
Guus
  • 2,986
  • 2
  • 21
  • 32
  • Thanks for your answer, just two points: Are you confirming the bug is present in version 5 and 6 Sun JVM? (Please note that Oracle JRockit VM shouldn't have this problem). Can you elaborate a bit on "suppressSmap-like"? – Paolo Dec 01 '11 at 08:49
  • +1, I will accept this answer, if the details I asked will be provided. – Paolo Dec 02 '11 at 14:21
  • I haven't personally reproduced the bugs on both Sun/Oracle 5 and 6, but the bugreport that I linked to remains unresolved. That, combined with ongoing comments in the report, is a good indication that the bug is still present. As for the SuppressSmap-like settings: some implementations work around this bug by providing custom settings to prevent debugging data from being created. See, for example, the 'known issues' section at http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html – Guus Dec 03 '11 at 12:35
  • 1
    Just got hit by the same issue. I was using jdk1.7.0_21 Windows x64 and as described upgrading to latest jdk fixed it. – Syed Ali May 01 '15 at 14:15
  • how can i apply first work around.I tried @learner solution,but its not working.. – The PowerHouse Sep 28 '15 at 11:53
  • @mcapatna Your problems will disappear when you start using the latest version of Java. No need for work-arounds! – Guus Sep 28 '15 at 12:12
  • @Guus where i have to put the latest version of java.in eclipse build path or while selecting the JRE for web-logic domain – The PowerHouse Sep 29 '15 at 18:16
2

One work around that worked for me is adding the following entry in the tomcat/conf/web.xml:

<init-param> 
   <param-name>suppressSmap</param-name> 
   <param-value>true</param-value> 
</init-param>
sumit dugar
  • 121
  • 1
  • 6
1

If you can determine the class that is causing the problem you should be able to use Stripper to remove the debug extension information from that one class and still be able to debug the rest.

Jon Strayer
  • 2,058
  • 2
  • 20
  • 40
0

I faced exactly the same error. This error will be reported only when I start Tomcat in debug mode, and for certain JSP file (large size). When I start Tomcat in normal mode (not using Debug) then the error is cleared. This error started to show recently, after the JSP file increased in size over time.

The only way I was able to resolve this error is to upgrade Tomcat from version 5.5 to version 7.0, and JRE to jdk1.7.

See the snapshot below to help you get the picture.

enter image description here

Also, don't forget to add the needed libraries required for Tomcat 7 and the new JRE.

Initially, updating the file web.xml to include the following section would solve the problem, but recently it is no longer working:

    <init-param>
            <param-name>mappedfile</param-name>
            <param-value>false</param-value>
    </init-param>
tarekahf
  • 738
  • 1
  • 16
  • 42
-1

Pointing to Jdk7 and increasing Java heap size to 1024 solved the issue.

update setDomainEnv.cmd to reflect following values.

JAVA Memory arguments: -Xms128m -Xmx3072m -XX:CompileThreshold=8000 -XX:PermSize=1024m -XX:MaxPermSize=1024m . WLS Start Mode=Development . CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_oepe1050\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_4\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar . PATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\native;C:\Oracle\MIDDLE~1\patch_oepe1050\profiles\default\native;C:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\native;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_4\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_4\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Cloud Foundry;C:\Program Files\PuTTY\;C:\Program Files\TortoiseGit\bin;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\Git\cmd;D:\nodejs\;C:\Program Files (x86)\Webex\Webex\Applications;C:\WINDOWS\System32\OpenSSH\;C :\Users\181443\AppData\Roaming\npm;C:\Users\181443\AppData\Local\Microsoft\WindowsApps;C:\Users\181443\AppData\Local\Programs\Microsoft VS Code\bin;;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8 .