JBoss AS 7 throw' java.lang.reflect.MalformedParameterizedTypeException'在开始期间

时间:2014-04-23 00:09:32

标签: java java-ee jboss jboss7.x jboss-weld

我使用JBoss 7.1.3(源代码构建)和Ubuntu 13.10 64位和open-jdk 7.并且所有应用程序都运行正常。适用于使用Windows和其他Linux的其他开发人员(使用Oracle和OpenJDK的java 7)。

现在我试图在另一台机器上启动应用程序(一台带有Redhat 6 - 64位且带有open-jdk 7的虚拟机) 从其他机器使用extacly相同的jboss(压缩jbo​​ss文件夹并在新机器中解压缩),应用程序不再启动。

我尝试使用干净的JBoss 7.1.3,7.2.0甚至WildFly 8.1.0.CR1,但错误仍然存​​在。

我还在新机器上编译应用程序源,但错误仍然存​​在。

遵循错误:

20:49:12,388 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."vendas-1.0.1-SNAPSHOT.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."vendas-1.0.1-SNAPSHOT.war".WeldService: com.google.common.collect.ComputationException: java.lang.reflect.MalformedParameterizedTypeException
at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]
Caused by: com.google.common.collect.ComputationException: java.lang.reflect.MalformedParameterizedTypeException
at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:397)
at org.jboss.weld.resources.SharedObjectCache.getTypeClosure(SharedObjectCache.java:82)
at org.jboss.weld.resources.SharedObjectFacade.getTypeClosure(SharedObjectFacade.java:65)
at org.jboss.weld.introspector.TypeClosureLazyValueHolder.computeValue(TypeClosureLazyValueHolder.java:52)
at org.jboss.weld.introspector.TypeClosureLazyValueHolder.computeValue(TypeClosureLazyValueHolder.java:31)
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:34)
at org.jboss.weld.introspector.jlr.AbstractWeldAnnotated.getTypeClosure(AbstractWeldAnnotated.java:193)
at org.jboss.weld.bean.AbstractBean.initTypes(AbstractBean.java:187)
at org.jboss.weld.bean.ManagedBean.<init>(ManagedBean.java:280)
at org.jboss.weld.bean.ManagedBean.of(ManagedBean.java:253)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:212)
at org.jboss.weld.bootstrap.BeanDeployer.createBeans(BeanDeployer.java:139)
at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:204)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:350)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
... 5 more
Caused by: java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:60) [rt.jar:1.7.0_55]
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:53) [rt.jar:1.7.0_55]
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:95) [rt.jar:1.7.0_55]
at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105) [rt.jar:1.7.0_55]
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140) [rt.jar:1.7.0_55]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) [rt.jar:1.7.0_55]
at sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:84) [rt.jar:1.7.0_55]
at java.lang.Class.getGenericSuperclass(Class.java:696) [rt.jar:1.7.0_55]
at org.jboss.weld.util.reflection.HierarchyDiscovery.discoverFromClass(HierarchyDiscovery.java:126)
at org.jboss.weld.util.reflection.HierarchyDiscovery.discoverTypes(HierarchyDiscovery.java:95)
at org.jboss.weld.util.reflection.HierarchyDiscovery.init(HierarchyDiscovery.java:74)
at org.jboss.weld.util.reflection.HierarchyDiscovery.getTypeClosure(HierarchyDiscovery.java:58)
at org.jboss.weld.resources.SharedObjectCache$4.apply(SharedObjectCache.java:58)
at org.jboss.weld.resources.SharedObjectCache$4.apply(SharedObjectCache.java:55)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)
... 20 more

有任何线索吗?

感谢

2 个答案:

答案 0 :(得分:0)

您是否尝试过更改maven artifactId? 这奇怪地解决了我的问题(重新安装jboss并重新启动PC时没有)。

答案 1 :(得分:0)

与最新的Payara 4.1 173有相同的问题(我知道,不是JBoss / WildFly,但它使用相同的WELD引擎)。我能够通过以下方式解决这个问题:

  • 重新安装Payara的libmodules目录(glassfish目录内)
  • 确保保留mariadb*.sql,否则JDBC资源将无效
  • 清除~/personal_domain/osgi-cache/

这是收集JAR的地方,也许有类似的地方?如果你降级,例如javax.faces.jar从2.3.2(beta)到2.2.14(与Payara捆绑)并且你没有清除osgi-cache,你仍然有2.3.2而不是2.2.14,因为它是从osgi-cache。升级此类JAR可以正常工作,而不是降级。

同样,我知道它不是WildFly / JBoss,但这确实解决了我的问题。

我认为这可能值得,因为同样的例外让我疯狂。我还添加了一个新的记录器org.jboss.weld,其中FINEST作为日志级别,并看到它成功解析了注释,但仍然存在异常。我还尝试从所有转换器和验证器中删除公共构造函数,但无济于事。只有在我完成上述步骤之前,我才能恢复Payara。