在myeclipse10.6上开发ejb程序部署到jboss-as-7.1.1.Final上后,在myeclipse写一个java程序验证是否正确时;
新建jboss-ejb-client.properties内容如下(之前已经在jboss上增加过用户了,client下的jar包什么的都已经加到classpath路径上了):
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port = 4447
remote.connection.default.username=localhost
remote.connection.default.password=shenyf
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
jndi.properties内容如下:
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
java.naming.provider.url=remote://localhost:4447
javax.naming.Context.SECURITY_PRINCIPAL=localhost
javax.naming.Context.SECURITY_CREDENTIALS=shenyf
执行时总是报错连接不了4447端口!google了几天才发现是7.1.1的bug
还是换用jboss-as-6.1.0了,只需要配一个文件jndi.properties如下
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=127.0.0.1
自己记一下!