[JBoss Seam] - Re: TestNG and Seam Documentation 12.1. Unit testing Seam co
by gemel
I had this failure too and I could solve it I hope I can help you.
Dou you have a datasource defined in your persistence.xml file like this?
<jta-data-source>java:/SeamRcAdfDatasource</jta-data-source>
if yes --> Try this
1- Take the <jta-data-source> definition away from the persistence.xml file
2- As the test runs outside JBoss, the datasource you defined in xxx-ds.xml is not bound.
So you have to create the EntityManagerFactory like this:
HashMap<String, String> map = new HashMap<String, String>();
map.put("hibernate.show_sql", "true");
...
map.put("hibernate.hbm2ddl.auto", "create-drop");
map.put("hibernate.connection.driver_class", "oracle.jdbc.driver.OracleDriver");
map.put("hibernate.connection.username", "username");
map.put("hibernate.connection.password", "pwd");
map.put("hibernate.connection.url", "connectionUrl");
...
EntityManagerFactory emf = Persistence.createEntityManagerFactory("unitname", map);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012501#4012501
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012501
19Â years, 2Â months
[JBoss Seam] - Re: Seam Security
by lightbulb432
"lightbulb432" wrote : When catching NotLoggedInException in exceptions.xml, I have a
|
| <redirect view-id="/login.xhtml">Not logged in</redirect> for the NotLoggedInException.
|
| While the redirect works correctly, the message "Not logged in" doesn't display in login.xhtml's <h:messages globalOnly="true" />
|
| Why won't this message appear?
I spoke too soon when I said the above problem sorted itself out. The following does not work:
<exception class="org.jboss.seam.NotLoggedInException">
| <redirect view-id="/login.xhtml">
| <message>Not logged in</message>
| </redirect>
| </exception>
This does not appear in any case. Only for authorization exceptions (when the user doesn't have appropriate permissions) does the message appear. Keep in mind the redirect is working, however, and the login.xhtml does have an h:messages. Is this a bug in Seam?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012497#4012497
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012497
19Â years, 2Â months
[JCA/JBoss] - Access Connection Pool from standalone
by Uchiha
Hi I need to access the connection pool in JBoss from a standalone program, im getting the context through JNDI like this:
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
env.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
Context ctx = new InitialContext(env);
DataSource ds = (DataSource) ctx.lookup("java:SybaseDS");
Connection conn = ds.getConnection();
i'm getting the error that SybaseDS is not bound, however, at Jboss startup "java:SybaseDS" is well registered.
Someone told me that I need to configure Jboss to let standalone programs access the connection pool from outside the server, could you please tell me how can i do that, I'd really apreciate your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012496#4012496
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012496
19Â years, 2Â months
[JNDI/Naming/Network] - Access Connection Pool from standalone
by Uchiha
Hi I need to access the connection pool in JBoss from a standalone program, im getting the context through JNDI like this:
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
env.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
Context ctx = new InitialContext(env);
DataSource ds = (DataSource) ctx.lookup("java:SybaseDS");
Connection conn = ds.getConnection();
i'm getting the error that SybaseDS is not bound, however, at Jboss startup "java:SybaseDS" is well registered.
Someone told me that I need to configure Jboss to let standalone programs access the connection pool from outside the server, could you please tell me how can i do that, I'd really appreciate your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012492#4012492
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012492
19Â years, 2Â months