简体   繁体   English

在Eclipse中部署Jboss期间的奇怪行为

[英]Strange behaviour during deployment of Jboss in Eclipse

I'm working in an app with: 我正在使用以下应用程序:

  • Eclipse Version: Luna Service Release 1 (4.4.1) Eclipse版本:Luna Service Release 1(4.4.1)
  • JBoss EAP 6.3 JBoss EAP 6.3
  • Maven, Spring, Hibernate, Log4J etc... Maven,Spring,Hibernate,Log4J等...

I'm experiencing strange an strange issue when doing some modification in the code: 在代码中进行一些修改时,我遇到一个奇怪的奇怪问题:

If I don't do execute run as... maven install with goals clean package -X nothing changes except debug points don't match with code. 如果我不执行运行,则...用目标clean package -X maven install ,除调试点与代码不匹配外,没有任何更改。 Build automatically is enabled. 自动构建已启用。

  • Why is this happening? 为什么会这样呢? Can be because .class files are not syncronized with .java ones? 可能是因为.class文件未与.java文件同步?

Knowing this, it's a bit tricky but I can deal with it, every thime I make a modification, I stop the server, rebuild war file ( run as... maven install ) to see changes applied in the code and restart the server. 知道了这一点,这有点棘手,但是我可以处理它,我对每一个thime进行修改后,我都会停止服务器,重建war文件( 运行为... maven install ),以查看代码中应用的更改并重新启动服务器。

Problem comes randomly when I restart the server, app does not start and I get this exception: 当我重新启动服务器时, 问题随机出现,应用无法启动,并且出现以下异常:

17:40:12,816 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/xxx]] (ServerService Thread Pool -- 71) JBWEB000287: Exception sending context initialized event to listener instance of class net.aqualogy.xf.component.web.spring.ContextLoaderListener : org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: net.aqualogy.xxx.bc.impl.AClass ; 17:40:12,816错误[org.apache.catalina.core.ContainerBase。[jboss.web]。[默认主机]。[/ xxx]](ServerService线程池-71)JBWEB000287: 将上下文初始化事件发送到的异常类net.aqualogy.xf.component.web.spring.ContextLoaderListener的侦听器实例 :org.springframework.beans.factory.BeanDefinitionStoreException: 无法加载bean类:net.aqualogy.xxx.bc.impl.AClass nested exception is java.io.FileNotFoundException: class path resource [net/aqualogy/xxxx/bc/impl/xxxxE_FCDImpl$2.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:291) [spring-context-3.2.6.RELEASE.jar:3.2.6.RELEASE] ... 19 more 17:40:16,998 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 71) JBWEB001103: Error detected during context /myApp start, will stop it 嵌套异常为java.io.FileNotFoundException:类路径资源[net / aqualogy / xxxx / bc / impl / xxxxE_FCDImpl $ 2.class]无法打开,因为它在org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor .java:291)[spring-context-3.2.6.RELEASE.jar:3.2.6.RELEASE] ...还有19个17:40:16,998错误[org.apache.catalina.core](ServerService线程池- 71)JBWEB001103:在上下文/ myApp启动期间检测到错误,它将停止它

In error log: 在错误日志中:

Publish Failed for module xxx-web eclipse.buildId=4.4.1.M20140925-0400 java.version=1.7.0_79 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_ES Framework arguments: -product org.eclipse.epp.package.jee.product -perspective net.aqualogy.xf.tools.ide.ui.perspectives.XFPerspective Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -perspective net.aqualogy.xf.tools.ide.ui.perspectives.XFPerspective 发布模块xxx-web eclipse.buildId = 4.4.1.M20140925-0400 java.version = 1.7.0_79 java.vendor = Oracle Corporation BootLoader常量失败 :OS = win32,ARCH = x86_64,WS = win32,NL = es_ES Framework参数:-product org.eclipse.epp.package.jee.product -perspective net.aqualogy.xf.tools.ide.ui.perspectives.XFPerspective命令行参数:-os win32 -ws win32 -arch x86_64 -product org。 eclipse.epp.package.jee.product-perspective net.aqualogy.xf.tools.ide.ui.perspectives.XFPerspective

After breaking my mind for couple of days, I've found some strange things: 在中断了几天的精力之后,我发现了一些奇怪的事情:

  • If I remove the app from the server in Eclipse I still get same exception. 如果我从Eclipse中的服务器中删除该应用程序,我仍然会遇到同样的异常。
  • If I try to clean server in Eclipse i get this exception: 如果我尝试在Eclipse中清理服务器,则会出现以下异常: 在此处输入图片说明
  • After removing app, with server started, when I go to JBoss administration console, I still can see a war file deployed there. 删除应用程序后,在服务器启动的情况下,当我转到JBoss管理控制台时,仍然可以看到在那里部署了war文件。
  • If I remove the app from the console problem does not fix. 如果我从控制台删除该应用程序,则无法解决问题。
  • To make app work most part of the times I must perform: 要使应用大部分时间都可以正常工作,我必须执行以下操作:
    1. Run as maven custom install: maven install with goals clean package -X 作为maven定制安装运行:具有目标clean package -X maven install
    2. Remove app from server 从服务器删除应用
    3. App and server clean. 应用程序和服务器干净。
    4. Exit Eclipse 退出Eclipse
    5. Delete manually maven repository folder 手动删除Maven存储库文件夹
    6. Open Eclipse and wait till rebuilding workspace and download dependencies 打开Eclipse并等待直到重建工作空间并下载依赖项
    7. Add app to server again 再次将应用添加到服务器

I'm quite sure my server / maven configurations are wrong, but I can't figure out where to search. 我非常确定我的服务器/ maven配置错误,但是我不知道要在哪里搜索。

Any ideas? 有任何想法吗?

Make sure your project is up to date there is an option to update, right click on the project select maven > update project, then also make sure the project is cleaned, and run as maven as clean install. 确保您的项目是最新的,并且有一个更新选项,右键单击该项目,选择“ maven”>“更新项目”,然后还确保该项目已被清理,并以maven的身份像全新安装一样运行。

Also I've always created a launch configuration with the options I want for maven launch 另外,我总是使用我想要进行Maven启动的选项来创建启动配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM