Weblogic12c  兼容性问题汇总_Tomcat, WebLogic及J2EE讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Tomcat, WebLogic及J2EE讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3052 | 回复: 0   主题: Weblogic12c  兼容性问题汇总        下一篇 
zhang.chen
注册用户
等级:少校
经验:1145
发帖:69
精华:1
注册:2013-10-31
状态:离线
发送短消息息给zhang.chen 加好友    发送短消息息给zhang.chen 发消息
发表于: IP:您无权察看 2014-5-29 9:23:33 | [全部帖] [楼主帖] 楼主

Weblogic12c (12.1.2) 兼容性问题汇总

    Weblogic部署应用发现了一些新问题总结如下:

1〉JDK 兼容性问题。

我们可以通过查看各个JDK版本的新特性。

a) 由于JDK1.7.0_21中对API的更改Runtime.getRuntime().exec的更改,使得参数如果有空格将不支持的问题。

Runtime.getRuntime().exec(cmd, envTokens, file1);
IllegalArgumentException :Executable name has embedded quote, split the arguments


比如:

Runtime.getRuntime().exec("C:\\My Programs\\foo.exe bar") is an attempt to launch the program"C:\\My" with the arguments"Programs\\foo.exe" and"bar". This command is likely to fail with an exception to indicate"C:\My" cannot be found.
The example Runtime.getRuntime().exec("\"C:\\My Programs\\foo.exe\" bar") is an attempt to launch the program"\"C:\\My". This command will fail with an exception to indicate the program has an embedded quote.
Applications that need to launch programs with spaces in the program name should consider using the variants ofRuntime.exec that allow the command and arguments to be specified in an array.
Alternatively, the preferred way to create operating systems processes since JDK 5.0 is usingjava.lang.ProcessBuilder. TheProcessBuilder class has a much more complete API for setting the environment, working directory and redirecting streams for the process.


如:

ProcessBuilder pb =newProcessBuilder("command","argument1","argument2");
Map<String,String> env= pb.environment();env.put("var1","value1");
Process p= pb.start();
b)Changes to RMI
From this release, the RMI property java.rmi.server.useCodebaseOnly is set totrue by default. In previous releases the default value wasfalse.
This change of default value may cause RMI-based applications to break unexpectedly. The typical symptom is a stack trace that contains ajava.rmi.UnmarshalException containing a nestedjava.lang.ClassNotFoundException.
c) Changes to Application Signing
Starting from JDK 7u21, it is recommended that all applications be signed. In addition, it is also possible to restrict signed applications to the security sandbox.
Therefore, the previous use of the term "unsigned" to mean an application that ran in the security sandbox and"signed" to mean an application that ran with extended permissions, is no longer meaningful.
Unsigned or self-signed applications may not be supported in future JDK update releases.


2〉Spring 中遇到的问题。

    1.版本兼容性的问题

Weblogic 12.1.2将只支持Spring,升级weblogic 可能需要同步升级应用框架。附Weblogic 支持Spring的版本: 

Spring Version
WLS 8.1 SP5 Spring Framework 1.2.7
WLS 9.0 Spring Framework 1.2.5
WLS 9.1 Spring Framework 1.2.6
WLS 9.2 Spring Framework 1.2.8 and 2.0.x
WLS 9.2 MP1 Spring Framework 1.2.8 and 2.0.x
WLS 9.2 MP2 Spring Framework 1.2.8 and 2.0.x
WLS 9.2 MP3 Spring Framework 1.2.8, 2.0.x, and 2.5.1
WLS 9.2 MP4 Spring Framework 1.2.8, 2.0.x, and 2.5.6
WLS 10.0 Spring Framework 1.2.8 and 2.0.x
WLS 10.3 Spring Framework 2.5.3 and up
WLS 10.3.1 Spring Framework 2.5.3 and up
WLS 10.3.2 Spring Framework 2.5.3 and up
WLS 10.3.3 Spring Framework 2.5.3 and up
WLS 10.3.4 Spring Framework 3.0
WLS 10.3.5 Spring Framework 3.0
WLS 10.3.6 Spring Framework 3.0
WLS 12.1.1 Spring Framework 3.0
WLS 12.1.2 Spring Framework 3.0.2 & 3.1.0


 2.项目中出现的nullbean问题

    这个问题主要是Spring的框架中的监听器没有加载,也就是在web.xml加载的时候就失败了Spring为web.xml中加载监听提供了两种方式,但是达到的效果是一样的。

    首先介绍Spring的监听器作用。ContextLoaderListener的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。在ContextLoaderListener中关联了ContextLoader这个类,所以整个加载配置过程由ContextLoader来完成。ContextLoader创建的是 XmlWebApplicationContext这样一个类,它实现的接口是WebApplicationContext→ConfigurableWebApplicationContext→Application- Context→BeanFactory,这样一来Spring中的所有bean都由这个类来创建。

    如果在web.xml中不写任何参数配置信息,默认的路径是/WEB-INF/application- Context.xml,在WEB-INF目录下创建的xml文件的名称必须是applicationContext.xml。如果是要自定义文件名,可以在web.xml里加入contextConfigLocation这个context参数。

    示例9-2

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext-*.xml
</param-value>
</context-param>


在 里指定相应的xml文件名,如果有多个xml文件,可以写在一起并以", "分隔。上面的applicationContext-*.xml采用通配符,比如这目录下有applicationContext-ibatis-base.xml,applicationContext-action.xml,applicationContext-ibatisdao.xml等文件,都会一同被载入。

3〉Servlet兼容性问题。

    Weblogic12c 12.1.2 支持Java EE6, 也就说全面支持Servlet3, Servlet3 的新特性,详见文档 JavaEE 6Servlet 3.0 中的新特性。

该贴被zhang.chen编辑于2014-5-29 9:25:23

该贴被zhang.chen编辑于2014-5-29 9:27:12



赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论