[JBoss Seam] - Re: Serious issue getting a basic example of seam 2, jbpm, e
by mickknutson
Got that, and that helped. Thanks!
I have another isuue though as soon as that one was complete:
Exception during request processing:
Caused by javax.servlet.ServletException with message: "#{userService.startRegistration}: javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: userService.user"
Here is my UserServiceAction:
| package com.baselogic.yoursos.user;
|
| import org.hibernate.validator.InvalidStateException;
| import org.hibernate.validator.InvalidValue;
|
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.bpm.Actor;
| import org.jboss.seam.contexts.Context;
| import org.jboss.seam.faces.FacesMessages;
| import org.jboss.seam.security.Identity;
|
| import javax.annotation.Resource;
|
| import javax.ejb.Remove;
| import javax.ejb.SessionContext;
| import javax.ejb.Stateful;
|
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
|
| /**
| * User Service Bean.
| */
| @Stateful
| @Name("userService")
| public class UserServiceAction implements UserService {
|
| /** variable. */
| @PersistenceContext EntityManager em;
|
| /** variable. */
| @Resource SessionContext ctx;
|
| /** variable. */
| @In Context sessionContext;
|
| /** variable. */
| @In(create=true)
| @Out
| User user;
|
| /** variable. */
| @In FacesMessages facesMessages;
|
| /** variable. */
| @In Identity identity;
|
| /** variable. */
| String password = null;
|
| /**
| * todo DOCUMENT ME!
| *
| * @param password todo DOCUMENT ME!
| */
| public void setPasswordVerify(String password) {
| this.password = password;
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| public String getPasswordVerify() {
| return password;
| }
|
|
| /**
| * todo DOCUMENT ME!
| */
| @Begin(
| nested = true,
| pageflow = "registration"
| )
| public void startRegistration() {
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| public boolean isValidNamePassword() {
| boolean ok = true;
|
| if (!isUniqueName()) {
| facesMessages.add("userName", "This name is already in use");
| ok = false;
| }
|
| if (!isPasswordsMatch()) {
| facesMessages.add("passwordVerify", "Must match password field");
| ok = false;
| }
|
| return ok;
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| @SuppressWarnings("unchecked")
| private boolean isUniqueName() {
| String name = user.getUsername();
|
| /*if (name == null) return true;
|
| List<User> results = em.createQuery("select u from User u where u.userName = :name")
| .setParameter("name", name)
| .getResultList();
|
| return results.size() == 0;*/
| return true;
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| private boolean isPasswordsMatch() {
| String customerpass = user.getPassword();
|
| return (password != null) && (customerpass != null)
| && (customerpass.equals(password));
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| public String saveUser() {
|
| if (!isValidNamePassword()) {
| /////facesMessages.add("User name #{customer.userName} is not unique");
|
| return null;
| }
|
| try {
| em.persist(user);
| sessionContext.set("currentUser", user);
| Actor.instance().setId(user.getUsername());
|
| identity.setUsername(user.getUsername());
| identity.setPassword(user.getPassword());
| identity.login();
|
| facesMessages.addFromResourceBundle("createCustomerSuccess");
|
| return "success";
| } catch (InvalidStateException e) {
| InvalidValue[] vals = e.getInvalidValues();
|
| for (InvalidValue val : vals) {
| facesMessages.add(val);
| }
|
| return null;
| } catch (RuntimeException e) {
| ctx.setRollbackOnly();
|
| facesMessages.addFromResourceBundle("createCustomerError");
|
| return null;
| }
| }
|
| /*public Map<String, Integer> getCreditCardTypes() {
| Map<String, Integer> map = new TreeMap<String, Integer>();
| for (int i = 1; i <= 5; i++) {
| map.put(Customer.cctypes[i - 1], i);
| }
| return map;
| }*/
|
| /**
| * todo DOCUMENT ME!
| */
| @Remove public void destroy() {
| }
|
| } // The End...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098559#4098559
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098559
18Â years, 6Â months
[JBoss Seam] - VERY SIMPLE - but fails
by woo37830
Used jems to install new JBoss app server as ejb3 after uninstalling old one.
Downloaded new jboss-seam-1.2.1.GA
1) did seam setup with hsql and tested that i could do new-project, tweak
css and template and so forth in project seam-step1.
2) Attempted to do seam new-entity for entity User. no errors,
but when do http://localhost:8080/seam-step1/userList.seam it gives
error:
/userList.xhtml @21,65 rendered="#{empty userList.resultList}": Exception getting value of property resultList of base of type : com.shoulderscorp.entities.UserList_$$_javassist_6
3) Created new setup 'seam-step3' for mysql and existing database test_maintenance
which has simple tables Person, User, Role, User_Person_Assn, User_Role_Assn ( but no foreign keys in anything yet ).
4) did seam new project pointing to my mysql connector, etc.
5) did seam explode to check that basic app deployed and worked.
6) did seam generate-entities and got no errors.
7) Then did seam restart and http://localhost:8080/seam-step3/
8) Got new screen with list of Home, Person, User, Role, ... across top.
9) Verified that login worked and home buttons.
10) clicked on User link at top. get page with search and create.
11) since I had populated the User table with one row I typed in the name of that user and hit search. No error, no result.
12) I then tried create and it blew with:
Exception during request processing: javax.faces.el.EvaluationException: Exception while invoking expression #{userHome.wire}
Note: i'm just trying to do what the book says is straight forward.
It is advertised as even better than Ruby on Rails, but I can do this there very easily and it works. What is happening here? I want to be able to maintain some simple tables ( add users, roles, etc. ) , but then will be using ejbs for some other parts of an application along with workflow.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098551#4098551
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098551
18Â years, 6Â months
[JBoss Portal] - nested sar problem
by vinguye2
Hi,
I noticed that the binary download version is just a zip, and all child sar/war apps are exploded (i.e. portal-admin.sar). But, when using the source version, it deploys everything as zipped sars and wars separately, and portal-admin.sar is no longer inside the jboss-portal.sar deployment.
I'd like to bundle everything into one zipped sar so that the portal product is easier to distribute and deploy. So I took the zipped versions of the child apps (i..e. portal-admin.sar), and put them into the zipped version of jboss-portal.sar. So the structure looks like follows:
jboss-portal.sar
conf/
dtd/
lib/
META-INF/
portal-admin.sar
portal-ajax.war
...
But the problem is when the jboss-portal.sar is deployed, I don't see the correct portals like the admin, cms, etc. Only if everything is completely exploded and deployed as a directory, then all works fine.
I suspect that JBoss doesn't support a zipped sar nested in another zipped sar, but I can't seem to find any info to confirm this. Does anyone have any idea or solution to this problem? Any help is appreciated...thanks!
-Vinh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098539#4098539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098539
18Â years, 6Â months