[JBoss Seam] - Component scope w/ multiple Wars - Effect on SeamLoginModule
by 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:
| <security:identity authenticate-method="#{authenticator.authenticate}" />
|
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
18 years, 4 months
[JBossCache] - Re: CacheLoader is not notified when a POJO is modified
by dmary
Hi,
I've got no response so I will precise more detail :) :
- i'm running with JBoss 4.0.5 GA
- i've got the JbossCache 1.4.0 SP1 dist
I've read all tutorials on JBossCache (TreeCache and PojoCache), i've read the wiki (PojoCacheAS405) and I didn't understand why any interceptor is called when I modifity one field of my POJO.
->
I've got 3 POJOs : object A contains object B which also contains object C
The object A use @InstanceOfPojoCacheable and object B and C use @PojoCacheable
I've reached the instance of PojoCache throught a Mbean
MBeanServer server = MBeanServerLocator.locateJBoss();
| try {
| this.cache = (PojoCacheMBean) MBeanProxyExt.create(PojoCacheMBean.class, "jboss.cache:service=MyPojoCache", server);
| this.cache.addTreeCacheListener(new MyCacheListener());
| } catch (MalformedObjectNameException e) {
| e.printStackTrace();
| }
I put my object in cache with putobject :
public void putMobileUnit(ObjectA item) {
| try {
| this.cache.putObject(NODE+item.getImei(), item);
| } catch (CacheException e) {
| e.printStackTrace();
| }
| }
In one hand, reading tutorials, the annotation @InstanceOfPojoCacheable and @PojoCacheable is the only need (i've reached this point) to have AOP worked, in other hand, as it is said on wiki PojoCacheAS405, we need to specify precisly the classes needed to be instrumented/aspectized in jboss-aop.xml and choose between make a Ant script to make a compile-time instrumentation or to do a load time instrumentation.
Why ? Instrumentation isn't done by only write annotations ?
What aopc task really do ?
Thanks a lot for ur responses !!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110539#4110539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110539
18 years, 4 months
[JBoss jBPM] - jbpm-console + versioned seam backing bean
by apdo
Jbpm-console seam to be a very good starting point if we need to write an application that allow user to deploy is own defined processes.
In order to package the jbpm-console with additional feature specific to our customers, I plan to benefit for the ease of development that seam allows. I have written some small seam application. Then, I try to integrate the seam jar and required configuration in web.xml, faces-config.xml seam.properties...
Since then, the jbpm-console seems to work fine (I am able to initiated process, complete task ...). However, I keep getting the stack trace, which will follow, for almost every action I perform in the jbpm-console. Do you have an idea how to fix this?
The stack trace is something I have tried to fix. However, since the application seems to work fine, I have tried to use backing bean. I still have some problem (probably due to my short experience with seam) but I have been able to use the websale demo and add a call to a backing bean in the form.create.xhtml file. For now I have add to put my backing bean directly into the WEB-INF/classes/âÃÂæ folder. Does anybody have tried to have the seam backing been versioned in the par file like the action handler and forms are?
thanks in advance for you precious help,
An Phong Do
I have added the stack trace add content of configuration files here.
07-12-05 08:17:03,578 DEBUG [org.jbpm.persistence.db.DbPersistenceService] rolling back hibernate transaction
2007-12-05 08:17:03,578 DEBUG [org.hibernate.transaction.JDBCTransaction] rollback
2007-12-05 08:17:03,578 DEBUG [org.jbpm.persistence.db.DbPersistenceService] closing hibernate session
2007-12-05 08:17:03,578 ERROR [org.jbpm.svc.Services] problem closing service 'persistence'
org.jbpm.persistence.JbpmPersistenceException: hibernate commit failed
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:219)
at org.jbpm.svc.Services.close(Services.java:225)
at org.jbpm.JbpmContext.close(JbpmContext.java:139)
at org.jbpm.jsf.core.phase.JbpmPhaseListener.closeContext(JbpmPhaseListener.java:94)
at org.jbpm.jsf.core.phase.JbpmPhaseListener.afterPhase(JbpmPhaseListener.java:45)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.TransactionException: JDBC commit failed
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:130)
at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:256)
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:214)
... 38 more
Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
... 40 more
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- Seam -->
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<!-- Faces Servlet -->
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
</web-app>
Faces-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<!--
Use Facelets as the primary view handler. Since we have bookmarkable URLs,
add Gravel's query preserving view handler to the list.
-->
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</faces-config>
Components.xml
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core">
Seam.properties is empty
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110522#4110522
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110522
18 years, 4 months
[JBoss Seam] - Asynchronous method triggered multiple times.
by vfaid
I've a Stateless local Session Bean which defines an asynchronous method which is launched at startup by an observer method.
Everything works fine except that the method is triggered multiple times simultaneously. Any idea why?
Neither the TimeService implementation nor the Quartz implementation solves the issue.
Here's the Session Bean interface:
| @Local
| public interface SendMailJob {
|
| @Asynchronous
| public void processMailQueue(@Duration long start, @IntervalDuration long interval);
|
| }
|
Here's the Session Bean implementation:
| @Stateless(name = "SendMailJob")
| @Name("sendMailJob")
| public class SendMailJobImpl implements SendMailJob {
|
| @Resource(name="jdbc/luxair_asr_Datasource")
| private DataSource dataSource;
|
| @Resource(name="mail/luxair_asr_MailSession")
| private Session mailSession;
|
|
| @Logger
| private Log log;
|
|
| public void processMailQueue(long start, long interval) {
|
| // ...
| }
| }
|
Here's the component that launches the asynchronous method at startup:
| @Name("sendMailJobLauncher")
| public class SendMailJobLauncher {
| private long interval;
|
| public void setInterval(long interval) {
| this.interval = interval * 60 * 60 * 1000;
| }
|
| // ========
| // Resource
| // ========
|
| @In(create = true)
| private SendMailJob sendMailJob;
|
| @Logger
| private Log log;
|
| @Observer("org.jboss.seam.postInitialization")
| public void statup() {
| log.info("startup() launch sendMailJob [interval: {0}]", interval);
| sendMailJob.processMailQueue(2 * 60 * 1000, interval);
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110520#4110520
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110520
18 years, 4 months