[jboss-user] [JBoss Seam] - Re: Request param acquire

2008-01-25 Thread mrobinson28
This is possible but not with the javax.faces API. You would have to fall back 
to the servlet API. 

Note the differences: 

http://java.sun.com/javaee/5/docs/api/javax/faces/context/ExternalContext.html#getRequestParameterMap()

http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameterMap()

I think something like this should work: 


  | ServletRequest request  = 
(ServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
 
  | 
  | // the map contains keys as String and values as String []
  | Map params = request.getParameterMap();
  | 



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123592#4123592

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123592
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Email with Icefaces

2008-01-19 Thread mrobinson28
anonymous wrote : I suggest posting on the icefaces forum, and post a link back 
here.

It looks like someone already beat me to it: 

http://www.icefaces.org/JForum/posts/list/6923.page

Thanks for the help.



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121575#4121575

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121575
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Email with Icefaces

2008-01-16 Thread mrobinson28
A have searched and found several related posts/issue about problems 
integrating Seam email when using Icefaces's JSF implementation. Such as: 

http://jira.jboss.org/jira/browse/JBSEAM-827
http://jira.jboss.org/jira/browse/JBSEAM-977
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103086
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112973

Some of these sort of appear to be old or out of date so I am searching to see 
if there is a possible work around to get this working. 

My environment is Seam 2.0.0.GA, Icefaces 1.6.2, and JBoss 4.2.2. The mail 
session is configured as a JNDI resource in JBoss and made available to the 
application using: 



My facelet pages for the email are taken from the mail example. The renderer is 
being injected using: 


  | @In 
  | private Renderer renderer;
  | 

and the relevant method to send the email is: 


  | public void send() {
  | try {
  | renderer.render("/distribution/lead.xhtml");
  | facesMessages.add("Email sent successfully");
  |   } catch (Exception e) {
  |  log.error("Error sending mail", e);
  |  facesMessages.add(FacesMessage.SEVERITY_INFO, "Email sending 
failed: " + e.getMessage());
  |   }
  | }
  | 

Stacktrace: 


  | 
  | java.lang.IllegalStateException: Application was not properly initialized 
at startup, could not find Factory: javax.faces.render.RenderKitFactory
  | at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
  | at 
com.icesoft.faces.context.BridgeFacesContext.getRenderKit(BridgeFacesContext.java:184)
  | at 
org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.init(FaceletsRenderer.java:104)
  | at 
org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.run(FaceletsRenderer.java:77)
  | at 
org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:169)
  | at 
com.onlineinsight.service.interview.DistributionActionBean.send(DistributionActionBean.java:75)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:597)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  | ...
  | ...
  | 

Thanks, 

Michael 



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120496#4120496

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120496
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Component scope w/ multiple Wars - Effect on SeamLoginMo

2008-01-16 Thread mrobinson28
If it helps anyone else who comes along I did find this related post: 

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=81910

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120480#4120480

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120480
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Component scope w/ multiple Wars - Effect on SeamLoginModule

2007-12-05 Thread mrobinson28
First of all the Seam security stuff is awesome! 

I have a question though regarding the scope of components. From searching 
through some other post on the forum I think that Seam components are created 
and scoped at the War level. Is this correct? e.g. If I have an Ear with 
multiple War files, then each War would need to "deploy" the components that it 
requires. 

Assuming this is true my problem seems to be with the SeamLoginModule and how 
it works in this scenrio of multiple War files packaged into one Ear. For 
example lets say we have two War files, A and B respectively. War project A 
configures Seam authentication using: 


  |  
  |   

War project B does not configure any security mechanisms. When the application 
is deployed attempting to login to project A fails silently and the 
authenticate method is never invoked. A FacesMessage of "Login Failed" is 
displayed. Declaring the authenticate-method in project B causes the 
authentication to work properly. Also if War project B is removed from the 
deployment entirely then authentication also works properly. 

Is it possible to scope the authentication this way? 

Thanks, 

Michael 




View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110540#4110540

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110540
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Pageflow

2007-06-21 Thread mrobinson28
JIRA issue is:

http://jira.jboss.org/jira/browse/JBSEAM-157

Thought this might help anyone else looking for this type of functionality. 

Michael 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056529#4056529

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056529
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Pageflow

2007-06-21 Thread mrobinson28
This is it right? 

http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/numberguess/resources/pageflow.jpdl.xml?r=1.11

Nice! 

Michael 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056500#4056500

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056500
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Pageflow

2007-06-21 Thread mrobinson28
I have a similar need where I want a main pageflow who dispatches to 
sub-systems that have their own pageflow. At any point the parent pageflow may 
need to resume, make a decision, and dispatch again. Currently it doesn't look 
like you can transition to a completely separate pageflow from a decision node. 

Is this possible by programmatically starting the pageflow using the Seam API 
e.g perhaps an action listener begins nested pageflows? 

Michael 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056460#4056460

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056460
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: TestNG @PersistenceContext Error

2007-04-24 Thread mrobinson28
I have had similar problems with testing that I have yet to resolve but thought 
this information might be  helpful. 

The following post: 

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=100083

looks like it might be related. 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040166#4040166

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040166
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Creating PDFs Programmatically

2007-04-16 Thread mrobinson28
Seam is using iText: 

http://www.lowagie.com/iText/

http://docs.jboss.com/seam/1.2.1.GA/reference/en/html_single/#itext

Michael

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037801#4037801

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037801
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: DataModel: Row is not available

2007-04-16 Thread mrobinson28
Is the documentation incorrect? 

seam reference docs wrote : 
  | @DataModel
  | 
  | Exposes an attribute of type List, Map, Set or Object[] as a JSF DataModel 
into the scope of the owning component...
  | 

I believe that the standard JSF datatable only supports a limited number of 
types (not java.util.Set ) which seems to cause problems for one-to-many 
relationships where the "most natural" type of association is a Set.  The 
hibernate documentation seems to really make a point of this being the most 
correct mapping where there are not any duplicates but then you can't render it 
using the stock datatable. The last time I tried it the MyFaces implementation 
actually "incorrectly" supported the rendering of a Set within a datatable but 
there were discussions about "fixing" the implementation to not support it. 


Can you show how you add to the Collection? and mabye the .xhtml (assuming 
Facelets)


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037799#4037799

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037799
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Back...

2007-04-16 Thread mrobinson28
Integration Testing: 

My original question/thread:

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=106363

Then I saw this thread and noticed the similarities in the exceptions: 

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=100083

Thanks, 

Michael 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037719#4037719

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037719
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: configuring integration testing with TestNG in eclipse

2007-04-16 Thread mrobinson28
I think I am experiencing a similar problem and just realized it. Sorry that I 
didn't see this thread and the similarities sooner. 

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=106363

The only difference is that I am not using seam-gen... but I have an action 
class that I am trying to integration test and the class contains 
@PersistenceContext. W/ this annotation in the class I receive the 
NameNotFoundException. 

gavin wrote : 
  | This was a bug in seam-gen in 1.1.1. I've fixed it in CVS.
  | 

Was the bug part of the jboss-seam-gen.jar or possibly a different artifact? 

Did the fix make it into Seam 1.2.1.GA? 


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037709#4037709

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037709
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Simple question about sample apps with Seam

2007-04-13 Thread mrobinson28
I think this pretty much sums up how the import script is executed: 

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89473


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037226#4037226

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037226
___
jboss-user mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Unit Testing EL in EJB-QL/HQL

2007-04-13 Thread mrobinson28
Ok, in my unit test I originally had: 

  | EntityManager entityManager = emf.createEntityManager();
  |  
I have replaced it with: 

  | EntityManager entityManager = new EntityManagerProxy( 
emf.createEntityManager() );
  | 

Now the exception is: 
 
  | java.lang.IllegalStateException: No application context active
  | at org.jboss.seam.ScopeType.getContext(ScopeType.java:139)
  | at org.jboss.seam.Component.getInstance(Component.java:1589)
  | at org.jboss.seam.Component.getInstance(Component.java:1567)
  | at org.jboss.seam.Component.getInstance(Component.java:1562)
  | at org.jboss.seam.core.Expressions.instance(Expressions.java:219)
  | at org.jboss.seam.persistence.QueryParser.(QueryParser.java:60)
  | at org.jboss.seam.persistence.QueryParser.(QueryParser.java:33)
  | at 
org.jboss.seam.persistence.EntityManagerProxy.createQuery(EntityManagerProxy.java:57)
  | 

The class/method that I am attempting to unit test looks like: 

  | @Stateful
  | @Scope(ScopeType.SESSION)
  | @Name("userBrowser")
  | @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  | public class UserBrowserAction implements Serializable, UserBrowser {
  | 
  | @Logger 
  | private Log log; 
  | 
  | @PersistenceContext
  | private EntityManager entityManager;
  | 
  | @DataModel
  | private List users;
  | 
  | @DataModelSelection(value = "users")
  | private User selectedUser;
  | 
  | @Factory("users")
  | @Observer("newUserRegistered")
  | @SuppressWarnings("unchecked")
  | public void getUsers() {
  | log.debug("Invoke factory for users");
  | 
  | this.users = this.entityManager.createQuery("from User user where 
user.username <> #{currentUser.username} ").getResultList(); 
  | 
  | log.debug("Found #0 users", this.users.size()); 
  | }
  | 
  | @Destroy
  | @Remove
  | public void destroy() {
  | }
  | }
  | 
My unit test is: 

  | public class UserBrowserTest extends SeamTest {
  | 
  | @Test (groups = "unit")
  | @SuppressWarnings("unchecked")
  | public void testGetUsers() throws Exception {
  | EntityManagerFactory emf = 
Persistence.createEntityManagerFactory("test-persistence-unit");
  | EntityManager entityManager = new EntityManagerProxy( 
emf.createEntityManager() );
  | 
  | // create a log to inject
  | Log log = Logging.getLog(UserBrowserAction.class);
  | 
  | UserBrowser userBrowser = new UserBrowserAction();
  | 
  | super.setField(userBrowser, "entityManager", entityManager);
  | super.setField(userBrowser, "log", log);
  | 
  | // invoke method
  | userBrowser.getUsers();
  | 
  | // inspect the property 
  | List users = (List) super.getField(userBrowser, 
"users");
  | 
  | assert users != null;
  | assert users.size() == 2;
  | }
  | }
  | 

So my questions:

  | *  From the exception it looks like I may have to provide more than I am 
currently via something in org.jboss.seam.mock.* e.g currentUser (In the 
application currentUser is a session scoped component that is instantiated when 
a user logs in). Are there any examples of using these mock objects anywhere? 
  | *  Currently I am extending SeamTest which I understand is used for 
integration testing. Is it incorrect to do this when unit testing; several of 
the methods provided seem helpful in unit testing also. Would it be feasible to 
override init so that the embedded container is not started for stand alone 
unit test (or maybe have something like SeamUnitTest? 
  | *  In general I seem to be having difficulties writing unit test because it 
occurs over and over again that some method is accessing a variable that is 
within scope during normal program executions e.g. in the code above 
currentUser is within scope but is not injected into the component that is 
accessing it. Is this bad practice? I tested re-writing the class that I am 
trying to test to contain and instance of the currentUser object injected using 
@In and then accessing that object from the method that performs the query and 
this works, both in the application and in my unit test if I manually inject 
that object. 
  | *  Is it possible to manually inject objects into different scopes 
programmatically for unit testing? 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037218#4037218

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037218
___
jboss-user mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - SeamLoginModule Error invoking login method

2007-04-12 Thread mrobinson28
I am attempting to write (mostly copy from example s ;)  an integration test 
for a simple login process. I am using Seam 1.2.1.GA, EEJB, hsqldb, etc. The 
only difference that I can see from the examples is that I am building w/ 
Maven2...hopefully this is not the  issue :(  When I execute the test I 
received the following exception: 


  | 16:21:24,384 - ERROR [SeamLoginModule] Error invoking login method
  | org.jboss.seam.InstantiationException: Could not instantiate Seam 
component: authenticator
  | at org.jboss.seam.Component.newInstance(Component.java:1708)
  | at org.jboss.seam.Component.getInstance(Component.java:1611)
  | at org.jboss.seam.Component.getInstance(Component.java:1578)
  | at org.jboss.seam.Component.getInstance(Component.java:1572)
  | at 
org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
  | at 
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:135)
  | at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
  | at com.sun.el.parser.AstValue.getTarget(AstValue.java:62)
  | at com.sun.el.parser.AstValue.invoke(AstValue.java:147)
  | at 
com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
  | at 
org.jboss.seam.util.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:36)
  | at 
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  | at 
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  | at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:106)
  | at 
org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:104)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:597)
  | at 
javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
  | at 
javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
  | at 
javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
  | at java.security.AccessController.doPrivileged(Native Method)
  | at 
javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
  | at 
javax.security.auth.login.LoginContext.login(LoginContext.java:575)
  | at org.jboss.seam.security.Identity.authenticate(Identity.java:249)
  | at org.jboss.seam.security.Identity.authenticate(Identity.java:242)
  | at org.jboss.seam.security.Identity.login(Identity.java:172)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:597)
  | at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
  | at 
com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
  | at 
org.jboss.seam.util.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:36)
  | at 
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  | at 
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  | at 
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  | at 
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  | at 
org.jboss.seam.mock.SeamTest$Request.invokeMethod(SeamTest.java:401)
  | at 
com.onlineinsight.service.system.security.AuthenticatorTest$1.invokeApplication(AuthenticatorTest.java:25)
  | at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:489)
  | at 
com.onlineinsight.service.system.security.AuthenticatorTest.testLogin(AuthenticatorTest.java:12)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:597)
  | at 
org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
  | at org.testng.internal.Invoker.invokeMethod(Invoker.java:411)
  | at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:785)
  | at 
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:114)
  | at org.testng.TestRunner.privateRun

[jboss-user] [JBoss Seam] - Unit Testing EL in EJB-QL/HQL

2007-04-12 Thread mrobinson28
Is it possible to write a unit test for a method that uses EL expressions 
within EJB-QL/HQL?  I attempted to do this and get the exception: 

 javax.persistence.PersistenceException: org.hibernate.QueryException: 
unexpected char: '#' 

The documentation states that: 

 Seam proxies the EntityManager or Session  object whenever you use a 
Seam-managed persistence context or inject a container managed persistence 
context using @PersistenceContext.

Does this not occur if the EntityManager is set using SeamTest and setField? 

Michael

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036697#4036697

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036697
___
jboss-user mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/jboss-user