[JBoss Seam] - Re: TransactionalSeamPhaseListener + Spring @Transactional
by dapeng
anonymous wrote : You only need RC1 or snapshot if you wish to use spring managed local transactions that are automatically created and committed by seam in a faces request. Of if you want to use Seam's @Transactional annotation.
Is there a configuration example for using spring managed local tx? By talking "automatically created and committed by seam in a faces request", do you mean the code started by the seam filter (listener)? Is it correct, that Seam will start 2 txs (using spring tx manager) for each jsf request and all methods marked with spring @Transactional will just take part in the tx silently?
anonymous wrote : Yes you can use JpaTransactionManager and do transaction management in spring and not have to use the embedded-jboss and jta.
In tomcat6 the method getUserTransaction always exists with a NamingException(can not create resource) , if I haven't installed the embedded-jboss. Only NameNotFoundException is caught, no general NamingException. It results in a endless redirect loop. With Beta1 I only manage to get a running version with JTA and embedded-jboss.
anonymous wrote : <bean id="org.springframework.context.annotation.internalPersistenceAnnotationProcessor" class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
| | <property name="defaultPersistenceUnitName" value="seamEntityManagerFactory"/>
| | </bean>
| |
Are you sure the vlaue of defaultPersistenceUnitName should be seamEntityManagerFactory instead of something like customer-persistence-unit?
anonymous wrote :
| Configured the way I told you the PersistenceContext will be managed by Seam. If you want to take advantage of Seam's Conversation scoped PersistenceContexts then that is the way it will need to be. This in no way limits your ability to execute code asynchronously or outside of a Seam request though. Take a look at the spring-seam example. In there I was actually executing a spring configured timer task on a bean that used a Seam managed persistenceContext.
|
| There is nothing that says you cannot use a Spring managed Entitymanager it just means you won't be able to take advantage of a Conversation scoped EntityManager.
|
| Is there a particular reason why you would want to use a Spring managed EntityManager?
That was exact my question. I was not sure, whether the seam entity manager is available, if the request is not a JSF one, which runs through the seam filter (listener), but e.g. a WS-call, which is directed directly to Spring. If I understand you right, the entity manager is still available.
Anyway, your advice has been very valuable. Thanks a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074817#4074817
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074817
18Â years, 11Â months
[JBoss jBPM] - problem with attributes of Node - XPath
by yairfr
hi ,
i am showing a process with it's currrent task (Node) .
the code that retrieve the measurments of the red box that will wrap
the Node is :
| public int[] extractBoxConstraint(Element root, Token currentToken) {
| int[] result = new int[4];
| String nodeName = currentToken.getNode().getName();
| XPath xPath = new DefaultXPath("//node[@name='" + nodeName + "']");
| Element node = (Element) xPath.selectSingleNode(root);
| result[0] = Integer.valueOf(node.attribute("x").getValue()).intValue();
| result[1] = Integer.valueOf(node.attribute("y").getValue()).intValue();
| result[2] = Integer.valueOf(node.attribute("width").getValue()).intValue();
| result[3] = Integer.valueOf(node.attribute("height").getValue()).intValue();
| return result;
| }
|
the problem is that i get sometimes from the width and height attributes
value -1 .
can you please tell me what is the problem , and where, in the deployment itself or in the XPath .
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074809#4074809
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074809
18Â years, 11Â months
[JBoss Seam] - no such setter method: org.jboss.seam.security.Identity.secu
by jbeaken
Hello,
I hope someone can help me on this issue. I am using JBoss AS 4.2.1, Seam 1.2.1GA. I wish to use jboss rules security as defined in components.xml:
<drools:rule-base name="securityRules">
<drools:rule-files>
/security.drl
</drools:rule-files>
</drools:rule-base>
<security:identity authenticate-method="#{authenticator.authenticate}"
security-rules="#{securityRules}"/>
If I package the security jars
drools-compiler-3.0.5.jar
drools-core-3.0.5.jar
commons-jci-core-1.0-406301.jar
commons-jci-janino-2.4.3.jar
commons-lang-2.1.jar
janino-2.4.3.jar
stringtemplate-2.3b6.jar
antlr-2.7.6.jar
antlr-3.0ea8.jar
in the ear application I get the following exception on startup:
java.lang.RuntimeException: Could not create Component: org.jboss.seam.security.identity
at org.jboss.seam.init.Initialization.addComponent(Initialization.java:865)
at org.jboss.seam.init.Initialization.installComponents(Initialization.java:796)
at org.jboss.seam.init.Initialization.init(Initialization.java:503)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
at org.apache.catalina.core.StandardContext.listenerStart
..
..
Caused by: java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.security.Identity.securityRules
at org.jboss.seam.util.Reflections.getSetterMethod(Reflections.java:219)
at org.jboss.seam.Component.initInitializers(Component.java:401)
at org.jboss.seam.Component.(Component.java:263)
at org.jboss.seam.Component.(Component.java:203)
at org.jboss.seam.init.Initialization.addComponent(Initialization.java:851)
If I move the jar files into Jboss4.2.1/server/default/lib, the application startups with no problems. But then throws the following runtime exception :
org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
at org.jboss.seam.Component.newInstance(Component.java:1740)
at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:235)
at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:41)
at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397)
..
..
Caused by: org.drools.rule.InvalidRulePackage: Unable to create Field Extractor for 'name'
Unable to create Field Extractor for 'action'
Unable to create Field Extractor for 'name'
Rule Compilation error File Permissions/Rule_CanUserViewAllUsers_0.java, Line 10, Column 16: Expression "c.grant()" is not a type
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
... 52 more
..
..
In regards of the second exception, here is my security.drl
package Permissions;
import java.security.Principal;
import org.jboss.seam.security.PermissionCheck;
import org.jboss.seam.security.Role;
rule CanUserViewAllUsers
when
c: PermissionCheck(name == "userManager", action == "getAllUsers")
Role(name == "admin")
then
c.grant()
end;
Any help would be much apprecitated!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074805#4074805
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074805
18Â years, 11Â months
[JBoss Seam] - Seam 2.0Beta and merge problem
by Stateless Bean
Hi,
When I moved my app from Seam 1.2.1 Ga -> 2.0.Beta1 my ejb makes wrong merges, previously this worked on 1.0, to 1.2.1 wersion, but here i get null's
Take a look:
I got tables mapped like 1:n, one sided
| @OrderBy("index ASC")
| @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
| @JoinColumn(name="Planet_idPlanet")
| public List<BuildingsProd> getBuildingsProdList() {
| if (buildingsProdList == null)
| buildingsProdList = new LinkedList<BuildingsProd>();
| return buildingsProdList;
| }
|
first i load my "planet" object like
| Planet userPlanet = em.find...
|
and when i do somethink like this:
| BuildingsProd newStructure = new BuildingsProd();
| userPlanet.getBuildingsProdList().add(newStructure);
| em.merge(userPlanet);
| em.flush();
|
after that, new object is inserted into table BuildingsProd BUT without FK of my "planet" table. Don't know what is going on?
I use Seam 2.0 Beta1, and Jboss Embedded on Tomcat 6.0 whitch Postgres 8.2
For Tomcat i use: "postgresql-8.2-505.jdbc3.jar" driver
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074802#4074802
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074802
18Â years, 11Â months