TransactionRolledbackLocalException - jpa-2.0

I'm having an annoying error message while trying to insert new element in a one to many relationship using JPA 2.0.
public class Ordinateur implements Serializable {
private static final long serialVersionUID = 1L;
#Column(name = "TAG")
private BigInteger tag;
#Size(max = 30)
#Column(name = "MACHINE")
private String machine;
#Size(max = 25)
#Column(name = "NOM_FABRIQUANT")
private String nomFabriquant;
#Column(name = "NUM_SERIE")
private BigInteger numSerie;
#Column(name = "ADRESSE_IP")
private BigInteger adresseIp;
// #Max(value=?) #Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
#Column(name = "NUM_SEQ")
private BigInteger numSeq;
#Size(max = 30)
#Column(name = "SYSTEME_EXPLOITATION")
private String systemeExploitation;
#Id
#Basic(optional = false)
#NotNull
#Size(min = 1, max = 30)
#Column(name = "IDORD")
private String idord;
#OneToMany(mappedBy = "idord")
private List<Systemeexploitation> systemeexploitationList;
#OneToMany(mappedBy = "idord")
private List<Intervention> interventionList;
#OneToMany(mappedBy = "idord")
private List<Inventaire> inventaireList;
public Ordinateur() {
} //...........
my session bean :
public void ordCreer(Ordinateur ordinateur) {
ordinateurFacade.create(ordinateur);
}
Managed Bean :
public String enregistrerOrd() throws Exception{
manager.ordCreer(ordinateur);
return "OrdList";
}
and here's the error :
ATTENTION: EJB5184:A system exception occurred during an invocation on EJB OrdinateurFacade, method: public void ejb.AbstractFacade.create(java.lang.Object)
ATTENTION: javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:5071)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4906)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
at $Proxy312.create(Unknown Source)
at ejb.__EJB31_Generated__OrdinateurFacade__Intf____Bean__.create(Unknown Source)
//...
Caused by: javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'. Please refer to embedded ConstraintViolations for details.
//...
TTENTION: EJB5184:A system exception occurred during an invocation on EJB Manager, method: public void DAO.Manager.ordCreer(jpa.Ordinateur)
ATTENTION: javax.ejb.EJBTransactionRolledbackException
at com.sun.ejb.containers.BaseContainer.mapLocal3xException(BaseContainer.java:2314)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2096)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89)
at $Proxy312.create(Unknown Source)
at ejb.__EJB31_Generated__OrdinateurFacade__Intf____Bean__.create(Unknown Source)
//................
Caused by: javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:5071)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4906)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
... 80 more
Caused by: javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'. Please refer to embedded ConstraintViolations for details.
at org.eclipse.persistence.internal.jpa.metadata.listeners.BeanValidationListener.validateOnCallbackEvent(BeanValidationListener.java:90)
at org.eclipse.persistence.internal.jpa.metadata.listeners.BeanValidationListener.prePersist(BeanValidationListener.java:62)
at org.eclipse.persistence.descriptors.DescriptorEventManager.notifyListener(DescriptorEventManager.java:698)
I tryed to delete the #NotNull but nothing happened
Any idea of the reason?

Related

java.lang.AssertionError: expected:<ON> but was:<com.spacestudy.model.Account#783f5f71>

I am trying to write a JUnit test case for the following search filter method. I am using Querydsl for the search filter. The following method does not depend on Repository; that is why I am not using mockito. This is the first time I am writing a test case for such a method. Please give any suggestions, if you have any?
public List<Tuple> btnSearchClick(String sClientAcctId, String sAcctDesc, String sInvestigatorName,
String sClientDeptId) throws Exception {
QAccount account = QAccount.account;
QDepartment department = QDepartment.department;
QAccountCPCMapping accountCPCMapping = QAccountCPCMapping.accountCPCMapping;
QInvestigator investigator = QInvestigator.investigator;
JPAQuery<Tuple> query = new JPAQuery<Tuple>(em);
query.select(Projections.bean(Account.class, account.sClientAcctId, account.sAcctDesc, account.sLocation,
Projections.bean(Department.class, department.sDeptName, department.sClientDeptId).as("department"),
Projections.bean(Investigator.class, investigator.sInvestigatorName).as("investigator"),
Projections.bean(AccountCPCMapping.class, accountCPCMapping.sCCPCode).as("accountCPC"))).from(account)
.innerJoin(account.department, department).innerJoin(account.accountCPC, accountCPCMapping)
.innerJoin(account.investigator, investigator).where(account.nInstId.eq(60));
Test case
#Test
public void btnSearchClick() throws Exception {
List<Tuple> account= accountService.btnSearchClick("1124100", sAcctDesc, sInvestigatorName, sClientDeptId);
Department dep = new Department();
dep.setsDeptName("Deans Office");
dep.setsClientDeptId("120010");
Investigator invest = new Investigator();
invest.setsInvestigatorName("Ram, Sri");
AccountCPCMapping cpc = new AccountCPCMapping();
cpc.setsCCPCode("RT");
Account acc = new Account();
acc.setsLocation("ON");
acc.setsAcctDesc("SRIRAM");
acc.setsClientAcctId("1124100");
acc.setInvestigator(invest);
acc.setDepartment(dep);
acc.setAccountCPC(cpc);
accountRepo.save(acc);
assertEquals(acc.getsLocation(), account.get(0));
}
Account.java
#Entity
#Table(name = "account")
#JsonInclude(JsonInclude.Include.NON_NULL)
public class Account implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "account_seq_generator")
#SequenceGenerator(name = "account_seq_generator", sequenceName = "account_seq")
#Column(name = "naccount_id")
public Integer nAccountId;
#Column(name = "namount")
public String nAmount;
#Column(name = "sacct_desc")
public String sAcctDesc;
#Column(name = "naccount_cpc_mapping_id")
public Integer nAccountCPCMappingId;
#Column(name = "nindirect_cost_rate")
public Integer nIndiretCostRate;
#Column(name = "nagency_id")
public Integer nAgencyId;
#Column(name = "ndept_id")
public Integer nDeptId;
#Column(name = "sgrant_num")
public String sGrantNum;
#Column(name = "dstart_date")
public Timestamp dStartDate;
#Column(name = "dend_date")
public Timestamp dEndDate;
#Column(name = "slocation")
public String sLocation;
#Column(name = "sclient_acct_id")
public String sClientAcctId;
#Column(name = "ninvestigator_id")
public Integer nInvestigatorId;
#Column(name = "ninst_id")
public Integer nInstId;
#Column(name = "ntemp_account_id")
public Integer nTempAccountId;
#ManyToOne(optional = true, cascade = { CascadeType.MERGE })
#JoinColumn(name = "ndept_id", insertable = false, updatable = false)
public Department department;
#ManyToOne(optional = true, cascade = { CascadeType.ALL })
#JoinColumn(name = "ninvestigator_id", insertable = false, updatable = false)
public Investigator investigator;
#ManyToOne(optional = true, cascade = { CascadeType.ALL })
#JoinColumn(name = "naccount_cpc_mapping_id", insertable = false, updatable = false)
public AccountCPCMapping accountCPC;
// Getter and Setter
Stack Trace
java.lang.AssertionError: expected:<ON> but was:<com.spacestudy.model.Account#783f5f71>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:144)
at com.spacestudy.service.TestAccountService.btnSearchClick(TestAccountService.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
Output from postman
[
{
"sAcctDesc": "SRIRAM",
"sLocation": "ON",
"sClientAcctId": "1124100",
"department": {
"sDeptName": "Deans Office",
"sClientDeptId": "120010"
},
"investigator": {
"sInvestigatorName": "Ram, Sri"
},
"accountCPC": {
"sCCPCode": "RT"
}
}
]
Can anyone please tell me what I am doing wrong in my test case, or suggest an alternative to the code above.
Lists are zero-indexed. That means that if your list has only 1 element, it's index will be 0, not 1.
The element with index 1 is actually the second one (which doesn't exist, thus the index out of bounds).
account.get(1)
should be
account.get(0);

RuntimeException (use a converting NullKeySerializer?) while saving entity to neo4j db using spring

I have a simple project with following entities:
USER
#NodeEntity
public class User extends AbstractAuditingEntity {
#Size(min = 10, max = 10)
#Pattern(regexp = "\\d{10}")
#Property(name="phone")
private String phoneNo;
#Property(name="fname")
#JsonIgnore
private String firstName;
#Property(name="lname")
#JsonIgnore
private String lastName;
#Property(name="activated")
private boolean activated = false;
#Size(min = 2, max = 5)
#Property(name="lang")
private String langKey;
#Size(max = 20)
#JsonIgnore
#Property(name="activationKey")
private String activationKey;
#JsonIgnore
#Property(name="roles")
#Relationship(type="HAS_ROLES", direction=Relationship.OUTGOING)
private Set<Authority> authorities = new HashSet<>();
//Friends
#Property(name="friends")
#Relationship(type="FRIENDS", direction = Relationship.UNDIRECTED)
private Set<User> friends = new HashSet<>();
}
AbstractAuditingEntity
#NodeEntity
public abstract class AbstractAuditingEntity extends Entity {
#CreatedBy
#JsonIgnore
private String createdBy;
#JsonIgnore
#DateLong
private Date createdDate = new Date();
#LastModifiedBy
#JsonIgnore
private String lastModifiedBy;
#DateLong
#JsonIgnore
private Date lastModifiedDate = new Date();
}
ENTITY
#NodeEntity
public abstract class Entity {
#GraphId
private Long id;
}
AUTHORITY
#NodeEntity
public class Authority extends Entity {
#NotNull
#Size(min = 10, max = 20)
private String name;
#Property(name="users")
#Relationship(type="HAS_ROLES", direction = Relationship.INCOMING)
private Set<User> users = new HashSet<>();
}
I have removed getter/setters for simplicity. When I try to save the data using repository it throws following exception:
java.lang.RuntimeException: com.fasterxml.jackson.core.JsonGenerationException: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?)
at org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest.executeRequest(EmbeddedRequest.java:181)
at org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest.execute(EmbeddedRequest.java:88)
at org.neo4j.ogm.session.request.RequestExecutor.executeSave(RequestExecutor.java:88)
at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:85)
at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:44)
at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:419)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy100.save(Unknown Source)
at org.springframework.data.neo4j.template.Neo4jTemplate.save(Neo4jTemplate.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
During the save, I'm first saving the authority using authority repository and then user information using user repository.
Not able to figure out why is it crashing. Any help would be greatly appreciated.

Marshalling Error: failed to lazily initialize a collection of role (...), no session or session was closed

I`m using Eclipse RCP with EJB exposed like WebServices. My services beans looks like follows
#Override
#SuppressWarnings("unchecked")
public List<Author> listAll() {
final Query query = this.entityManager.createQuery("from Author");
final List<Author> authors = query.getResultList();
return authors;
}
The two entityes are:
#Entity
#Table(name = "books")
public class Book implements Serializable {
#Id
private int id;
private String title;
private String summary;
private String isbn;
#Column(name = "published")
private Date publishingDate;
#Column(name = "created")
private Date createdAt;
#Column(name = "updated")
private Date modifiedAt;
#ManyToMany
#JoinTable(
name = "book_authors",
joinColumns = #JoinColumn(name = "book_id", referencedColumnName = "id"),
inverseJoinColumns = #JoinColumn(name = "author_id", referencedColumnName = "id"))
private List<Author> authors;
and
#Entity
#Table(name = "authors")
public class Author implements Serializable {
private static final long serialVersionUID = 1L;
#Id
private int id;
#Column(name = "first_name")
private String firstName;
#Column(name = "middle_name")
private String middleName;
#Column(name = "last_name")
private String lastName;
#Column(name = "created")
private Date createdAt;
#Column(name = "updated")
private Date modifiedAt;
#ManyToMany
#JoinTable(
name = "book_authors",
joinColumns = #JoinColumn(name = "author_id", referencedColumnName = "id"),
inverseJoinColumns = #JoinColumn(name = "book_id", referencedColumnName = "id"))
private List<Book> books;
In my TestWSCLient i`m trying to do something like this
AuthorServiceBeanServiceLocator locator = new AuthorServiceBeanServiceLocator();
AuthorServiceBean service = locator.getAuthorServiceBeanPort();
Author[] authors = service.listAll();
for(Author a : authors){
System.out.println(a.getFirstName());
}
and I`m getting this error
{....//xml.apache.org/axis/}stackTrace:Marshalling Error: failed to lazily initialize a collection of role: ro.cgs.entities.Author.books, no session or session was closed
I`m mention that if I do not make the Many-To-Many relationship all works fine. Can anybody tell me what should I do to fix this problem ?
I use Hibernate for persistence.
Thanks.

JPA StackOverflowError when loading data in relationship tables

I'm trying to implement loading in three tables (the beginning of the problem with mapping)
Products:
#Entity
#Table(name = "products")
public class Product implements Serializable {
#Id
#Column(name = "id")
private Integer id;
#OneToMany(mappedBy = "property", fetch = FetchType.LAZY)
private Collection<ProductProperty> productPropertyCollection;
...
}
Properties:
#Entity
#Table(name = "properties")
public class Property implements Serializable {
#Id
#Column(name = "id")
private Integer id;
#OneToMany(mappedBy = "property", fetch = FetchType.LAZY)
private Collection<ProductProperty> productPropertyCollection;
...
}
Product_Property
#Entity
#Table(name = "product_property")
public class ProductProperty implements Serializable {
#EmbeddedId
protected ProductPropertyPK productPropertyPK;
#MapsId(value = "propertyId")
#JoinColumn(name = "property_id", referencedColumnName = "id")
#ManyToOne()
private Property property;
#MapsId(value = "productId")
#JoinColumn(name = "product_id", referencedColumnName = "id")
#ManyToOne()
private Product product;
...
}
#Embeddable
public class ProductPropertyPK implements Serializable {
#Basic(optional = false)
#NotNull
#Column(name = "product_id", insertable = false, updatable = false)
private int productId;
#Basic(optional = false)
#NotNull
#Column(name = "property_id", insertable = false, updatable = false)
private int propertyId;
...
}
It works fine for 1, 10, 100 products, but somewhere there is an error, because for 1000 and more products throws error:
Caused by: java.lang.StackOverflowError
at java.util.HashMap.getEntry(HashMap.java:443)
at java.util.HashMap.containsKey(HashMap.java:434)
at java.util.HashSet.contains(HashSet.java:201)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4141)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:938)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:916)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1964)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4178)
at org.eclipse.persistence.mappings.CollectionMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(CollectionMapping.java:426)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1964)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4178)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:938)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:916)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1964)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4178)
at org.eclipse.persistence.mappings.CollectionMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(CollectionMapping.java:426)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1964)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4178)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:938)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:916)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1964)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4178)
...
when i'm creating ProductProperty, i'm setting product and property in ProductProperty, and adding to collection for bidirection in Product and Property.
where i could make a mistake?
Looks like your object model complexity or depth is just difficult to traverse within your JVM's stack limits. As it is, every entity seems reachable from every other entity, which causes problems when traversed recursively. Try increasing the -Xss setting. You might also reduce the interconnectivity, such as removing one of the OneToMany mappings and query for it directly instead of storing it in the Product or Property mapping. You might also file an enhancement with EclipseLink to traverse the object graph using a stack instead of recursively.

Why can't I instantiate a managedbean in jpa?

I am trying to develop a small web application as training for my upcoming finals and I can't figure out what I'm doing wrong.
These are my *Entities*L Kunde and Konto (many2many-relationship), the auto-created table Kunde_Konto has only the two primary keys of my entities.
#Entity
#NamedQueries({
#NamedQuery(name="findKundeById", query="select k from Kunde k where k.svnr = :svnr"),
})
public class Kunde implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#Column(precision=4, scale=0)
private Long svnr;
#ManyToMany
private List<Konto> konten;
}
#Entity
#NamedQueries({
#NamedQuery(name="findKontoByBesitzer", query="select k from Konto k join k.besitzer b where b.svnr = :svnr")
})
public class Konto implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#Column(precision=4, scale=0)
private Long knr;
#ManyToMany(mappedBy="konten")
private List<Kunde> besitzer;
}
And this is my Managed Bean:
#ManagedBean
#SessionScoped
public class KundenKontoList implements Serializable {
private FacesContext fc = null;
private HttpServletRequest hsr = null;
private HttpSession hs = null;
#EJB
private KontoFacadeLocal kontoFacade;
#EJB
private KundeFacadeLocal kundeFacade;
private Kunde k;
private List<Konto> konten;
/**
* Creates a new instance of KundenKontoList
*/
public KundenKontoList() {
fc = FacesContext.getCurrentInstance();
hsr = (HttpServletRequest) fc.getExternalContext().getRequest();
hs = hsr.getSession();
k = (Kunde) hs.getAttribute("kunde");
konten = kontoFacade.findKontoByBesitzer(k);
}
}
The exception
com.sun.faces.mgbean.ManagedBeanCreationException: Klasse at.pf.controller.KundenKontoList kann nicht instanziiert werden.
which translated means that KundenKontoList can't be instatiated, is thrown at the line:
konten = kontoFacade.findKontoByBesitzer(k);
//method in the facade:
#Override
public List<Konto> findKontoByBesitzer(Kunde k) {
Query q = em.createNamedQuery("findKontoByBesitzer");
q.setParameter("svnr", k.getSvnr());
return q.getResultList();
}
I think that it has something to do with the kontoFacade, but I don't know what the exact problem is.
Fail on init of managedbean, suggests to me that injection of ejbs is failing. Is there a longer error message?