我正在运行 JPA 测试,并且在本文结尾处不断收到错误消息。我不知道为什么会收到此错误,但是在 JUnit 中进行测试时没有收到此错误。我知道这可能是一个通用信息和一个广泛的问题,但如果有一个简单的答案,我将不胜感激。
这是我的 3 个类文件:
package menu.entity;
import static javax.persistence.CascadeType.ALL;
import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
@IdClass(menu.entity.FeatureKey.class)
@Entity
@Table(name="FEATURES")
public class Feature implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="PROD_ID",
nullable = false,
insertable = false,
updatable = false,
precision=22)
private BigDecimal prodId;
@Id
@Column(name="FEATURE",
nullable = false,
insertable = false,
updatable = false,
precision=22)
private BigDecimal feature;
@Column(name="FEATURE_NAME", length=50)
private String featureName;
@Column(name="FEATURE_PATH", length=100)
private String featurePath;
@OneToMany(cascade=ALL, mappedBy="featureObj")
private List<Function> functions;
@ManyToOne
@JoinColumns({
@JoinColumn(name="PROD_ID", referencedColumnName="PROD_ID")
})
private Product product;
public Feature() {
}
public BigDecimal getFeature() {
return this.feature;
}
public void setFeature(BigDecimal feature) {
this.feature = feature;
}
public String getFeatureName() {
return this.featureName;
}
public void setFeatureName(String featureName) {
this.featureName = featureName;
}
public String getFeaturePath() {
return this.featurePath;
}
public void setFeaturePath(String featurePath) {
this.featurePath = featurePath;
}
public BigDecimal getProdId() {
return this.prodId;
}
public void setProdId(BigDecimal prodId) {
this.prodId = prodId;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public List<Function> getFunctions() {
return functions;
}
public void setFunctions(List<Function> functions) {
this.functions = functions;
}
}
package menu.entity;
import java.math.BigDecimal;
import javax.annotation.Generated;
import javax.persistence.metamodel.ListAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="Dali", date="2012-10-01T17:03:26.750-0400")
@StaticMetamodel(Feature.class)
public class Feature_ {
public static volatile SingularAttribute<Feature, BigDecimal> prodId;
public static volatile SingularAttribute<Feature, BigDecimal> feature;
public static volatile SingularAttribute<Feature, String> featureName;
public static volatile SingularAttribute<Feature, String> featurePath;
public static volatile ListAttribute<Feature, Function> functions;
public static volatile SingularAttribute<Feature, Product> product;
}
package menu.entity;
import static javax.persistence.CascadeType.ALL;
import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
@IdClass(menu.entity.FunctionKey.class)
@Entity
@Table(name="FUNCTIONS")
public class Function implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="PROD_ID",
nullable = false,
insertable = false,
updatable = false,
precision=22)
private BigDecimal prodId;
@Id
@Column(name="FEATURE",
nullable = false,
insertable = false,
updatable = false,
precision=22)
private BigDecimal feature;
@Id
@Column(name="FUNC",
nullable = false,
insertable = false,
updatable = false,
precision=22)
private BigDecimal func;
@Column(name="FUNC_NAME", length=50)
private String funcName;
@Column(name="FUNC_PATH", length=80)
private String funcPath;
@OneToMany(cascade=ALL, mappedBy="function")
private List<Task> tasks;
@ManyToOne
@JoinColumns({
@JoinColumn(name="PROD_ID", referencedColumnName="PROD_ID"),
@JoinColumn(name="FEATURE", referencedColumnName="FEATURE")
})
private Feature featureObj;
public Function() {
}
public BigDecimal getFeature() {
return this.feature;
}
public void setFeature(BigDecimal feature) {
this.feature = feature;
}
public BigDecimal getFunc() {
return func;
}
public void setFunc(BigDecimal func) {
this.func = func;
}
public String getFuncName() {
return this.funcName;
}
public void setFuncName(String funcName) {
this.funcName = funcName;
}
public String getFuncPath() {
return this.funcPath;
}
public void setFuncPath(String funcPath) {
this.funcPath = funcPath;
}
public BigDecimal getProdId() {
return this.prodId;
}
public void setProdId(BigDecimal prodId) {
this.prodId = prodId;
}
public Feature getFeatureObj() {
return featureObj;
}
public void setFeatureObj(Feature featureObj) {
this.featureObj = featureObj;
}
public List<Task> getTasks() {
return tasks;
}
public void setTasks(List<Task> tasks) {
this.tasks = tasks;
}
}
问候,
保罗
这是完整的堆栈跟踪:
java.lang.IllegalArgumentException:在 org.apache.openjpa.persistence.meta.AbstractManagedType.notFoundException(AbstractManagedType.java:734) 在 org.apache.openjpa.persistence 的 menu.entity.Feature 中找不到任何属性“功能”。 meta.AbstractManagedType.getAttribute(AbstractManagedType.java:237) 在 org.apache.openjpa.persistence.meta.AbstractManagedType.getAttribute(AbstractManagedType.java:461) 在 org.apache.openjpa.persistence.meta.MetamodelImpl.populate(MetamodelImpl. java:311) 在 org.apache.openjpa.persistence.meta.MetamodelImpl.find(MetamodelImpl.java:226) 在 org.apache.openjpa.persistence.meta.MetamodelImpl.instantiate(MetamodelImpl.java:257) 在 org.apache .openjpa.persistence.meta.MetamodelImpl.(MetamodelImpl.java:91) 在 org.apache.openjpa.persistence.EntityManagerFactoryImpl。getMetamodel(EntityManagerFactoryImpl.java:346) 在 org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:333) 在 org.apache.openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:1649) 在 org.apache .openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:101) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke 的 menu.ejb.RequestBean.init(RequestBean.java:60) (NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java.lang.reflect.Method.invoke(Method.java:597) 在 org.jboss.weld.util.reflection。 SecureReflections$13.work(SecureReflections.java:267) 在 org.jboss.weld.util。org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) 的反射.SecureReflectionAccess.run(SecureReflectionAccess.java:52) org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections. java:263) 在 org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) 在 org.jboss.weld 的 org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174) .bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:174) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:294) at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl .java:68) 在 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:599) 在 org.jboss.weld.manager。BeanManagerImpl.getReference(BeanManagerImpl.java:665) at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:136) at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:686) at org .jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:695) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:161) at org.jboss.weld.injection.InjectionContextImpl .run(InjectionContextImpl.java:48) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157) at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java: 131) 在 org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:293) 在 org.jboss.weld.context 的 org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153) .AbstractContext.get(AbstractContext.java:103) 在 org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) 在 org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java: 79) 在 menu.web.MenuManager$Proxy$_$$WeldClientProxy.getMenuItemsS(MenuManager$Proxy$$$_WeldClientProxy.java) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java .lang.reflect.Method.invoke(Method.java:597) at javax.el.BeanELResolver.getValue(BeanELResolver.java:87) at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) 在 org.apache.el.parser.AstValue.getValue(AstValue.java:169) 在 org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl. java:189) 在 com.sun.faces.facelets.el 的 org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)。TagValueExpression.getValue(TagValueExpression.java:109) 在 javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) 在 javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) 在 javax.faces.component .UIOutput.getValue(UIOutput.java:169) 在 com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205) 在 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java :355) 在 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164) 在 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) 在 javax.faces.component.UIComponent。在 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) 在 javax.encodeAll(UIComponent.java:1786)。faces.component.UIComponent.encodeAll(UIComponent.java:1782) 在 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) 在 com.sun.faces.application.view.MultiViewHandler.renderView( MultiViewHandler.java:125) 在 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) 在 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) 在 com.sun.faces.lifecycle.RenderResponsePhase .execute(RenderResponsePhase.java:121) 在 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 在 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) 在 javax。 faces.webapp.FacesServlet.service(FacesServlet.java:594) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) 在 org.apache.catalina.core.StandardContextValve 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) .invoke(StandardContextValve.java:169) 在 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 在 org. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 中的 apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:118) 在 org.apache.coyote.http11 的 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)。AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java: 307) 在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 在 java.lang.Thread.run(Thread .java:662) 2012 年 10 月 2 日下午 12:50:22 com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException 严重:错误渲染视图 [/menu.xhtml] javax.el.ELException: /menu.xhtml @26 ,51 value="#{menuManager.menuItemsS}":在 com.sun.faces.facelets.el 上的 menu.web.MenuManager$Proxy$_$$_WeldClientProxy 类型上读取“menuItemsS”时出错。TagValueExpression.getValue(TagValueExpression.java:114) 在 javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) 在 javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) 在 javax.faces.component .UIOutput.getValue(UIOutput.java:169) 在 com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205) 在 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java :355) 在 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164) 在 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) 在 javax.faces.component.UIComponent。在 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) 在 javax.encodeAll(UIComponent.java:1786)。faces.component.UIComponent.encodeAll(UIComponent.java:1782) 在 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) 在 com.sun.faces.application.view.MultiViewHandler.renderView( MultiViewHandler.java:125) 在 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) 在 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) 在 com.sun.faces.lifecycle.RenderResponsePhase .execute(RenderResponsePhase.java:121) 在 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 在 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) 在 javax。 faces.webapp.FacesServlet.service(FacesServlet.java:594) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) 在 org.apache.catalina.core.StandardContextValve 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) .invoke(StandardContextValve.java:169) 在 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 在 org. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 中的 apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:118) 在 org.apache.coyote.http11 的 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)。AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java: 307) 在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 在 java.lang.Thread.run(Thread .java:662) 原因:org.jboss.weld.exceptions.WeldException: WELD-000049 无法调用 [方法] @PostConstruct private menu.ejb.RequestBean.init() on menu.ejb.RequestBean@19ca9ff at org。 jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:400) 在 org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:174) 在 org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68) 在 org.jboss.weld.manager 的 org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:294) .BeanManagerImpl.getReference(BeanManagerImpl.java:599) 在 org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:665) 在 org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:136) 在org.jboss.weld.util.Beans.injectBoundFields(Beans.java:686) 在 org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:695) 在 org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1 $1.proceed(ManagedBean.java:161) at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157) 在 org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153) 在 org.jboss.weld 的 org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131) .bean.ManagedBean.create(ManagedBean.java:293) 在 org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103) 在 org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java :90) 在 org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) 在 menu.web.MenuManager$Proxy$_$$get(AbstractContext.java:103) 在 org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) 在 org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)在 menu.web.MenuManager$Proxy$_$$get(AbstractContext.java:103) 在 org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) 在 org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)在 menu.web.MenuManager$Proxy$_$$WeldClientProxy.getMenuItemsS(MenuManager$Proxy$ $$_WeldClientProxy.java) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) 在 java.lang.reflect.Method.invoke(Method.java:597) 在 javax.el.BeanELResolver.getValue(BeanELResolver.java:87) 在 com.sun.faces.el.DemuxCompositeELResolver。getValue(DemuxCompositeELResolver.java:176) 在 com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) 在 org.apache.el.parser.AstValue.getValue(AstValue.java:169) 在 org.apache .el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java :109) ... 34 更多原因:sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect 的 java.lang.reflect.InvocationTargetException。 org.jboss.weld 的 java.lang.reflect.Method.invoke(Method.java:597) 的 DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)。org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) 上 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation 上的 util.reflection.SecureReflections$13.work(SecureReflection.java:267) (SecureReflectionAccess.java:137) 在 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263) 在 org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174) 在org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) ... 63 更多原因:java.lang.RuntimeException: public static volatile javax.persistence.metamodel.ListAttribute menu.entity.Featurejava:52) 在 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263) 在 org.jboss. .weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174) at org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) ... 63 更多原因:java.lang.RuntimeException: public static volatile javax.persistence.metamodel.ListAttribute menu.entity.Featurejava:52) 在 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263) 在 org.jboss. .weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174) at org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) ... 63 更多原因:java.lang.RuntimeException: public static volatile javax.persistence.metamodel.ListAttribute menu.entity.Featurejboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) ... 63 更多原因:java.lang.RuntimeException: public static volatile javax.persistence.metamodel.ListAttribute menu.entity.Featurejboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) ... 63 更多原因:java.lang.RuntimeException: public static volatile javax.persistence.metamodel.ListAttribute menu.entity.Feature.functions at org.apache.openjpa.persistence.meta.MetamodelImpl.populate(MetamodelImpl.java:330) at org.apache.openjpa.persistence.meta.MetamodelImpl.instantiate(MetamodelImpl.java:257) at org.apache.openjpa .persistence.meta.MetamodelImpl.find(MetamodelImpl.java:226) 在 org.apache.openjpa.persistence.meta.MetamodelImpl.(MetamodelImpl.java:91) 在 org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(EntityManagerFactoryImpl. java:346) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:333) at org.apache.openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:1649) at org.apache.openjpa.persistence .EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:101) 在 menu.ejb.RequestBean.init(RequestBean.java:60) ... 73 更多 2012 年 10 月 2 日 12:50:22 PM org.apache.catalina.core.StandardWrapperValve 在路径 [/jsfCDITest] 的上下文中为 servlet [Faces Servlet] 调用 SEVERE: Servlet.service()抛出异常 [WELD-000049 Unable to call [method] @PostConstruct private menu.ejb.RequestBean.init() on menu.ejb.RequestBean@19ca9ff] 根本原因 java.lang.RuntimeException: public static volatile javax.persistence.metamodel .ListAttribute menu.entity.Feature_.functions at org.apache.openjpa.persistence.meta.MetamodelImpl.populate(MetamodelImpl.java:330) at org.apache.openjpa.persistence.meta.MetamodelImpl.instantiate(MetamodelImpl.java:257 ) 在 org.apache.openjpa.persistence.meta.MetamodelImpl.find(MetamodelImpl.java:226) 在 org.apache.openjpa.persistence.meta.MetamodelImpl.(MetamodelImpl.java:91) 在 org.org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:333) 在 org.apache.openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl. java:1649) 在 org.apache.openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:101) 在 menu.ejb.RequestBean.init(RequestBean.java:60) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java.lang.reflect.Method.invoke(Method.java:597) 在 org. jboss.weld.util.reflection.SecureReflections 13 美元。在 org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) 的 org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) 工作(SecureReflections.java:267)在 org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263) 在 org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174) 在 org.jboss.weld.bean .AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:398) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:174) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:294 ) 在 org.jboss.weld.manager.BeanManagerImpl 的 org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68)。getReference(BeanManagerImpl.java:599) at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:665) at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:136) at org.jboss .weld.util.Beans.injectBoundFields(Beans.java:686) at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:695) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed (ManagedBean.java:161) 在 org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) 在 org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157) 在 org .jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131) 在 org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153) 在 org.jboss.weld.bean。org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103) 上的 ManagedBean.create(ManagedBean.java:293) org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)在 org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) 在 menu.web.MenuManager$Proxy$_$$WeldClientProxy.getMenuItemsS(MenuManager$Proxy$$$_WeldClientProxy.java) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在 java .lang.reflect.Method.invoke(Method.java:597) at javax.el.BeanELResolver.getValue(BeanELResolver.java:87) at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) 在 org.apache.el.parser.AstValue.getValue(AstValue.java:169) 在 org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl. java:189) 在 com.sun.faces.facelets.el 的 org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)。TagValueExpression.getValue(TagValueExpression.java:109) 在 javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) 在 javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) 在 javax.faces.component .UIOutput.getValue(UIOutput.java:169) 在 com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205) 在 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java :355) 在 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164) 在 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) 在 javax.faces.component.UIComponent。在 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) 在 javax.encodeAll(UIComponent.java:1786)。faces.component.UIComponent.encodeAll(UIComponent.java:1782) 在 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) 在 com.sun.faces.application.view.MultiViewHandler.renderView( MultiViewHandler.java:125) 在 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) 在 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) 在 com.sun.faces.lifecycle.RenderResponsePhase .execute(RenderResponsePhase.java:121) 在 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 在 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) 在 javax。 faces.webapp.FacesServlet.service(FacesServlet.java:594) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) 在 org.apache.catalina.core.StandardContextValve 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) .invoke(StandardContextValve.java:169) 在 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 在 org. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 中的 apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:118) 在 org.apache.coyote.http11 的 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)。AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java: 307) 在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 在 java.lang.Thread.run(Thread .java:662)concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 在 java.lang.Thread.run(Thread.java:662)concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 在 java.lang.Thread.run(Thread.java:662)