[JBoss Seam] - Re: SeamLoginModule Error invoking login method
by jblackmore
I've been struggling with this problem all day, and I just figured out what my problem was. Maybe yours is the same.
I too started with the examples, specifically booking. In my case, I had been checking the differences between my log output and the booking example test output, and the key difference was that my entity manager and datasource were never deployed. I spent some time on that, and I was on the right track.
Check your jboss-beans.xml file, in META-INF. When running in the container, it seemed okay to leave this blank (or rather, with empty deployment tag). In the eejb/microcontainer environment, I needed some kind of datasource bootstrap, like in booking/resources/META-INF/jboss-beans.xml. Then of course I needed an import.sql to load the data I needed for the test(s), since I'm no longer connecting to Oracle.
That did the trick for me. Hope this helps.
John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043337#4043337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043337
19 years
[Persistence, JBoss/CMP, Hibernate, Database] - Map multiple rows to one object?
by texan
I'm using EJB3 persistence under JBoss 5.0.5. (But I think this is a hibernate question)
With the table structure below, I want to create a UserPreference class with a relationship to User and Preference, and a collection of String values. Note that (user_id,preference_id) is not unique in the value table, as users can have multiple values for some preferences.
I want the User to have a collection of UserPreference objects, one for each preference_id, rather than one for each unique record in the user_pref_value table.
That is, I'd like to map the UserPreference class to the user_pref_value table where user_id and preference_id are unique and it contains a String collection of values.
Any ideas?
Tables:
user
id (pk)
preference
id (pk)
user_pref_value
user_id (pk)
preference_id (pk)
value (pk)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043335#4043335
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043335
19 years
[JBoss Messaging] - Re: Calling messaging from webapp in same vm as messaging
by chip_schoch
I have my webapp scoped as per the directions:
My jboss-app.xml
<jboss-app>
| <loader-repository>
| com.eLynx:loader=ImplementationsWebapp
| <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
| </loader-repository>
| </jboss-app>
|
The problem that arises when I include jboss-messaging-client.jar in my .ear file and try to deploy it. When my servlet init is called I am initializing PojoCache. In the code, when it tries to get a reference to the PojoCacheMBean it throws:
| java.lang.IllegalArgumentException: interface org.jboss.mx.util.MBeanProxyInstance is not visible from class loader
| at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
| at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
| at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:395)
| at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:349)
| at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:324)
| at com.eLynx.Cache.CacheManager.initialize(CacheManager.java:77)
|
calling code:
m_cache = (PojoCacheMBean) MBeanProxyExt.create (PojoCacheMBean.class,
| "jboss.cache:service=eLynxPojoCache",
| server);
|
Because org.jboss.mx.util.MBeanProxyInstance is included in jboss-messaging-client.jar. That is why I removed it and tried adding jboss-messagin.jar and jboss-remoting.jar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043332#4043332
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043332
19 years
[JBoss Seam] - Re: Can i use another kind of architeture for a SEAM applica
by Delphi's Ghost
If I'm understanding correctly, you want to use a more "spring like" service/dao design for developing your application? .You can implement DAOs and have them injected into your stateful beans :
I think you can implement your DAOs as stateless session beans since the only 'state' you have is injected each time the bean is called :
(forgive the syntax errors)
| @Stateless
| @Name("personDAO")
| public class PersonDAOBean implements PersonDAO {
|
| @PersistenceContex
| private EntityManager em;
|
| public List<Person> findPeopleByFirstName(String firstName) {
| return em.createQuery("Select p from person where firstName = :firstName)
| .setParam("firstName",firstName)
| .getResultList();
| }
|
|
In your action bean part, simply inject the DAO into it
| @Name("personSearch")
| @Stateful
| @Scope(CONVERSATION)
| public class PersonSearchBean implements PersonSearch {
|
| @In
| private PersonDAO personDAO;
|
| private List<Person> results;
| private String firstNameParam;
|
|
| public void doSearch() {
| results = personDAO.findPeopleByFirstName(firstNameParam);
| }
|
| ...
|
or something like that.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043331#4043331
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043331
19 years
[EJB 3.0] - Entity super class getting nulled out
by tglaess
I have an entity bean that extends another entity bean. All is fine until about 10 minutes of inactivity in the session.
So, I log in to our app and let the session sit idle for 10 minutes. At that time, the values in the superclass all become null. The values in the subclass have not changed.
What would cause this? The session timeout is set to 30 minutes, so there is no issue there. I've turned on the maximum logging I can and nothing is logged during that 10 minutes. Why would the superclass values become null?
thanks,
tglaess
Here are some code snippets from the two classes:
@Entity
@Table(name = "user")
@Inheritance(strategy=InheritanceType.JOINED)
public class UserBean {
@Id
@Column(name = "UserID")
protected BigDecimal userID;
@Column(name = "UserName", nullable = false)
protected String userName;
@Column(name = "Password", nullable = false)
protected String password;
...
@Entity
@Table(name = "dealeruser")
@PrimaryKeyJoinColumn(name="UserID",referencedColumnName="UserID")
public class DealerUserBean extends UserBean implements Serializable {
...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043328#4043328
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043328
19 years