[JNDI/Naming/Network] - DataSource look up failed
by lakshmansai
Hi,
I have created a dataSource with jndi name KernelDataSource and it successfully bounded in jboss 4.2 version. When i am trying to look up from my client program i am getting name not bound exception. Can any body look at this problem:
mysql-ds.xml:
<local-tx-datasource>
<jndi-name>KernelDataSource</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/adminconsole</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>baloo</user-name>
baloo
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- should only be used on drivers after 3.22.1 with "ping" support
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
-->
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>mySQL</type-mapping>
</local-tx-datasource>
Client.java
Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "jnp://192.168.7.11:1099");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" );
InitialContext ic = new InitialContext(props);
//DataSource ds = (DataSource)ic.lookup("KernelDataSource");
System.out.println("Datasource :" + ic.lookup("java:KernelDataSource"));
Exception Stack trace:
javax.naming.NameNotFoundException: java not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Client.main(Client.java:24)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083282#4083282
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083282
18 years, 7 months
[Security & JAAS/JBoss] - @RolesAllowed ignored?
by jjonphl
I am using jboss 4.2.1.GA. I have the ff session bean
| @RolesAllowed({"authenticated"})
| @Stateless
| @Remote({AccountRDAO.class})
| public class AccountRDAOAction extends RDAOAction
| implements AccountRDAO, Serializable
| {
|
| ...
|
| }
|
I defined the ff policy in login-config.xml:
| <application-policy name="mypolicy">
| <authentication>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
| flag = "required">
| <module-option name="unauthenticatedIdentity">anonymous</module-option>
| <module-option name = "dsJndiName">java:/itranscribe-ds</module-option>
| <module-option name = "principalsQuery">select password from logins where username=?</module-option>
| <module-option name = "rolesQuery">
| select 'authenticated' as Role, 'Roles' as RoleGroup where length(?) > 0
| </module-option>
| </login-module>
|
| </authentication>
| </application-policy>
|
It is driving me nuts why I can still access the methods of the supposedly protected bean. I tried annotating the methods and still the same.
Thanks,
M. Manese
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083279#4083279
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083279
18 years, 7 months
[JBoss Seam] - Re: Page Parameter not working
by stephen.friedrich
I do see the request parameter in the URL and after clicking on a link the correct URL is even displayed in the browser's address bar.
I do (try to) use a page parameter:
<page view-id="/departments.xhtml" action="#{entryAction.enter()}">
| <param name="departmentId" value="#{departmentHome.id}" converterId="javax.faces.Long"/>
| </page>
I put the action there only for testing and it sure is called.
However request parameters never are used. As I previously said: This setup was working on Seam 2.0.0, Trinidad 1.2.2, Sun JSF RI 1.2 and JBoss 4.2. Of course it may be that I forgot to change some descriptors to the older format, but I triple (quadruple, and lots more) checked them against the seampay example in 1.2.1.
It really seems to me like a bug in the integration of Seam and Trinidad.
In my scenario Seam never calls it's own applyRequestParameterValues() which sure seems like a bug to me. Of course it probably has a deeper cause somewhere.
It seems that for this request Seam figures out there won't be a JSF response, so the applyRequestParameterValues() is not needed (I have no clue why facesContext.getRenderResponse() always returns false nor why that should disable request parameter processing).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083271#4083271
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083271
18 years, 7 months