当前位置: 代码迷 >> Web前端 >> light-portal分析(2)部署weblogic9.2
  详细解决方案

light-portal分析(2)部署weblogic9.2

热度:649   发布时间:2012-10-24 14:15:58.0
light-portal分析(二)部署weblogic9.2
light-portal分析(二)部署weblogic9.2

部署到weblogic9.2不兼容
问题一
启动报错:
An error occurred during activation of changes, please see the log for details.
[HTTP:101216]Servlet: "Connector" failed to preload on startup in Web application: "easylightportal.war". java.lang.NullPointerException at java.io.File.<init>(File.java:222) at net.fckeditor.connector.ConnectorServlet.init(ConnectorServlet.java:82) 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(Unknown Source)
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:1893)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1870)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1790)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468)
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:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
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:820)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
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.lang.NullPointerException:

解决问题:
fckeditor的BUG,将2.4.1的版本升级为2.5
web.xml修改为:
<servlet>
<servlet-name>ConnectorServlet</servlet-name>
<servlet-class>net.fckeditor.connector.ConnectorServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ConnectorServlet</servlet-name>
<!-- Do not wrap this line otherwise Glassfish will fail to load this file -->
<url-pattern>/fckeditor/editor/filemanager/connectors/*</url-pattern>
</servlet-mapping>

重启报错:
[HTTP:101216]Servlet: "ConnectorServlet" failed to preload on startup in Web application: "easylightportal.war".
java.lang.NullPointerException: The real context root cannot be resolved against the local filesystem
at net.fckeditor.connector.impl.ContextConnector.init(ContextConnector.java:73)
at net.fckeditor.connector.Dispatcher.<init>(Dispatcher.java:86)
at net.fckeditor.connector.ConnectorServlet.init(ConnectorServlet.java:60)
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(Unknown Source)
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:1893)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1870)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1790)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468)
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)

仙人板板,说fckeditor在2.5版本解决这个问题。但是不得行。搞了一上午,想弄人。
算了,采用网上一个人提的意见,下载2.5的源码,,找到代码
E:\book\opensource\fckeditor\fckeditor-java-2.5\java-core\src\main\java\net\fckeditor\connector\impl\ContextConnector.java
增加方法:
protected String getRealUserFilesAbsolutePathSuiteWeblogic(String userFilesAbsolutePath){
URL   u = null;
String w_p = "";
try {
            u = servletContext.getResource(userFilesAbsolutePath);
            w_p = u.getPath();
      } catch (MalformedURLException e) {
            e.printStackTrace();
      }
      return w_p;
}
修改上面的调用为这个新写的方法:
String defaultAbsolutePath = getRealUserFilesAbsolutePathSuiteWeblogic(PropertiesLoader
     .getUserFilesPath());
就在这个目录E:\book\opensource\fckeditor\fckeditor-java-2.5\java-core
调用命令mvn clean
            mvn install
打出新的包命名为2.5.1版本
pom.xml写为:
<dependency>
<groupId>net.fckeditor</groupId>
<artifactId>java-core</artifactId>
<version>2.5.1</version>
</dependency>

问题二
访问首页后报错:
<2009-9-15 上午11时48分58秒 CST> <Error> <HTTP> <BEA-101020> <[weblogic.servlet.
internal.WebAppServletContext@d0b21b - appName: 'easylightportal', name: 'easyli
ghtportal.war', context-path: '/easylightportal', spec-version: 'null'] Servlet
failed with Exception
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select org from org.light.portal.model.Organization org where org.virtualH
ost='localhost']
        at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:80)
        at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
        at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:54)
        at antlr.CharScanner.<init>(CharScanner.java:51)
        at antlr.CharScanner.<init>(CharScanner.java:60)
        Truncated. see log file for complete stacktrace

解决方法:
拷贝antlr-2.7.6.jar到D:\bea\wlserver_10.3\server\lib
修改%mydomain%\bin\startWebLogic.cmd,
本机就是D:\bea\user_projects\domains\icpmis\bin\startWebLogic.cmd
修改如下:
set PRE_CLASSPATH=%WL_HOME%\server\lib\antlr-2.7.6.jar; #增加PRE_CLASSPATH配置
set CLASSPATH=%SAVE_CLASSPATH%    
set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%          #添加到CLASSPATH中
  相关解决方案