[JNDI/Naming/Network] - Re: name space bindings in jboss
by kakani
context : migrating the application from websphere to jboss application server
Problem :
web sphere allows name space binding using the admin console as shown below
1. Select Environment > Naming > Name Space Bindings
2. Select 'Server : server1'
3. Click 'Apply'
4. Click 'New'
5. Binding type 'String', Next
6. Binding Identifier 'myproperty Url'
7. Name in Name Space 'myPropertyUrl'
8. String Value file:///C:/dev/abc/abc_sources/abc/src/test/resources/abc.properties Next
9. Finish
10. Save
i am accessing this property value in spring application context file as shown in the below snippet.
<bean id="propertyUrl"
| class="org.springframework.jndi.JndiObjectFactoryBean">
| <property name="jndiName">
| <value>myPropertyUrl</value>
| </property>
| </bean>
after migration , jboss is throwing the below mentioned exception with out the mypropertyUrl configuration.
javax.naming.NameNotFoundException: myPropertyUrl not bound
javax.naming.NameNotFoundException: myPropertyUrl not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
........................
..........................
......
how can i get rid of this exception in Jboss ?
how can i configure the mypropertyUrl as a jndi key in jboss ?
please let me know if you need any further information about the issue.
Thanks & Regards
Yughandhar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205238#4205238
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205238
17 years, 2 months
[JNDI/Naming/Network] - Re: name space bindings in jboss
by kakani
context : migrating the application from websphere to jboss application server
Problem :
web sphere allows name space binding using the admin console as shown below
1. Select Environment > Naming > Name Space Bindings
2. Select 'Server : server1'
3. Click 'Apply'
4. Click 'New'
5. Binding type 'String', Next
6. Binding Identifier 'myproperty Url'
7. Name in Name Space 'myPropertyUrl'
8. String Value file:///C:/dev/abc/abc_sources/abc/src/test/resources/abc.properties Next
9. Finish
10. Save
i am accessing this property value in spring application context file as shown in the below snippet.
<bean id="propertyFile"
| class="org.springframework.core.io.UrlResource">
| <constructor-arg type="java.lang.String">
| <ref bean="propertyUrl" />
| </constructor-arg>
| </bean>
after migration , jboss is throwing the below mentioned exception with out the mypropertyUrl configuration.
javax.naming.NameNotFoundException: myPropertyUrl not bound
javax.naming.NameNotFoundException: myPropertyUrl not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
........................
..........................
......
how can i get rid of this exception in Jboss ?
how can i configure the mypropertyUrl as a jndi key in jboss ?
please let me know if you need any further information about the issue.
Thanks & Regards
Yughandhar anonymous wrote : anonymous wrote :
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205233#4205233
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205233
17 years, 2 months
[EJB 3.0] - Re: RolesAllowed causes exception on client with JBoss5
by draganj
Hello,
Here it is.
Client
| public class TestStatelessClient
| {
| public static void main(String[] args) throws Exception
| {
| Properties p = new Properties();
| //p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| p.setProperty("java.naming.factory.initial", "org.jboss.security.jndi.JndiLoginInitialContextFactory");
| p.setProperty("java.naming.provider.url","localhost:1099");
| p.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
| p.setProperty(Context.SECURITY_PRINCIPAL, "kermit");
| p.setProperty(Context.SECURITY_CREDENTIALS, "thefrog");
| InitialContext ctx = new InitialContext(p);
| IHelloWorld hw = (IHelloWorld) ctx.lookup("HelloWorldBean/remote");
|
| System.out.println("Got " + hw.helloWorld("Hello server"));
| }
| }
|
Server:
| package test.ejb.stateless;
|
| import javax.annotation.security.RolesAllowed;
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
|
| import org.jboss.ejb3.annotation.SecurityDomain;
|
|
| @Stateless
| @SecurityDomain("JBossWS")
| @Remote(IHelloWorld.class)
| public class HelloWorldBean implements IHelloWorld
| {
| @RolesAllowed({"friend"})
| public String helloWorld(String in)
| {
| System.out.println("Got " + in);
| return "Hello Client";
| }
| }
|
jboss.xml:
| ?xml version="1.0"?>
| <jboss>
| <security-domain>JBossWS</security-domain>
| </jboss>
|
I used JBossWS security domain.
Regards,
Dragan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205231#4205231
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205231
17 years, 2 months