[Persistence, JBoss/CMP, Hibernate, Database] - Problem when trying to configure transaction manager
by sdsani
Hi,
I am creating a simple application using JSF, Spring and Hibernate. Everything works fine and now i am trying to configure transaction manager from Spring. Following are the steps that i took.
Spring Context file
| <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
| <property name="transactionManagerName" value="java:/TransactionManager"/>
| <property name="userTransactionName" value="UserTransaction"/>
| </bean>
|
| <bean id="transactionAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor" >
| <constructor-arg index="0">
| <ref local="transactionPointcut"/>
| </constructor-arg>
| <constructor-arg index="1">
| <ref local="transactionAdvice"/>
| </constructor-arg>
| </bean>
| <bean id="transactionPointcut" class="org.springframework.aop.support.NameMatchMethodPointcut" >
| <property name="mappedNames">
| <list>
| <value>*</value>
| </list>
| </property>
| </bean>
| <bean id="transactionAdvice" class="org.springframework.transaction.interceptor.TransactionInterceptor" >
| <property name="transactionManager" ref="transactionManager" />
| <property name="transactionAttributeSource">
| <value>
| service.DeptBean.*=PROPAGATION_REQUIRED, -CommandException
| service.EmployBean.*=PROPAGATION_REQUIRED, -CommandException
| </value>
| </property>
| </bean>
|
Next i included cglib-2.1.3.jar and asm-3.1.jar in my application path. Now when i deploy my application i am getting following error. Please advice.
| org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employBean' defined in ServletContext resource [/WEB-INF/config/appContext.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215083#4215083
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215083
15 years, 10 months
[Beginners Corner] - Unable to load service NamingService in jboss-service.xml
by JRookie_2402
Hi everybody,
jboss will not start becaus of an error
00:30:00,062 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** CONTEXTS IN ERROR: Name -> Error
vfsfile:/F:/Entwicklung/JBoss_5.0/jboss-5.0.0.GA/server/default/conf/jboss-service.xml -> java.lang.NoSuchMethodError: org.jnp.interfaces.NamingContext.get
Local()Lorg/jnp/interfaces/Naming;
I think he is unable to load the service. In my jboss-service.xml I find
bin in mbean
<mbean code="org.jnp.server.NamingBeanImpl"
name="jboss:service=NamingBeanImpl"
xmbean-dd="resource:xmdesc/NamingBean-xmbean.xml">
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
<!-- The call by value mode. true if all lookups are unmarshalled using
the caller's TCL, false if in VM lookups return the value by reference.
-->
false
and the files xmdesc/NamingBean-xmbean.xml are there alright.
What is it ? Has anyone an idea.
Its the offical Duke's Bank stuff .....
regards
JRookie
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215070#4215070
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215070
15 years, 10 months
[EJB/JBoss] - how to turn on ejb transaction demarcation?
by kannattaa
hello!
i have jboss-4.2.3GA and example from jboss-seam-2.1.1.GA sources (seam-booking)
i want to save user in a transaction and then change his name in another transaction, so some changes were made in RegisterAction.java:
public void register()
| {
| if ( user.getPassword().equals(verify) )
| {
| List existing = em.createQuery("select u.username from User u where u.username=#{user.username}")
| .getResultList();
| if (existing.size()==0)
| {
| persistUser();
|
| user.setName(user.getName() + "1");
| persistUserWithException();
|
| facesMessages.add("Successfully registered as #{user.username}");
| registered = true;
| }
| else
| {
| facesMessages.addToControl("username", "Username #{user.username} already exists");
| }
| }
| else
| {
| facesMessages.addToControl("verify", "Re-enter your password");
| verify=null;
| }
| }
|
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| private void persistUser() {
| em.persist(user);
| }
|
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| private void persistUserWithException() {
| em.persist(user);
| throw new RuntimeException();
| }
this expects that user with original name will be persisted, but change of his name won't apply.
but this doesn't work. both operations will be rollbacked because they are in the same transaction.
what's wrong? please help me!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215051#4215051
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215051
15 years, 10 months