weblogic服务器上类或者方法找不到的解决办法
2014-05-08 11:24
363 查看
下面以eclipse-birt(报表)为例,介绍这种问题出现的原因以及解决之道:
分析比较好的见:http://developer.actuate.com/community/forum/index.php?/topic/9315-exception-javalangnosuchmethoderror/
1>现象:
2>原因:
3>解决:
另外一篇比较好的文章: http://blog.csdn.net/hhb200766/article/details/7818142
在WEB-INF目录下新建weblogic-application.xml文件
<?xml version="1.0" ?>
<weblogic-application>
<prefer-application-packages>
<package-name>antlr.*</package-name>
</prefer-application-packages>
</weblogic-application>
在weblogic.xml文件中插入一段配置:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
针对我自己的这个应用,也是参照上面的解决办法的,具体如下:
config是我自己的一个web应用
在WEB-INF目录下新建一个 application.xml 和 weblogic-application.xml文件,这两个文件的内容是一模一样的,估计只需要一个,至于哪一个可以再尝试我这里就把两个文件都保留着,这两个文件的内容如下:
紧接着在 weblogic.xml文件中修改一个配置,设置为true
最后重启应用即可.
分析比较好的见:http://developer.actuate.com/community/forum/index.php?/topic/9315-exception-javalangnosuchmethoderror/
1>现象:
I could run report as stand alone, but while I am trying to use report engine in weblogicI am getting following error. java.lang.NoSuchMethodError: org.mozilla.javascript.ImporterTopLevel.initStandardObjects(Lorg/mozilla/javascript/Context;Z)V root cause: java.lang.NoSuchMethodError: org.mozilla.javascript.ImporterTopLevel.initStandardObjects(Lorg/mozilla/javascript/Context;Z)V org.eclipse.birt.core.script.ScriptContext.(ScriptContext.java:80) org.eclipse.birt.core.script.ScriptContext.(ScriptContext.java:67) org.eclipse.birt.report.engine.executor.ExecutionContext.(ExecutionContext.java:295) org.eclipse.birt.report.engine.api.impl.EngineTask.(EngineTask.java:137) org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.(RunAndRenderTask.java:62) org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.createRunAndRenderTask(ReportEngineHelper.java:292) org.eclipse.birt.report.engine.api.impl.ReportEngine.createRunAndRenderTask(ReportEngine.java:299) com.teamcenter.project.birt.servlet.WebReport.doGet(WebReport.java:90) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.teamcenter.project.servlet.LoginTimerFilter.doFilter(LoginTimerFilter.java:74) com.teamcenter.project.servlet.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:50)
2>原因:
The problem is because the application server contains a older version of Rhino's js.jar, while BIRT uses the latest version (1.6RC1). Because the js.jar in the application server is loaded before the one in BIRT, the older version of class org.mozilla.javascript.Context is loaded. Since the older version of class org.mozilla.javascript.Context doesn't contain function initStandardObjects, a runtime java.lang.NoSuchMethodError happened. To solve this kind of problem, the application server usually provides a configuration to allow loading application's java classes before the app server's.
3>解决:
the conflict was between Weblogic Application Server and BIRT library, in weblogic-application.xml we have added the following configuration which has resolved the issue. Configuration: <prefer-application-packages> <package-name>org.mozilla.*</package-name> </prefer-application-packages>
另外一篇比较好的文章: http://blog.csdn.net/hhb200766/article/details/7818142
在WEB-INF目录下新建weblogic-application.xml文件
<?xml version="1.0" ?>
<weblogic-application>
<prefer-application-packages>
<package-name>antlr.*</package-name>
</prefer-application-packages>
</weblogic-application>
在weblogic.xml文件中插入一段配置:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
针对我自己的这个应用,也是参照上面的解决办法的,具体如下:
config是我自己的一个web应用
在WEB-INF目录下新建一个 application.xml 和 weblogic-application.xml文件,这两个文件的内容是一模一样的,估计只需要一个,至于哪一个可以再尝试我这里就把两个文件都保留着,这两个文件的内容如下:
<?xml version="1.0"?> <weblogic-application> <prefer-application-packages> <package-name>org.mozilla.*</package-name> </prefer-application-packages> </weblogic-application>
紧接着在 weblogic.xml文件中修改一个配置,设置为true
<?xml version="1.0" encoding="UTF-8"?> <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd"> <wls:context-root>/config</wls:context-root> <wls:charset-params> <wls:input-charset> <wls:resource-path>/*</wls:resource-path> <wls:java-charset-name>UTF-8</wls:java-charset-name> </wls:input-charset> </wls:charset-params> <wls:container-descriptor> <!-- yangw change false to true --> <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes> </wls:container-descriptor> </wls:weblogic-web-app>
最后重启应用即可.
相关文章推荐
- 解决:AMQ应用部署到weblogic服务器上出现“找不到匹配的方法setLifo"
- 执行mount命令时找不到介质或者mount:no medium found的解决办法
- 关于hosts文件找不到或者被删除的解决办法。
- java 在类中找不到main方法的解决办法
- IBM X3650 M3 服务器安装linux找不到磁盘的解决办法
- 关于新建管理员账户后不能显示或者找不到登录默认管理员账户的解决办法
- VC 通过ODBC连接sql2005 在 sys.servers 中找不到服务器的解决方法,请执行 sp_addlinkedserver 将该服务器添加到 sysservers问题详解
- “无法连接到打印机。您输入的打印机名不正确 或者指定的打印机没有连接到服务器上”终极解决方法
- vmvare虚拟机 执行mount命令时找不到介质或者mount:no medium found的解决办法
- sqlserver复制报”应用复制的命令时在订阅服务器上找不到该行“解决方法
- 安装scipy或者numpy时弹出python2.7 was not found in the registry 的解决办法: python的注册与注销方法
- FloatMath.sqrt 方法找不到 不支持 解决办法
- 关于weblogic服务器集群后,部分数出现乱码问题,解决办法 如下
- windows7服务器上weblogic启动失败异常解决方法
- apache 服务器外网用ip访问,路径找不到的解决方法
- weblogic忘记用户名或者密码的解决方法
- 关于安装mysql 5.7时遇到的默认root无法登陆或者找不到data文件夹的问题的一些解决办法
- 执行mount命令时找不到介质或者mount:no medium found的解决办法
- 客户端连接服务器,配置出错“连接超时”或者“无监听程序”解决方法
- 解决方法:操作无法完成。键入的打印机名不正确,或者指定的打印机没有连接到服务器上。