0

我必须在 Tomcat_6.0.35中对Alfresco 4.0进行一些远程调试。官方文档说我应该设置 env 变量

JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,地址=8082

我做到了,但它只适用于 startup.bat 。Alfresco 4.0 将 Tomcat 作为 Windows 服务启动并调用:

C:\Alfresco\tomcat\bin\tomcat6.exe //RS//alfrescoTomcat

所以我需要对此服务进行远程调试,并尝试将 Tomcat 的默认服务调用更改为:

1) c:\Alfresco\tomcat\bin\tomcat6.exe //RS//alfrescoTomcat --JvmOptions=-Xdebug;-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8082;

或者

2) c:\Alfresco\tomcat\bin\tomcat6.exe //TS//alfrescoTomcat --JvmOptions=-Xdebug;-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8082;

它成功启动了 Tomcat,我可以调试这个服务器,但是 Alfresco 4.0 抛出异常或挂起......我应该怎么做才能调试这个服务?

我的日志:

在地址监听传输 dt_socket:8082 11.04.2012 19:13:28 org.apache.catalina.core.AprLifecycleListener init INFO:已加载基于 APR 的 Apache Tomcat 本机库 1.1.20。11.04.2012 19:13:28 org.apache.catalina.core.AprLifecycleListener 初始化信息:APR 功能:IPv6 [true],sendfile [true],接受过滤器 [false],随机 [true]。11.04.2012 19:13:28 org.apache.coyote.http11.Http11AprProtocol 初始化信息:在 http-8080 上初始化 Coyote HTTP/1.1 11.04.2012 19:13:28 org.apache.coyote.ajp.AjpAprProtocol 初始化信息:正在初始化Coyote AJP/1.3 on ajp-8009 11.04.2012 19:13:29 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8443 11.04.2012 19:13:29 org.apache.catalina .startup.Catalina 加载信息:初始化在 1145 毫秒内处理 11.04.2012 19:13:29 org.apache.catalina.core。StandardService 启动信息:启动服务 Catalina 11.04.2012 19:13:29 org.apache.catalina.core.StandardEngine 启动信息:启动 Servlet 引擎:Apache Tomcat/6.0.29 11.04.2012 19:13:29 org.apache.catalina .startup.HostConfig deployDescriptor INFO:部署配置描述符 alfresco.xml 11.04.2012 19:13:30 org.apache.catalina.core.StandardContext addApplicationListener INFO:监听器“org.apache.myfaces.webapp.StartupServletContextListener”已配置为这个上下文。重复定义已被忽略。11.04.2012 19:13:32 org.apache.catalina.core.ApplicationContext 日志信息:初始化 Spring 根 WebApplicationContext 04.2012 19:13:29 org.apache.catalina.startup.HostConfig deployDescriptor INFO:部署配置描述符 alfresco.xml 11.04.2012 19:13:30 org.apache.catalina.core.StandardContext addApplicationListener INFO:监听器“org.apache .myfaces.webapp.StartupServletContextListener" 已为此上下文配置。重复定义已被忽略。11.04.2012 19:13:32 org.apache.catalina.core.ApplicationContext 日志信息:初始化 Spring 根 WebApplicationContext 04.2012 19:13:29 org.apache.catalina.startup.HostConfig deployDescriptor INFO:部署配置描述符 alfresco.xml 11.04.2012 19:13:30 org.apache.catalina.core.StandardContext addApplicationListener INFO:监听器“org.apache .myfaces.webapp.StartupServletContextListener" 已为此上下文配置。重复定义已被忽略。11.04.2012 19:13:32 org.apache.catalina.core.ApplicationContext 日志信息:初始化 Spring 根 WebApplicationContext 重复定义已被忽略。11.04.2012 19:13:32 org.apache.catalina.core.ApplicationContext 日志信息:初始化 Spring 根 WebApplicationContext 重复定义已被忽略。11.04.2012 19:13:32 org.apache.catalina.core.ApplicationContext 日志信息:初始化 Spring 根 WebApplicationContext

...

创建名为“sessionFact s 路径资源 [alfresco/hibernate-context.xml] 的 bean 时出错:调用 init 方法失败;嵌套异常是 org.hibernate.Hi bernate 方言必须显式设置 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFacto

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

gframework.beans.factory.BeanCreationException:在类路径 hibernate-context.xml 中定义名称为“transactionManager”的 bean 创建时出错]:在设置 bean 属性“sessionFactory”时无法解析对 bean“sessionFactory”的引用;org.springframework.beans.factory.BeanCreationException:在类 esco/hibernate-context.xml 中创建名称为“sessionFactory”的 bean 时出错]:调用 init 方法失败;嵌套异常是 org.hibernate.HibernateException: Hib 被显式设置 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFacto

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

gframework.beans.factory.BeanCreationException:在类路径 res rnate-context.xml 中创建名称为“sessionFactory”的 bean 时出错]:调用 init 方法失败;嵌套异常是 org.hibernate.HibernateException: Hibernate Di itly set gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.ja

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

nate.HibernateException:必须显式设置休眠方言 nate.dialect.DialectFactory.determineDialect(DialectFactory.java:59) nate.dialect.DialectFactory.buildDialect(DialectFactory.java:39) nate.cfg.SettingsFactory.determineDialect(SettingsFactory.java: 426) nate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128) nate.cfg.Configuration.buildSettings(Configuration.java:2073) nate.cfg.Configuration.buildSessionFactory(Configuration.java:1298) gframework.orm.hibernate3。 LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860) gframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779) gframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) gframework.beans.factory.support。AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.ja

org.apache.catalina.core.StandardContext listenerStart nding context initialized event to listener instance of class org.alfresco.web.app.ContextListener beans.factory.BeanCreationException: Error created bean with name 'encryptionKeysRegistry' defined in class path resour ion-context .xml]:在设置 bean 属性“transactionService”时无法解析对 bean“transactionService”的引用 org.springframework.beans.factory.BeanCreationException:在 [alfresco/core-services-context.xml ]:在设置 bean 属性时无法解析对 bean 'transactionManager' 的引用'; 嵌套异常是 org.springframework.beans.factory.BeanCreationException: Error created bean with name ' 事务类路径资源 [alfresco/hibernate-context.xml]:设置 onFactory 时无法解析对 bean 'sessionFactory' 的引用;嵌套异常是 org.springframework.beans.factory.BeanCreationException:在类路径资源 [alfresco/hibernate-context.xml] 中创建名称为 ned 的 bean 时出错:调用 init 方法失败;嵌套异常是 org.h ception:必须显式设置休眠方言 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10 factory.BeanCreationException:在类路径资源 [alfresco/hibernate-context.xml] 中创建名称为 'ned 的 bean 时出错:init 方法的调用失败;嵌套异常是 org.h ception:必须显式设置休眠方言 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10 factory.BeanCreationException:在类路径资源 [alfresco/hibernate-context.xml] 中创建名称为 'ned 的 bean 时出错:init 方法的调用失败;嵌套异常是 org.h ception:必须显式设置休眠方言 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFacto

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580

gframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:89

虽然设置 bean 正确的嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名称为“sessionFact s 路径资源 [alfresco/hibernate-context.xml] 的 bean 时出错:调用 init 方法失败;嵌套异常是 org.hibernate.Hi bernate 方言必须显式设置 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFacto

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

gframework.beans.factory.BeanCreationException:在类路径 hibernate-context.xml 中定义名称为“transactionManager”的 bean 创建时出错]:在设置 bean 属性“sessionFactory”时无法解析对 bean“sessionFactory”的引用;org.springframework.beans.factory.BeanCreationException:在类 esco/hibernate-context.xml 中创建名称为“sessionFactory”的 bean 时出错]:调用 init 方法失败;嵌套异常是 org.hibernate.HibernateException: Hib 被显式设置 gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:10

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFacto

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

gframework.beans.factory.BeanCreationException:在类路径 res rnate-context.xml 中创建名称为“sessionFactory”的 bean 时出错]:调用 init 方法失败;嵌套异常是 org.hibernate.HibernateException: Hibernate Di itly set gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.ja

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4

gframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) gframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) gframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory .java:288) gframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) gframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

nate.HibernateException:必须显式设置休眠方言 nate.dialect.DialectFactory.determineDialect(DialectFactory.java:59) nate.dialect.DialectFactory.buildDialect(DialectFactory.java:39) nate.cfg.SettingsFactory.determineDialect(SettingsFactory.java: 426) nate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128) nate.cfg.Configuration.buildSettings(Configuration.java:2073) nate.cfg.Configuration.buildSessionFactory(Configuration.java:1298) gframework.orm.hibernate3。 LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860) gframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779) gframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) gframework.beans.factory.support。AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory

gframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.ja

bind.v2.ClassFactory$1@2552fafd]) [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@5bee9e20}]) b 它当web应用被阻止了。这很可能造成内存泄漏。org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap ication [/alfresco] 创建了一个 ThreadLocal,其键类型为 [java.lang.ThreadLocal](值 [java.lang.ThreadLocal@ecf7607 pe [org.apache.cxf.bus.CXFBusImpl ] (value [org.apache.cxf.bus.CXFBusImpl@564dcd29]) 但在 web ped 时未能将其删除。这很可能会造成内存泄漏。ger.repositorySelector 可能由于类重新加载错误而为空,使用 NOPLoggerRepository.vocationTargetException W3CDomHandler=java.lang.ref.WeakReference@5bee9e20}]) b 当 Web 应用程序停止时。这很可能造成内存泄漏。org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap ication [/alfresco] 创建了一个 ThreadLocal,其键类型为 [java.lang.ThreadLocal](值 [java.lang.ThreadLocal@ecf7607 pe [org.apache.cxf.bus.CXFBusImpl ] (value [org.apache.cxf.bus.CXFBusImpl@564dcd29]) 但在 web ped 时未能将其删除。这很可能会造成内存泄漏。ger.repositorySelector 可能由于类重新加载错误而为空,使用 NOPLoggerRepository.vocationTargetException W3CDomHandler=java.lang.ref.WeakReference@5bee9e20}]) b 当 Web 应用程序停止时。这很可能造成内存泄漏。org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap ication [/alfresco] 创建了一个 ThreadLocal,其键类型为 [java.lang.ThreadLocal](值 [java.lang.ThreadLocal@ecf7607 pe [org.apache.cxf.bus.CXFBusImpl ] (value [org.apache.cxf.bus.CXFBusImpl@564dcd29]) 但在 web ped 时未能将其删除。这很可能会造成内存泄漏。ger.repositorySelector 可能由于类重新加载错误而为空,使用 NOPLoggerRepository.vocationTargetException

4

1 回答 1

1

是的,我的命令行参数错误。当参数以“ -- ”为前缀时,之前的设置被删除。如果我使用前缀“ ++ ”,则会保存以前的设置并且一切正常。所以打电话:

C:\Alfresco\tomcat\bin\tomcat6.exe //RS//alfrescoTomcat ++JvmOptions "-Xdebug;-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"

一切正常:) 谢谢!

于 2012-04-12T12:18:49.557 回答