http://blog.itpub.net/9399028/viewspace-692974/

以前用weblogic低版本的时候,感觉挺容易的,也没什么要注意的,这次真正把应用从websphere迁移到weblogic下后,发现问题还是真多了。
 

系统采用war包的方式部署。

问题一:

####<2011-3-29 下午05时17分43秒 CST> <Info> <ServletContext-/MIS-beta-4.0.37> <javasvr> <AdminServer> <[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <> <1301390263593> <BEA-000000> <Loading Spring root WebApplicationContext>

####<2011-3-29 下午05时17分46秒 CST> <Warning> <HTTP> <javasvr> <AdminServer> <[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1301390266609> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext_Hibernate.xml]: Initialization of bean failed; nested exception is java.io.FileNotFoundException: class path resource [com/edu/nts/entity] cannot be resolved to absolute file path because it does not reside in the file system: zip:D:/soft/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/MIS-437/lhcsnh/war/WEB-INF/lib/_wl_cls_gen.jar!/com/edu/nts/entity.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext_Hibernate.xml]: Initialization of bean failed; nested exception is java.io.FileNotFoundException: class path resource [com/edu/nts/entity] cannot be resolved to absolute file path because it does not reside in the file system: zip:D:/soft/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/MIS-437/lhcsnh/war/WEB-INF/lib/_wl_cls_gen.jar!/com/edu/nts/entity

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:370)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)

at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)

at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)

at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1799)

at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)

at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)

at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)

at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)

at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)

at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:40)

at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)

at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)

at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)

at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

java.io.FileNotFoundException: class path resource [com/edu/nts/entity] cannot be resolved to absolute file path because it does not reside in the file system: zip:D:/soft/Middleware/user_projects/domains/my_domain/servers/AdminServer/tmp/_WL_user/MIS-437/lhcsnh/war/WEB-INF/lib/_wl_cls_gen.jar!/com/edu/nts/entity

at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:173)

at org.springframework.core.io.ClassPathResource.getFile(ClassPathResource.java:169)

at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:676)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)

at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)

at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)

at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1799)

at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)

at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)

at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)

at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)

at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)

at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:40)

at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)

at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)

at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)

at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

>

原因:

在weblogic上部署war包的话,默认是不展开的,所以如下的hibernate配置不能解析。

<bean id="sessionFactory"

class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="mappingDirectoryLocations">

<list>

<value>classpath:/com/edu/nts/entity</value>

</list>

</property>

</bean>

解决办法:

针对weblogic的部署方式,必须改为如下方式。

<bean id="sessionFactory"

class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="mappingResources">

<list>

<value>com/edu/nts/entity/AidStudentInfo.hbm.xml</value>

<value>com/edu/nts/entity/AidStudentList.hbm.xml</value>

<value>com/edu/nts/entity/AidStudentListTemp.hbm.xml</value>

。。。

</list>

</bean>

虽然没法偷懒用上面的注入方式,但还是可以通过编写一个小程序生成上面的明细注入片段,修改量不会太大。

问题二:

<2011-3-29 下午05时19分46秒 CST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1303283427671' for task '1'. Error is: 'weblogic.application.ModuleException: [HTTP:101216]Servlet: "log4j" failed to preload on startup in Web application: "MIS-beta-4.0.38.war".

java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded

at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:92)

java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded

at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:92)

at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)

at org.springframework.web.util.Log4jConfigServlet.init(Log4jConfigServlet.java:58)

at javax.servlet.GenericServlet.init(GenericServlet.java:241)

at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)

at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)

at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)

at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)

at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1913)

at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1887)

at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1805)

at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)

at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)

at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)

at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)

at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)

at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:40)

at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)

at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)

at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)

at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

'

weblogic.application.ModuleException: [HTTP:101216]Servlet: "log4j" failed to preload on startup in Web application: "MIS-beta-4.0.38.war".

java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded

at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:92)

at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)

at org.springframework.web.util.Log4jConfigServlet.init(Log4jConfigServlet.java:58)

at javax.servlet.GenericServlet.init(GenericServlet.java:241)

at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)

at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)

at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)

at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)

at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1913)

at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1887)

at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1805)

at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)

at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)

at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)

at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)

at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)

at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)

at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

原因:

在web.xml中log4j的配置方式问题,默认情况log4j.properties放在classes目录下,而由于war没展开,找不到这个文件,所以把它直接放WEB-INF目录下,并去掉原来web.xml里面的如下配置:

<servlet>

<servlet-name>log4j</servlet-name>

<servlet-class>

org.springframework.web.util.Log4jConfigServlet

</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

解决办法:

新建一个servlet,初始化log4j配置文件:

public void init() throws ServletException {

InputStream is = getServletContext().getResourceAsStream(

"/WEB-INF/log4j.properties");

Properties props = new Properties();

try {

props.load(is);

} catch (IOException e) {

System.err.println("Load log4j configuration failed");

}

PropertyConfigurator.configure(props);

}

并注册到web.xml文件中:

<servlet>

<servlet-name>Log4jInitServlet</servlet-name>

<servlet-class>com.edu.nts.web.servlet.Log4jInitServlet</servlet-class>

<load-on-startup>0</load-on-startup>

</servlet>

问题三:

由于种种原因,该应用程序必须部署到服务器的根目录(/)下面,否则样式及功能都会出现问题。

解决办法:

为了把应用程序的context root改到根目录,创建了一个weblogic.xml文件,放到war包的WEB-INF目录下,内容如:

<?xml version="1.0" encoding="UTF-8"?>

<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.0/weblogic-web-app.xsd">

<weblogic-version>10.3.2</weblogic-version>

<context-root>/</context-root>

</weblogic-web-app>

问题四:

打开登录页面报错,后台错误如下:

####<2011-4-2 下午06时00分11秒 CST> <Info> <ServletContext-> <javasvr> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1301738411265> <BEA-000000> <redirect.jsp:1:1: The validator class: "org.apache.taglibs.standard.tlv.JstlCoreTLV" has failed with the following exception: "java.lang.ClassCastException: weblogic.xml.jaxp.RegistrySAXParserFactory cannot be cast to javax.xml.parsers.SAXParserFactory".

<%@ page language="java" pageEncoding="UTF-8"%>

^---------------------------------------------^

redirect.jsp:1:1: The validator class: "org.apache.taglibs.standard.tlv.JstlFmtTLV" has failed with the following exception: "java.lang.ClassCastException: weblogic.xml.jaxp.RegistrySAXParserFactory cannot be cast to javax.xml.parsers.SAXParserFactory".

<%@ page language="java" pageEncoding="UTF-8"%>

^---------------------------------------------^

>

原因:jar包冲突,以及jar包加载顺序的问题引起

解决办法:

删除lib目录下的xml-apis.jar,并在上面的weblogic.xml中增加如下:

<container-descriptor>

<prefer-web-inf-classes>true</prefer-web-inf-classes>

</container-descriptor>

使classloader首先加载web-info下的jar文件,修改后的weblogic.xml如下:

<?xml version="1.0" encoding="UTF-8"?>

<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.0/weblogic-web-app.xsd">

<weblogic-version>10.3.2</weblogic-version>

<context-root>/</context-root>

<container-descriptor>

<prefer-web-inf-classes>true</prefer-web-inf-classes>

</container-descriptor>

</weblogic-web-app>

问题五:

部署应用程序过程中,报如下错误:

####<2011-4-2 下午09时35分56秒 CST> <Info> <Deployer> <javasvr> <AdminServer> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <> <1301751356796> <BEA-149038> <Initiating Task for jdbc.orcl : [Deployer:149026]activate application jdbc.orcl on myCluster.>

####<2011-4-2 下午09时35分57秒 CST> <Warning> <Deployer> <javasvr> <AdminServer> <[STANDBY] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1301751357265> <BEA-149004> <Failures were detected while initiating activate task for application 'jdbc.orcl'.>

####<2011-4-2 下午09时35分57秒 CST> <Warning> <Deployer> <javasvr> <AdminServer> <[STANDBY] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1301751357265> <BEA-149078> <Stack trace for message 149004

weblogic.application.ModuleException:

at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:350)

at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)

at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)

at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)

at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)

at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:40)

at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)

at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:407)

at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.commit(DeploymentReceiverCallbackDeliverer.java:63)

at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.callDeploymentReceivers(AwaitingCommit.java:235)

at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.handleCommit(AwaitingCommit.java:131)

at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.receivedCommit(AwaitingCommit.java:44)

at weblogic.deploy.service.internal.transport.CommonMessageReceiver.receiveRequestCommitMsg(CommonMessageReceiver.java:510)

at weblogic.deploy.service.internal.transport.CommonMessageReceiver$3.run(CommonMessageReceiver.java:782)

at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

weblogic.common.ResourceException: Failed to bind remote object (ClusterableRemoteRef(-4790033318770968615S::my_domain:Server-0 null)/287         [weblogic.jdbc.common.internal.RemoteDataSource]) to replica aware stub at orcl(ClusterableRemoteRef(-4790033318770968615S::my_domain:Server-0 [-4790033318770968615S::my_domain:Server-0/286])/286 [weblogic.jdbc.common.internal.RemoteDataSource])

at weblogic.jdbc.common.internal.RmiDataSource.start(RmiDataSource.java:395)

at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:136)

at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:97)

at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:347)

at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)

at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)

at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)

at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)

at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)

at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)

at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:40)

at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)

at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)

at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)

at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)

at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:407)

at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)

at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.commit(DeploymentReceiverCallbackDeliverer.java:63)

at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.callDeploymentReceivers(AwaitingCommit.java:235)

at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.handleCommit(AwaitingCommit.java:131)

at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingCommit.receivedCommit(AwaitingCommit.java:44)

at weblogic.deploy.service.internal.transport.CommonMessageReceiver.receiveRequestCommitMsg(CommonMessageReceiver.java:510)

at weblogic.deploy.service.internal.transport.CommonMessageReceiver$3.run(CommonMessageReceiver.java:782)

at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

>

原因:

配置的weblogic连接池名称命民规则问题。

解决办法:

由于数据源的jndi为:jdbc/orcl,数据源的名称必须为jdbc.orcl,否则就会报上面的类似错误。

问题六:

错误信息忘记了,页面访问报编译错误。

原因:

类似如下的jstl判断语法不能正确解析,真是奇怪

${changeForm.change.oldVal == 1 ? 男 : changeForm.change.oldVal ==0?女:’’}

解决办法:

采用choose语法修改为如下

<c:choose>

<c:when test="${ changeForm.change.oldVal ==1}">男</c:when>

<c:when test="${ changeForm.change.oldVal ==0}">女</c:when>

<c:otherwise></c:otherwise>

</c:choose>

问题七:

getServletContext().getRealPath("/upload");返回为null的问题。

原因:

由于weblogic下,war没有展开,所以也就不存在相对于应用程序的路径realpath。

解决办法:

若是为了得到相对路径,采用以下方式

getServletContext().getResource("/upload").getPath();

若是为了加载资源文件,则采用如下方式

InputStream is = getServletContext().getResourceAsStream(

"/WEB-INF/log4j.properties");

Properties props = new Properties();

try {

props.load(is);

} catch (IOException e) {

System.err.println("Load log4j configuration failed");

}

PropertyConfigurator.configure(props);

问题八:

采用jquery的方式异步请求后台数据,后台采用PrintWriter返回结果,结果页面不能正确加载数据。

原因:

PrintWriter writer = (PrintWriter) response.getWriter();

writer.write("failure");

writer.close();

以上close之前,少了一句

PrintWriter writer = (PrintWriter) response.getWriter();

writer.write("failure");

writer.flush();

writer.close();

从websphere6.1迁移到weblogic10.3的问题总结--转的更多相关文章

  1. 从websphere6.1迁移到weblogic10.3的问题总结

     系统采用war包的方式部署. 问题一: ####<2011-3-29 下午05时17分43秒 CST> <Info> <ServletContext-/MIS-be ...

  2. jboss eap 6.4 部署 从weblogic迁移

    从weblogic10.3像jboss 6.4项目迁移,遇到的一些问题: 因为使用weblogic可以自定义公共的war包库,在使用jboss中,也采取项目依赖公共库的方式: 1.jboss中使用公共 ...

  3. tomcat迁移到weblogic的几个问题

    第1个问题: 异常描述:VALIDATION PROBLEMS WERE FOUND problem: cvc-enumeration-valid: string value '3.0' is not ...

  4. 基于本地存储的kvm虚拟机在线迁移

    基于本地存储的kvm虚拟机在线迁移 kvm虚拟机迁移分为4种(1)热迁移基于共享存储(2)热迁移基于本地存储(3)冷迁移基于共享存储(4)冷迁移基于本地存储 这里介绍的是基于本地存储的热迁移 动态块迁 ...

  5. 【SQLServer】记一次数据迁移-标识重复的简单处理

    汇总篇:http://www.cnblogs.com/dunitian/p/4822808.html#tsql 今天在数据迁移的时候因为手贱遇到一个坑爹问题,发来大家乐乐,也传授新手点经验 迁移惯用就 ...

  6. MVC5+EF6+MYSQl,使用codeFirst的数据迁移

    之前本人在用MVC4+EF5+MYSQL搭建自己的博客.地址:www.seesharply.com;遇到一个问题,就是采用ef的codefirst模式来编写程序,我们一般会在程序开发初期直接在glob ...

  7. 烂泥:wiki系统confluence5.6.6安装、中文、破解及迁移

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb confluence是一个专业的企业知识管理与协同软件,可以用于构建企业wiki.通过它 ...

  8. ASP.NET Aries 2.0 发布(原来的源码SVN已关闭,开源源码已迁移到GitHub)

    主要更新: 1:增加子目录部署支持. 2:增加Taurus.MVC支持. 3:优化及Bug修复. 1:增加子目录部署支持: 其实在重写Aries框架的时候,我是去掉了目录部署功能的,主要是为了加快Ar ...

  9. 我将系统从Windows迁移至Linux下的点点滴滴

    一.写在最前 由于本人的技术水平有限,难免会出现错误.本文对任何一个人有帮助都是我莫大的荣幸,任何一个大神对我的点拨,我都会感激不尽. 二.技术选型 在2013年8月低的时候,公司中了XXX市场监督局 ...

随机推荐

  1. Android-bindService远程服务启动其他应用的Activity

    Service2应用,在AndroidManifest.xml文件中对外暴露MyService2服务: <!-- 代表在应用程序里,当需要该service时,会自动创建新的进程. android ...

  2. windows包管理工具和 ssh安装

    Chocolatey windows下的包管理工具 https://chocolatey.org/ cmd里执行 @"%SystemRoot%\System32\WindowsPowerSh ...

  3. Verilog MIPS32 CPU(七)-- DIV、DIVU

    Verilog MIPS32 CPU(一)-- PC寄存器 Verilog MIPS32 CPU(二)-- Regfiles Verilog MIPS32 CPU(三)-- ALU Verilog M ...

  4. 零成本实现WEB性能测试(二)JMeter基础知识

    特点: 支持多种服务类型进行测试,包括: Web-Http,HTTPS SOAP Database via JDBC LDAP JMS Mail-POP3 & IMAP 支持录制回放方式获取脚 ...

  5. [bzoj3714] [PA2014] Kuglarz(最小生成树)

    我们考虑这个题...思路比较神仙. 就是我们设\(sum[i]\)为前i个的区间里的情况,然后我们知道\(sum[j]\)的话,我们就可以知道\(j-i\)的情况了 所以说这很像最小生成树里面的约束条 ...

  6. python 特性:height-->while

    """ 出题:height 女生找对象 男生在1米-1.5米之间 小强你在哪里? 男生在1.5-1.7米之间 没有安全感 男生在1.7 - 1.8米之间 帅哥 留个电话 ...

  7. dbproxy-user/pwd

    dbproxy 的账号是统一的, 即连接dbproxy,连接主mysql ,连接从mysql 的账号必须一样, 为了隔离 即使用dbproxy的人感知不到mysql, 需要分离 配置文件 #dbpro ...

  8. 程序设计中的dry原则

    DRY:dont repeat yourself 假设一个逻辑(代码块)会重复两次或者以上,应该写成函数被调用 为什么呢,实际上,我们处处可见重复性的代码.这除了增加工作量之外,还会增加维护难度. d ...

  9. 搭建gogs

    https://blog.csdn.net/hwm_life/article/details/82969005 服务器环境 CentOS 7 64位 安装Gogs所需的其它环境 需要安装的依赖有Ngi ...

  10. MODBUS协议相关代码(CRC验证 客户端程序)

    Modbus协议是一种已广泛应用于当今工业控制领域的通用通讯协议.通过此协议,控制器相互之间.或控制器经由网络(如以太网)可以和其它设备之间进行通信.Modbus协议使用的是主从通讯技术,即由主设备主 ...