【Java】weblogic9.2 + myeclipse 部署时要注意的几点

 1、JDK的选用
weblogic9.2版本所使用的jdk为jdk150_12,如果项目中使用jdk1.6的话,就只能访问到 http://localhost:7001/console
而进入项目后会报Error 404或500错误,而项目本身在tomcat或其他应用服务器是没有问题的。
这时就需要将weblogic9.2所使用的jdk与IDE工具安装的jdk统一为1.5的,也可以使用weblogic自带的jdk。

注:确保所有的jar存在 还有 E:\bea9\weblogic92\server\lib\weblogic.jar存在 否则主页可能报404错误

2、autodeploy
1) 要先启动服务,在部署项目,自动部署才会起效。
2) 自动部署的项目删除后,再重新部署部署不成功,报访问null错误,且在console中无法删除自动部署的文件
 这时找到user_projects\domains\base_domain\config 目录,在这个目录下有个config.xml 文件,在文件中找到自动部署的项目
 如下所示,将其删掉,同时将user_projects\domains\base_domain\config\deployments目录下自动部署的那个文件夹删除即可。
 
 <app-deployment>
    <name>_appsdir_TEST_dir</name>
    <target>AdminServer</target>
    <module-type>war</module-type>
    <source-path>autodeploy\TEST</source-path>
    <security-dd-model>DDOnly</security-dd-model>
    <staging-mode>nostage</staging-mode>
  </app-deployment>
 
3)自动部署时,weblogic不识别应用程序,报如下错误(按下面的这种方式,还没解决问题!)
DeploymentException:[J2EE:160177]The application at "C:\bea\user_projects\domains\registry\autodeploy\registry"
 was not recognized as a valid application type. If this is an EAR file, please ensure the META-INF/application.xml exists.
  EJB-JARs should have a META-INF/ejb-jar.xml or corresponding annotations exist. If this is an exploded WAR,
  the name of directory must be end with ".war". RARs require a META-INF/ra.xml. A JMS deployment should be an XML file
  whose name ends with "-jms.xml". A JDBC deployment should be an XML file whose name ends with "-jdbc.xml".
  For other application types, please consult the WebLogic Server documentation.'

解决方法:
首先启动服务器,然后在ser_projects\domains\base_domain\config\config.xml文件中添写要自动部署的项目,如下所示
<app-deployment>
    <name>_appsdir_TEST_dir</name>
    <target>AdminServer</target>
    <module-type>war</module-type>
    <source-path>autodeploy\TEST</source-path>
    <security-dd-model>DDOnly</security-dd-model>
    <staging-mode>nostage</staging-mode>
  </app-deployment>
 
并同时在user_projects\domains\base_domain\config\deployments新建一个空的文件夹,名称为_appsdir_TEST_dir

 

然后再myeclipse中重新部署一下工程。

==============================================================================================

<BEA-160197>

<Unable to load descriptor C:\bea\user_projects\domains\base_domain\.\autodeploy\demo/WEB-INF/web.xml of module webProject. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed

at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor

Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=web-app@http://java.sun.com/xml/ns/javaee

at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType

......

原来是weblogic92不支持用eclipse自动生成2.5版本的web.xml

我把原来的:

<web-app version="2.5"

                       xmlns="http://java.sun.com/xml/ns/javaee"

                       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">

换成:

<web-app xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">

再重新部署后启动,o了!!

=====================================================================================

解决Unsupported major.minor version 49.0问题(转)关键字: unsupported

原地址

、解决办法:
1. java -version 看显示的JDK版本
2.path查看所有的路径设置(可以在所有路径中使用java关键词进行搜索),如:本人IBM笔记本,自动安装jdk1.4,c:\Windows\system32下有java.exe等命令。在控制面板:删除和添加程序中找到并删除即可。
3. 查看注册表,修改注册表HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft下的关于1.4的jre和jvm的路径信息改为1.5的jdk的即可。

英文介绍(转载):
Each java class has a version stamp, older versions have lower numbers. The JVM is backward compatible, so older classes also run in a newer JVM. Version ranges are as follows:

Java 1.1 platform: 45.3-45.65535
Java 1.2 platform: 45.3-46.0
Java 1.3 platform: 45.3-47.0
Java 1.4 platform: 45.3-48.0

Java 5 class files are stamped with 49.0, and the JVM is also backward compatible. So, a 1.3 class file will run in a 1.5 JVM, but not the other way round. That's the reason for the original problem. None of us would be able to run Struts in an 1.4 or 1.5 JVM if it were otherwise, as the binaries are 1.3 versions, IIRC. Apart from that, Sun has been very careful when it comes to JVM version compatibility, much more than in other parts,
Serialization would be a prominent example here. IIRC there were no changes to the class format in 1.2 and 1.3, possibly including 1.1 even. The changes made in 1.5 were mostly required by the extended type system (Generics | 'type erasure'). Another aspect of backward compatibility is the usage of features in the Foundation Classes; this lib has steadily grown over the years. If a class files has dependencies on other
classes only available in a more recent version, trying to do so will end up in a ClassNotFound exception, but thats just what is to be expected. An example for that would be Tomcat 5.5: normally, it requires Java 5, but you can install a compatibility package that provides the missing features and makes it run in a 1.4 setup.

文章链接:http://hi.baidu.com/lzycsd/blog/item/204f730f98fa6c386059f37d.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值