[JBoss Seam] - Re: SMPC and forcing a transaction to commit
by SmokingAPipe
And I tried something like this:
@TransactionManagement(TransactionManagementType.BEAN)
| public class .....
|
| @Resource SessionContext sessionContext;
|
| public void beanSend() {
| final UserTransaction userTransaction = sessionContext.getUserTransaction();
| try { userTransaction.begin(); }
| catch(NotSupportedException nse) { logger.severe("NotSupportedException: " + nse); }
| catch(SystemException nse) { logger.severe("SystemException: " + nse); }
| smpc.persist(myEntity);
| try { userTransaction.commit(); }
| catch(RollbackException nse) { logger.severe("RollbackException: " + nse); }
| catch(HeuristicMixedException nse) { logger.severe("HeuristicMixedException: " + nse); }
| catch(HeuristicRollbackException nse) { logger.severe("HeuristicRollbackException: " + nse); }
| catch(SystemException nse) { logger.severe("SystemException: " + nse); }
|
and it still doesn't work. The entity persists just fine but the MDB can't find it in its PersistenceContext.
I'm quite baffled by how to force something to really really commit and really reall flush and whatever else.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013485#4013485
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013485
19Â years, 2Â months
[JNDI/Naming/Network] - Re: look Database not effect (Urgent). Please!
by changemylife
Hello world !
Today, I try all things again but I also failure.
When I install JBoss server, I selected mysql and DataSource name is: DefaultDS, and I created "mydatabase" that include Users and Roles. My code on the client have contents:
-----
LoginContext lc = new LoginContext("userTest", new MyCallbackHandler());
lc.login();
.....
props.put("java.naming.provider.url","jnp://violon:1099");
InitialContext ctx = new InitialContext(props);
Operates obj = (Operates)ctx.lookup("OperatesBean/remote");
...... and here, I do two methods that correlative each role
-----
But after I enter username and passwd, on the server don't check informations of the specify person that I entered (username and passwd). This is mean, the DatabaseServerLoginModule that I declare inside file "login-config.xml" not effect. And when, any informations that I enter can call two methods ! I am sure that JBoss server bound DataSource beacause when I run Server, I saw the fragment message:
-----
11:15:39,632 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS '
-----
My auth.config on the client has contents:
-----
userTest {
org.jboss.security.ClientLoginModule required;
};
-----
My ejb-jar.xml has contents:
-----
<enterprise-beans>
<ejb-name>Operates</ejb-name>
<resource-ref>
<res-ref-name>DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</enterprise-beans>
.....here, I declared roles and permissions
-----
My jboss.xml has:
-----
<security-domain>DB-Domain</security-domain>
<enterprise-beans>
<ejb-name>Operates</ejb-name>
<resource-ref>
<res-ref-name>DefaultDS</res-ref-name>
<jndi-name>java:/DefaultDS</jndi-name>
</resource-ref>
</enterprise-beans>
-----
And the login-config.xml:
-----
<application-policy name="DB-Domain">
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name="dsJndiName">java:/DefaultDS</module-option>
<module-option name="principalsQuery">
select passwd from Users where username=?</module-option>
<module-option name="rolesQuery">
select Role, 'Roles' from Roles where username=?</module-option>
</login-module>
</application-policy>
-----
I don't know that why server not recognize all things that I declare inside jboss.xml and login-config.xml ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013476#4013476
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013476
19Â years, 2Â months
[JBoss Seam] - Re: seamspace example does not deploy
by norman.richardsï¼ jboss.com
You will find more detailed logging in server.log. What are the messages around the initialization of the init component? Here's an example from mine:
2007-02-09 01:14:27,026 INFO [org.jboss.seam.Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
| 2007-02-09 01:14:27,033 DEBUG [org.jboss.seam.Component] org.jboss.seam.core.init.debug=false
| 2007-02-09 01:14:27,045 DEBUG [org.jboss.seam.Component] org.jboss.seam.core.init.jndiPattern=seam-space/#{ejbName}/local
| 2007-02-09 01:14:27,045 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.init
| 2007-02-09 01:14:27,046 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.init
| 2007-02-09 01:14:27,046 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.init
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013474#4013474
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013474
19Â years, 2Â months