标签:
曾经想尝试着写一下,失败,今天在jboss的EJB3论坛上有人问到同样的问题,解决方案如下:
Create a jndi.properties file, place it in the classpath (usually in the base directory of the jar file), with these contents:
| Code: |
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.provider.url=localhost:1099 java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces |
Of course, replace locahost with your host name if you are attempting remote access.
或者采用HashMap:
Hashtable<String, String> props= new Hashtable<String, String>(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(Context.PROVIDER_URL,"jnp://localhost:1099" ); props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces" ); Context ctx = new InitialContext( props );
只不过对于依赖注入还没有更好的方案,等jboss的ejb3最新实现出来再看看
![]() |
谢亚龙逼女足姑娘作检讨(图)
“安静”为啥成裁判口头语?
姚明私下发给刘翔的短信
|
![]() |
曝光:姚明小时候与可爱女生合影(图) 组图:隋菲菲私家相册 率性美感领衔女篮 |
![]() |
![]() |
![]() |


档案
日志
相册
视频








评论
想第一时间抢沙发么?