Java EE 与 netbeans
我是一名学生,努力让我的家庭作业变成工作。该项目非常简单,只有 4 页 (xhtml),您可以登录/注销添加新项目(书籍和 CD)并查看数据库中的项目。使用derby和glassfish,所有软件都是最新版本。
问题:
该项目无法在我的计算机上运行。我将漏洞项目发送给我的老师,以便他可以查看并尝试找出问题所在,他没有发现编码有任何问题,这意味着我的计算机有问题。所以我卸载了所有与java、netbeans、derby、maven和glassfish有关的东西,然后删除了该软件的文件夹并再次安装,同样的问题出现了。尝试了 ubuntu 和 virtualbox,同样的事情。
Item.java
package model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
@Entity
@NamedQuery(name = "findAllItems", query = "SELECT i FROM Item i")
public class Item {
// ======================================
// = Attributes =
// ======================================
@Id
@GeneratedValue
protected Long id;
protected String title;
protected Float price;
protected String description;
// ======================================
// = Constructors =
// ======================================
public Item() {
}
public Item(String title, Float price, String description) {
this.title = title;
this.price = price;
this.description = description;
}
// ======================================
// = Getters & Setters =
// ======================================
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
ItemController.java
package model;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import java.util.ArrayList;
import java.util.List;
@ManagedBean
@RequestScoped
public class ItemController {
// ======================================
// = Attributes =
// ======================================
@EJB
private ItemEJB itemEJB;
private Book book = new Book();
private CD cd = new CD();
private Item item = new Item();
private List<Item> itemList = new ArrayList<Item>();
// ======================================
// = Public Methods =
// ======================================
public String doNewBook() {
return "newBook.xhtml";
}
public String doNewCD() {
return "newCD.xhtml";
}
public String doCreateBook() {
// book.setDescription(item.getDescription());
// book.setPrice(item.getPrice());
// book.setTitle(item.getTitle());
book = itemEJB.createBook(book);
itemList = itemEJB.findItems();
return "listItems.xhtml";
}
public String doCreateCD() {
// cd.setDescription(item.getDescription());
// cd.setPrice(item.getPrice());
// cd.setTitle(item.getTitle());
cd = itemEJB.createCD(cd);
itemList = itemEJB.findItems();
return "listItems.xhtml";
}
// ======================================
// = Getters & Setters =
// ======================================
public Book getBook() {
return book;
}
public void setBook(Book book) {
this.book = book;
}
public CD getCd() {
return cd;
}
public void setCd(CD cd) {
this.cd = cd;
}
public List<Item> getItemList() {
itemList = itemEJB.findItems();
return itemList;
}
public void setItemList(List<Item> itemList) {
this.itemList = itemList;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
}
ItemEJB.java
package model;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;
@Stateless
public class ItemEJB {
// ======================================
// = Attributes =
// ======================================
@PersistenceContext(unitName = "Lab5PU")
private EntityManager em;
// ======================================
// = Public Methods =
// ======================================
public List<Item> findItems() {
Query query = em.createNamedQuery("findAllItems");
return query.getResultList();
}
public Book createBook(Book book) {
em.persist(book);
return book;
}
public CD createCD(CD cd) {
em.persist(cd);
return cd;
}
}
堆栈跟踪:
查看堆栈跟踪仅告诉我“名称的 NamedQuery:findAllItems 未找到”。但在我的文件中,它看起来像这样“@NamedQuery(name =“findAllItems”,query =“SELECT i FROM Item i”)”。如果您需要更多有关某事的信息,而不仅仅是告诉我并将发布它。
这是漏洞堆栈跟踪:
javax.ejb.EJBException
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5193)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5091)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4879)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2039)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1990)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy145.findItems(Unknown Source)
at model.__EJB31_Generated__ItemEJB__Intf____Bean__.findItems(Unknown Source)
at model.ItemController.getItemList(ItemController.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:302)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:116)
at com.sun.el.parser.AstValue.getValue(AstValue.java:163)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIData.getValue(UIData.java:731)
at javax.faces.component.UIData.getDataModel(UIData.java:1798)
at javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:484)
at javax.faces.component.UIData.setRowIndex(UIData.java:473)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
at javax.faces.component.UIData.encodeBegin(UIData.java:1118)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1754)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: NamedQuery of name: findAllItems not found.
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getDatabaseQueryInternal(EJBQueryImpl.java:577)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1043)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.createNamedQuery(EntityManagerWrapper.java:533)
at model.ItemEJB.findItems(ItemEJB.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5366)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5338)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
... 58 more
============================================ ========================================= 更新&解决方案 我确实解决了这个问题,但我仍然不知道它出了什么问题。对于那些想知道解决方案的人来说,这里就来了。我的电脑上有三个硬盘。我将所有文件从一个驱动器移至另外两个驱动器。然后将项目打印在纸上。然后我删除了运行 Windows 7 x64 的主驱动器并格式化了空驱动器,安装了 Windows 7(完整更新)、netBeans、maven、glassFish 和 derby。在netBeans中手工写下该项目(没有副本),制作一个新的PU,仅此而已。只需运行该项目,现在一切正常,不明白,但这就是生活 =)
I'm a student trying to make my home work to work. The project is quit simple, only 4 page (xhtml), you can login/logout add new items (books and CD's) and view the items from the DB. Using derby and glassfish, all the software are the latest versions.
The problem:
THe project dosent work on my computer. I sent the hole project to my teacher so that he can look over it and try to find what is wrong, he diden't find anything wrong with the coding, witch means there something wrong with my computer. So I uninstalled everything that have something to do with java, netbeans, derby, maven and glassfish, than deleted the folders for for this software and installed it again, the same problem accures. Tryied with ubuntu and virtualbox, the same thing.
Item.java
package model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
@Entity
@NamedQuery(name = "findAllItems", query = "SELECT i FROM Item i")
public class Item {
// ======================================
// = Attributes =
// ======================================
@Id
@GeneratedValue
protected Long id;
protected String title;
protected Float price;
protected String description;
// ======================================
// = Constructors =
// ======================================
public Item() {
}
public Item(String title, Float price, String description) {
this.title = title;
this.price = price;
this.description = description;
}
// ======================================
// = Getters & Setters =
// ======================================
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
ItemController.java
package model;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import java.util.ArrayList;
import java.util.List;
@ManagedBean
@RequestScoped
public class ItemController {
// ======================================
// = Attributes =
// ======================================
@EJB
private ItemEJB itemEJB;
private Book book = new Book();
private CD cd = new CD();
private Item item = new Item();
private List<Item> itemList = new ArrayList<Item>();
// ======================================
// = Public Methods =
// ======================================
public String doNewBook() {
return "newBook.xhtml";
}
public String doNewCD() {
return "newCD.xhtml";
}
public String doCreateBook() {
// book.setDescription(item.getDescription());
// book.setPrice(item.getPrice());
// book.setTitle(item.getTitle());
book = itemEJB.createBook(book);
itemList = itemEJB.findItems();
return "listItems.xhtml";
}
public String doCreateCD() {
// cd.setDescription(item.getDescription());
// cd.setPrice(item.getPrice());
// cd.setTitle(item.getTitle());
cd = itemEJB.createCD(cd);
itemList = itemEJB.findItems();
return "listItems.xhtml";
}
// ======================================
// = Getters & Setters =
// ======================================
public Book getBook() {
return book;
}
public void setBook(Book book) {
this.book = book;
}
public CD getCd() {
return cd;
}
public void setCd(CD cd) {
this.cd = cd;
}
public List<Item> getItemList() {
itemList = itemEJB.findItems();
return itemList;
}
public void setItemList(List<Item> itemList) {
this.itemList = itemList;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
}
ItemEJB.java
package model;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;
@Stateless
public class ItemEJB {
// ======================================
// = Attributes =
// ======================================
@PersistenceContext(unitName = "Lab5PU")
private EntityManager em;
// ======================================
// = Public Methods =
// ======================================
public List<Item> findItems() {
Query query = em.createNamedQuery("findAllItems");
return query.getResultList();
}
public Book createBook(Book book) {
em.persist(book);
return book;
}
public CD createCD(CD cd) {
em.persist(cd);
return cd;
}
}
Stack trace:
Looking at the stack trace only tells me that "NamedQuery of name: findAllItems not found." but in my file it look like this "@NamedQuery(name = "findAllItems", query = "SELECT i FROM Item i")". If you need more info about something than just tell me and will post it.
Here is the hole stack trace:
javax.ejb.EJBException
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5193)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5091)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4879)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2039)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1990)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy145.findItems(Unknown Source)
at model.__EJB31_Generated__ItemEJB__Intf____Bean__.findItems(Unknown Source)
at model.ItemController.getItemList(ItemController.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:302)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:116)
at com.sun.el.parser.AstValue.getValue(AstValue.java:163)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIData.getValue(UIData.java:731)
at javax.faces.component.UIData.getDataModel(UIData.java:1798)
at javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:484)
at javax.faces.component.UIData.setRowIndex(UIData.java:473)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
at javax.faces.component.UIData.encodeBegin(UIData.java:1118)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1754)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: NamedQuery of name: findAllItems not found.
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getDatabaseQueryInternal(EJBQueryImpl.java:577)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1043)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.createNamedQuery(EntityManagerWrapper.java:533)
at model.ItemEJB.findItems(ItemEJB.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5366)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5338)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
... 58 more
==================================================================================
UPDATE & SOLUTION
I did fix the problem but I still don't know what was wrong with it. For those who want to know the solution here it comes. I have three HDD on my PC. I moved all files from one drive to the other two. Then print out the project on paper. Then I removed my primary drive with windows 7 x64 on and formatted the empty drive, installed windows 7 (full update), netBeans, maven, glassFish and derby. Wrote down the project in netBeans by hand (no copy), made a new PU and that's it. Just run the project and everything was working now, don't understand it but hey that's life =)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它的云部署会被搞乱。您应该尝试清理您的项目和服务器,然后重建并重新部署您的应用程序。如果它不能帮助您,则您的代码或配置有错误。
我使用带有字符串常量的命名查询声明。它可以防止您在查询名称中输入错误。
我希望像这样进行查询
,这至少可以帮助您缩小问题范围。
It cloud be messed up deploy. You should try to clean your project and server, then rebuild and redeploy your app. If it doesn't help you have an error in your code or configuration.
I use declaration of named queries with String constants. It prevents you from making typo in a query name.
make query like this
I hope, this will at least help you to narrow down the problem.