[JBoss Seam] - Database flush problem
by mirko27
We have non-seam component entity - Client.class
We outject it to session context while logging in:
| @In(required = false, value="client")
| @Out(value = "client", required = false, scope = ScopeType.SESSION)
| private Client user;
| @In
| private EntityManager em;
| public boolean authenticate() {
| try {
| user = (Client) em.createQuery(
| "from Client where email = :username and password = :password").setParameter("username", Identity.instance().getUsername()).setParameter("password", sha1(Identity.instance().getPassword())).getSingleResult();
| }
|
The client is outjected to session scope ( seen from debug.seam)
So then we have a page with a form to change client`s data.
| <ice:form>
| <h:inputText id="firmName" styleClass="w120" value="#{client.name}"/>
| <ice:commandButton action="update" />
| </ice:form>
|
When I press the button, the data is changed inside client in session scope (debug.seam).
But this data is not flushed to database. I am using SMPC and it is extended persistence context right? Therefore all the entities retrieved from entitymanager (client is retrieved from smpc as seen in code example) should get automatically flushed. When I log out the modified data is lost and new login has old values.
Am I missing a point here?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116278#4116278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116278
18 years, 3 months
[JBoss Seam] - Re: Using Seam as a simple IoC bean factory in console app
by rhasselbaum
For what it's worth, I found a workable solution in my case. I'm using Spring anyway instead of EJB, and I really only need Spring beans for my console applications. The problem was that I configured Spring/Seam to use Seam-managed (conversation-scoped) Hibernate sessions via the SeamManagedSessionFactoryBean. But this was causing transactions to fail outside of the web container because Seam wasn't initialized.
The solution was to configure Spring's ApplicationContext to fall back to Spring-managed Hibernate sessions when running outside of the web container, which removes the dependency on Seam. One can set this up by creasing a bean alias (called, say, "sessionFactory") that points to the product of either SeamManagedSessionFactoryBean or Spring's AnnotationSessionFactoryBean. All Spring beans that need access to the session factory bind to the alias, and the implementation can be chosen at runtime (e.g. using a PropertyPlaceholderConfigurer).
Obviously, this won't work for everyone, and it kind of sidesteps the issue of bootstrapping Seam outside of a web container. (That would still be nice!) But if your application happens to use Spring anyway, it might be a workaround.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116272#4116272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116272
18 years, 3 months
[JBoss/Spring Integration] - Re: Jboss 5 Beta 2 and Spring Deployer
by ragavgomatam
Found the cause. It appears that the new jboss-spring.jar under Spring Deployer 3.0 does not have JMX MBean classes in it. Check ou the error I get.
Caused by: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:102)
My jboss-service.xml is as follows :-
<?xml version="1.0" encoding="UTF-8"?>
| <server>
| <!-- The JBoss Spring Deployer -->
| <mbean code="org.jboss.spring.deployers.ApplicationContextDeployer"
| name="jboss.spring:service=SpringApplicationContextDeployer" />
| </server>
|
My jboss-service.xml for jboss 4.2.1 which worked fine was :-
<?xml version="1.0" encoding="UTF-8"?>
| <server>
| <!-- The JBoss Spring Deployer -->
| <mbean code="org.jboss.spring.deployment.SpringApplicationContextDeployer"
| name="jboss.spring:service=SpringApplicationContextDeployer" />
| </server>
This worked fine with jboss-4.2.1 and Spring Deployer 1.3. But with Spring Deployer 3.0, the classes within the jboss-spring.jar have changed & we see no jmx MBean class. So the -service.xml does not deploy with the new jar.
Ales any clues on this ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116271#4116271
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116271
18 years, 3 months
[JBoss/Spring Integration] - Re: Jboss 5 Beta 2 and Spring Deployer
by ragavgomatam
I tried to deploy the Spring Deployer 3 on Jboss 5 beta 3. I get the following error:-
15:39:05,375 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
| 15:39:19,922 ERROR [AbstractKernelController] Error installing to Instantiated: name=jboss.spring:service=SpringApplicationConte
| org.jboss.deployment.DeploymentException: Unable to createMBean for jboss.spring:service=SpringApplicationContextDeployer
| at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:52)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:141)
| at org.jboss.system.microcontainer.InstantiateAction.installAction(InstantiateAction.java:45)
| at org.jboss.system.microcontainer.InstantiateAction.installAction(InstantiateAction.java:37)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.j
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:255)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
| at org.jboss.system.ServiceController.doChange(ServiceController.java:659)
| at org.jboss.system.ServiceController.install(ServiceController.java:272)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:98)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:238)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
| at org.jboss.Main.boot(Main.java:208)
| at org.jboss.Main$1.run(Main.java:534)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:102)
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100)
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100)
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100)
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100)
| at org.jboss.mx.metadata.MBeanCapability.of(MBeanCapability.java:100)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:193)
| at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1359)
| at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:345)
| at org.jboss.system.ServiceCreator.installPlainMBean(ServiceCreator.java:197)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:115)
| ... 38 more
| 15:39:19,953 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/jboss-5.0.0.Beta3/server/default/deploy
| org.jboss.deployment.DeploymentException: Unable to createMBean for jboss.spring:service=SpringApplicationContextDeployer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116270#4116270
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116270
18 years, 3 months
[JBoss Seam] - Re: How to control end of conversations/state of stateful be
by trouby
Alright,
Well, sorry for being so annoying but I still don't get the point,
If I have buttons that should start a conversation, propagation='none' is not an option,
big part of my buttons start a new conversation, so no matter what, I find myself adding join=true, at least for these buttons,
But as it seems most of the people are comfortable with it, I still find it really confusing and not exactly correct,
What I think is that it might be useful to have an option to end/start a new conversation on the same method/link/etc...
Asaf.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116268#4116268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116268
18 years, 3 months