[JBoss Seam] - YEAAAAAHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!
by JUnkie
IT FINALLY WORKS!!!
I've just added equals() to my PaymentMethod entity like this:
public boolean equals(Object o){
| PaymentMethod pm = (PaymentMethod)o;
| if (pm.getId() == this.getId()){
| return true;
| }
| return false;
| }
Did the same thing for all my other entities and my other controls work without workaround now.
PETE: YOU ROCK!!
I can't really express how thankful I am for your help. This issue really drove me crazy. But it's soooo good to know to get good support for this great Seam framework and to see that it really works.
Again: Thank you very much for your help and your patience, Pete.
If you think you now know why I was running into the issue I would appreciate it if you could post it briefly. Might be very interesting for others, too.
tears of joy in my eyes :-)))
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069286#4069286
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069286
18Â years, 8Â months
[JBoss jBPM] - Re: java.lang.NoClassDefFoundError: javax/transaction/Synchr
by dleerob
I had the same problem when first trying out my "test" class. I used all the libraries that the deployment chapter in the JBPM documentation said you should use. I havent quite yet figured out exactly what library it needs, but I sorted it out for now by using all the files in the lib dir, from the jbpm-jpdl-suite-3.2.1 download. It worked fine after that, and I will let you know what lib it is when I have time to find out exactly which one it needs. In the mean time, here is my list of libraries:
| activation.jar
| antlr-2.7.6.jar
| asm.jar
| bsh.jar
| cglib.jar
| commons-collections.jar
| commons-logging.jar
| dom4j.jar
| hibernate.cfg.xml
| hibernate3.jar
| hsqldb.jar
| jboss-backport-concurrent.jar
| jboss-j2ee.jar
| jboss-retro-1.1.0-rt.jar
| jbpm-identity.jar
| jbpm-jpdl.jar
| jbpm.cfg.xml
| jcr-1.0.jar
| junit.jar
| mail.jar
| mysql-connector-java-5.0.3-bin.jar
| servlet-api.jar
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069285#4069285
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069285
18Â years, 8Â months
[JBoss Seam] - Re: external authentication-any pointers for a beginner?
by mwkohout
After updating to the head of cvs, I'm able to get this stuff to work.
For the most part.
But, one problem remains-on the first view of a protected resource(like wildcarded restriction below), the user is not being forced to authenticate:-). On the second request, when the jsessionid cookie of the server is set, authentication occurs and the correct things seem to happen.
| <page view-id="*">
| <restrict>#{identity.isLoggedIn(true)}</restrict>
| <navigation>
| <rule if-outcome="home">
| <redirect view-id="/home.xhtml"/>
| </rule>
| </navigation>
| </page>
|
if my description is vague, here's a list of actions and their results.
1)A user makes a request to the server(let's say it's http://localhost/JAASTest). The user doesn't have a jsessionid cookie.
2)the server, upon reciept of the user's request, creates a jesssionid cookie and sends it back on the response. The server also renders the protected resource and returns that back to the user.
*****at this step, the user should have been forced to authenticate****
3)the user then makes another request to the protected resource.
4)The server then forces authentication and good things seem to happen.
I'm thinking my error is occurring in my custom Identity class-maybe I'm missing a critial annotation or I'm misunderstanding about when Seam starts a session or something. Does anyone see what I'm doing wrong?
| import static org.jboss.seam.ScopeType.SESSION;
| import edu.umn.ictr.mentor.action.CookieCallbackHandler;
| import edu.umn.ictr.mentor.action.X500LoginModule;
| import javax.security.auth.callback.CallbackHandler;
| import javax.security.auth.login.Configuration;
| import javax.security.auth.login.LoginContext;
| import javax.security.auth.login.LoginException;
| import javax.servlet.http.Cookie;
| import org.jboss.seam.Component;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.Startup;
| import org.jboss.seam.annotations.intercept.BypassInterceptors;
| import org.jboss.seam.contexts.Contexts;
| import org.jboss.seam.core.Events;
| import org.jboss.seam.core.Expressions;
| import org.jboss.seam.security.AuthorizationException;
| import org.jboss.seam.security.Identity;
| import org.jboss.seam.log.LogProvider;
| import org.jboss.seam.log.Logging;
| import org.jboss.seam.security.RuleBasedIdentity;
|
|
| /**
| *
| * @author mwkohout
| */
| @Name(value = "org.jboss.seam.security.identity")
| @Scope(value = SESSION)
| @Startup
| public class X500Identity extends Identity {
|
| private static final LogProvider log = Logging.getLogProvider(X500Identity.class);
|
| @In("org.jboss.seam.security.configuration")
| Configuration config;
|
|
|
| private Cookie X500Cookie;
|
|
|
| public X500Identity()
| {
| setJaasConfigName("default");
| setAuthenticateEveryRequest(true);
| log.error("in X500Identity constructor. jaas config name = "+this.getJaasConfigName());
| }
| @Override
| public void create()
| {
| super.create();
| }
|
| public Cookie getX500Cookie() {
| return X500Cookie;
| }
|
| public void setX500Cookie(Cookie X500Cookie) {
| this.X500Cookie = X500Cookie;
| }
|
|
| public Configuration getConfig() {
| return config;
| }
|
| public void setConfig(Configuration config) {
| log.error("in setConfig. config = "+config);
| this.config = config;
| }
|
| @Override
| protected LoginContext getLoginContext() throws LoginException {
| log.error("in my getLoginContext()");
|
| if (getJaasConfigName() == null) {
| throw new RuntimeException("In X500Identity. JAAS config name not set. Please set it up.");
| }
| if( config == null )
| throw new RuntimeException("In X500Identity. \"org.jboss.seam.security.configuration\" component not injected. Please set it up.");
|
| log.error( "new LoginContext(getJaasConfigName(), getSubject(), getDefaultCallbackHandler(), config)=+new LoginContext("+getJaasConfigName()+","+ getSubject()+","+ getDefaultCallbackHandler()+","+ config+")");
| log.error("config's # of app configurationEntry's entries= "+config.getAppConfigurationEntry("default").length);
| log.error("config's app configurationEntry's LoginModuleName= "+config.getAppConfigurationEntry("default")[0].getLoginModuleName());
| return new LoginContext(getJaasConfigName(), getSubject(), getDefaultCallbackHandler(), config);
| }
|
| @Override
| public CallbackHandler getDefaultCallbackHandler() {
| log.error("in my getDefaultCallbackHandler()");
| return new CookieCallbackHandler();
| }
|
|
|
| @Override
| public void checkRestriction(String expr) {
| log.error("in my checkRestriction(String expr) expr=" + expr);
| if (!evaluateExpression(expr)) {
| if (!isLoggedIn()) {
| this.login();
| } else {
| Events.instance().raiseEvent("org.jboss.seam.notAuthorized");
| throw new AuthorizationException(String.format("Authorization check failed for expression [%s]", expr));
| }
| }
| }
|
|
|
|
| public static X500Identity instance() {
| if (!Contexts.isSessionContextActive()) {
| throw new IllegalStateException("No active session context");
| }
|
| X500Identity instance = (X500Identity) Component.getInstance(X500Identity.class, ScopeType.SESSION);
|
| if (instance == null) {
| throw new IllegalStateException("No Identity could be created");
| }
|
| return instance;
| }
| }
|
thanks
Mike Kohout
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069279#4069279
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069279
18Â years, 8Â months
[JBoss Seam] - Malformed xhtml doc w/ Facelets in Seam 2.0.0.Beta1?
by cupdike
This is from a seam-gen'd app running on JBoss AS 4.2. The log is showing:
12:01:36,031 ERROR [STDERR] Jul 31, 2007 12:01:36 PM com.sun.facelets.FaceletViewHandler handleRenderException
| SEVERE: Error Rendering View[/PpAdhocItemList.xhtml]
| java.lang.RuntimeException: org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
| at org.jboss.seam.navigation.Pages.getDocumentRoot(Pages.java:943)
| ...
FWICT, this happens when there is content before the "prolog" line identifying the doc type. The facelets error page shows the following tree:
<AjaxViewRoot id="_viewRoot" immediate="false" locale="en" renderKitId="HTML_BASIC" renderRegionOnly="false" rendered="true" selfRendered="false" submitted="false" transient="false" viewId="/PpAdhocItemList.xhtml">
|
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
|
| <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>AutoPropPass3</title> <link href="stylesheet/theme.css" rel="stylesheet" type="text/css"/> </head> <body>
|
| <HtmlToolBar id="j_id2" itemSeparator="none" rendered="true" transient="false" width="100%">
| ...
What the heck is causing the AjaxViewRoot tag to go in there before the prolog line? I haven't put any AjaxViewRoot tags in the code myself.
Thanks, Clark
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069276#4069276
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069276
18Â years, 8Â months