公司服务器用的jboss4.0.5,项目运行正常,我把项目下载下来在本地jboss运行报错,用的也是4.0.5(其它的5,6,7也试过了报一样的错误),具体报错如下:org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 150 in the jsp file: /index.jsp
Generated servlet error:
The type Iterator is not generic; it cannot be parameterized with arguments <SysMenu>An error occurred at line: 150 in the jsp file: /index.jsp
Generated servlet error:
Syntax error, parameterized types are only available if source level is 5.0 求指点,谢谢了!!!

解决方案 »

  1.   

    JDK版本 报告错误 是说你用了JDK1.5 一下版本!! 你看看设置好了没啊
      

  2.   

    用的是1.6呀
    C:\Documents and Settings\Administrator>java -version
    java version "1.6.0_26"
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
      

  3.   

    在tomcat运行正常 继续求解!!!!
      

  4.   

    你Tomcat都能正常跑 说明编译后应该没错! 你看看jboss/bin/run.bat 文件 里面有一段 
    if not "%JAVA_HOME%" == "" goto ADD_TOOLSset JAVA=javaecho JAVA_HOME is not set.  Unexpected results may occur.
    echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
    goto SKIP_TOOLS:ADD_TOOLSset JAVA=%JAVA_HOME%\bin\java
    你在这里 把JAVA打印出来看看
    echo "JDK Version==="%JAVA%
      

  5.   

    保证你的java_home,path,classpath 中的jdk版本都是一致。1.5以上
      

  6.   

    @echo off
    rem -------------------------------------------------------------------------
    rem JBoss Bootstrap Script for Win32
    rem -------------------------------------------------------------------------rem $Id: run.bat 56327 2006-08-28 10:34:13Z [email protected] $@if not "%ECHO%" == ""  echo %ECHO%
    @if "%OS%" == "Windows_NT"  setlocalset DIRNAME=.\
    if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
    set PROGNAME=run.bat
    if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%rem Read all command line argumentsREM
    REM The %ARGS% env variable commented out in favor of using %* to include
    REM all args in java command line. See bug #840239. [jpl]
    REM
    REM set ARGS=
    REM :loop
    REM if [%1] == [] goto endloop
    REM         set ARGS=%ARGS% %1
    REM         shift
    REM         goto loop
    REM :endlooprem Find run.jar, or we can't continueset RUNJAR=%DIRNAME%\run.jar
    if exist "%RUNJAR%" goto FOUND_RUN_JAR
    echo Could not locate %RUNJAR%. Please check that you are in the
    echo bin directory when running this script.
    goto END:FOUND_RUN_JARif not "%JAVA_HOME%" == "" goto ADD_TOOLSset JAVA=javaecho JAVA_HOME is not set.  Unexpected results may occur.
    echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
    goto SKIP_TOOLS:ADD_TOOLSset JAVA=%JAVA_HOME%\bin\javaif exist "%JAVA_HOME%\lib\tools.jar" goto SKIP_TOOLS
    echo Could not locate %JAVA_HOME%\lib\tools.jar. Unexpected results may occur.
    echo Make sure that JAVA_HOME points to a JDK and not a JRE.:SKIP_TOOLSrem Include the JDK javac compiler for JSP pages. The default is for a Sun JDK
    rem compatible distribution to which JAVA_HOME pointsset JAVAC_JAR=%JAVA_HOME%\lib\tools.jarrem If JBOSS_CLASSPATH is empty, don't include it, as this will 
    rem result in including the local directory, which makes error tracking
    rem harder.
    if "%JBOSS_CLASSPATH%" == "" (
    set JBOSS_CLASSPATH=%JAVAC_JAR%;%RUNJAR%
    ) else (
    set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JAVAC_JAR%;%RUNJAR%
    )rem Setup JBoss specific properties
    set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME%
    set JBOSS_HOME=%DIRNAME%\..rem Add -server to the JVM options, if supported
    "%JAVA%" -version 2>&1 | findstr /I hotspot > nul
    if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server)rem JVM memory allocation pool parameters. Modify as appropriate.
    set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512mrem With Sun JVMs reduce the RMI GCs to once per hour
    set JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
    rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%rem Setup the java endorsed dirs
    set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsedecho ===============================================================================
    echo.
    echo   JBoss Bootstrap Environment
    echo.
    echo   JBOSS_HOME: %JBOSS_HOME%
    echo.
    echo   JAVA: %JAVA%
    echo.
    echo   JAVA_OPTS: %JAVA_OPTS%
    echo.
    echo   CLASSPATH: %JBOSS_CLASSPATH%
    echo.
    echo ===============================================================================
    echo.:RESTART
    "%JAVA%" %JAVA_OPTS% "-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%" -classpath "%JBOSS_CLASSPATH%" org.jboss.Main %*
    if ERRORLEVEL 10 goto RESTART:END
    if "%NOPAUSE%" == "" pause:END_NO_PAUSE