java - Wildfly - "Connector 'netty' not found on the main configuration file" -
i've added connection factory @ standalone-full file of wildfly:
<jms-connection-factories> <connection-factory name="k19factory"> <connectors> <connector-ref connector-name="netty"/> </connectors> <entries> <entry name="k19factory"/> <entry name="java:jboss/exported/jms/k19factory"/> </entries> </connection-factory> ... </jms-connection-factories> and have following code use it:
properties props = new properties(); props.setproperty("java.naming.factory.initial","org.jboss.naming.remote.client.initialcontextfactory"); props.setproperty("java.naming.provider.url", "http-remoting://127.0.0.1:8080/"); /*props.setproperty("java.naming.provider.url","remote://localhost:8080");*/ props.setproperty("java.naming.security.principal","k19"); props.setproperty("java.naming.security.credentials","1234"); initialcontext ic = new initialcontext(props); // factory of jms connections connectionfactory factory = (connectionfactory)ic.lookup("jms/k19factory"); but i'm facing problems. widfly saying can't find netty connector, can't create connection factory.
... 17:07:02,316 info [org.jboss.as.messaging] (serverservice thread pool -- 62) jbas011601: bound messaging object jndi name queue/pedidos 17:07:02,331 info [org.hornetq.core.server] (serverservice thread pool -- 57) hq221003: trying deploy queue jms.topic.noticias 17:07:02,347 info [org.jboss.as.messaging] (serverservice thread pool -- 57) jbas011601: bound messaging object jndi name topic/noticias 17:07:02,331 error [org.jboss.msc.service.fail] (serverservice thread pool -- 61) msc000001: failed start service jboss.messaging.default.jms.connection-factory.k19factory: org.jboss.msc.service.startexception in service jboss.messaging.default.jms.connection-factory.k19factory: jbas011639: failed create connection-factory @ org.jboss.as.messaging.jms.connectionfactoryservice$1.run(connectionfactoryservice.java:69) [wildfly-messaging-8.2.0.final.jar:8.2.0.final] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) [rt.jar:1.8.0_31] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) [rt.jar:1.8.0_31] @ java.lang.thread.run(thread.java:745) [rt.jar:1.8.0_31] @ org.jboss.threads.jbossthread.run(jbossthread.java:122) [jboss-threads-2.1.1.final.jar:2.1.1.final] caused by: hornetqillegalstateexception[errortype=illegal_state message=hq129005: connector 'netty' not found on main configuration file] @ org.hornetq.jms.server.impl.jmsservermanagerimpl.internalcreatecfpojo(jmsservermanagerimpl.java:1421) [hornetq-jms-server-2.4.5.final.jar:] @ org.hornetq.jms.server.impl.jmsservermanagerimpl.internalcreatecf(jmsservermanagerimpl.java:1368) [hornetq-jms-server-2.4.5.final.jar:] @ org.hornetq.jms.server.impl.jmsservermanagerimpl.access$1300(jmsservermanagerimpl.java:107) [hornetq-jms-server-2.4.5.final.jar:] @ org.hornetq.jms.server.impl.jmsservermanagerimpl$5.runexception(jmsservermanagerimpl.java:1215) [hornetq-jms-server-2.4.5.final.jar:] @ org.hornetq.jms.server.impl.jmsservermanagerimpl.runafteractive(jmsservermanagerimpl.java:1906) [hornetq-jms-server-2.4.5.final.jar:] @ org.hornetq.jms.server.impl.jmsservermanagerimpl.createconnectionfactory(jmsservermanagerimpl.java:1201) [hornetq-jms-server-2.4.5.final.jar:] @ org.jboss.as.messaging.jms.connectionfactoryservice$1.run(connectionfactoryservice.java:66) [wildfly-messaging-8.2.0.final.jar:8.2.0.final] ... 4 more 17:07:02,347 info [org.jboss.as.messaging] (serverservice thread pool -- 57) jbas011601: bound messaging object jndi name java:jboss/exported/jms/topic/noticias 17:07:02,347 info [org.hornetq.core.server] (serverservice thread pool -- 59) hq221003: trying deploy queue jms.queue.dlq 17:07:02,347 info [org.jboss.as.messaging] (serverservice thread pool -- 59) jbas011601: bound messaging object jndi name java:/jms/queue/dlq 17:07:02,347 info [org.hornetq.core.server] (serverservice thread pool -- 60) hq221003: trying deploy queue jms.queue.expiryqueue 17:07:02,347 info [org.jboss.as.messaging] (serverservice thread pool -- 60) jbas011601: bound messaging object jndi name java:/jms/queue/expiryqueue 17:07:02,347 info [org.jboss.as.messaging] (serverservice thread pool -- 58) jbas011601: bound messaging object jndi name java:jboss/exported/jms/remoteconnectionfactory 17:07:02,472 info [org.jboss.as.connector.deployment] (msc service thread 1-8) jbas010406: registered connection factory java:/jmsxa 17:07:02,488 info [org.jboss.ws.common.management] (msc service thread 1-6) jbws022052: starting jboss web services - stack cxf server 4.3.2.final 17:07:02,545 info [org.hornetq.ra] (msc service thread 1-8) hornetq resource adaptor started 17:07:02,545 info [org.jboss.as.connector.services.resourceadapters.resourceadapteractivatorservice$resourceadapteractivator] (msc service thread 1-8) ij020002: deployed: file://raactivatorhornetq-ra 17:07:02,545 info [org.jboss.as.connector.deployment] (msc service thread 1-3) jbas010401: bound jca connectionfactory [java:/jmsxa] 17:07:02,545 info [org.jboss.as.messaging] (msc service thread 1-5) jbas011601: bound messaging object jndi name java:jboss/defaultjmsconnectionfactory 17:07:02,545 error [org.jboss.as.controller.management-operation] (controller boot thread) jbas014613: operation ("add") failed - address: ([ ("subsystem" => "messaging"), ("hornetq-server" => "default"), ("connection-factory" => "k19factory") ]) - failure description: {"jbas014671: failed services" => {"jboss.messaging.default.jms.connection-factory.k19factory" => "org.jboss.msc.service.startexception in service jboss.messaging.default.jms.connection-factory.k19factory: jbas011639: failed create connection-factory caused by: hornetqillegalstateexception[errortype=illegal_state message=hq129005: connector 'netty' not found on main configuration file]"}} 17:07:02,623 info [org.jboss.as.controller] (controller boot thread) jbas014774: service status report jbas014777: services failed start: service jboss.messaging.default.jms.connection-factory.k19factory: org.jboss.msc.service.startexception in service jboss.messaging.default.jms.connection-factory.k19factory: jbas011639: failed create connection-factory can give me hand on it?
this error due fact referencing non-existent connector. default not exist netty-connector, other such http-connector.
'cause you're using standalone-full, i'll consider org.jboss.as.messaging module enabled.
first, have include acceptor, responsible accepting connections made server. this, in messaging subsystem (xml namespace urn:jboss:domain:messaging:2.0) find acceptorstag , add this:
<netty-acceptor name="netty" socket-binding="messaging" /> <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> <param key="direct-deliver" value="false"/> </netty-acceptor> after this, have include connector, responsible transport configurations (how connect) on server. this, in messaging subsystem (xml namespace urn:jboss:domain:messaging:2.0) find connectorstag , add this:
<netty-connector name="netty" socket-binding="messaging" /> <netty-connector name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> </netty-connector> finally have configure socket binding. find socket-binding-group tag , include this:
<socket-binding name="messaging" port="5445"/> <socket-binding name="messaging-throughput" port="5455"/> see documentation of jboss eap (obs.: there differences in eap settings wildfly/as community, directories, overall reference) , of wildfly more detailed configuration of messaging system.
given setting , connection-factory, code should works:
final properties props = new properties(); props.setproperty(context.initial_context_factory, "org.jboss.naming.remote.client.initialcontextfactory"); props.setproperty(context.provider_url, "http-remoting://127.0.0.1:8080"); props.setproperty(context.security_principal, "user"); // add application user before props.setproperty(context.security_credentials, "user1234"); final initialcontext ic = new initialcontext(props); final connectionfactory factory = (connectionfactory) ic.lookup("jms/k19factory"); system.out.println(factory != null ? "factory not null" : "factory null"); this log of lookup (source above):
jun 02, 2015 7:18:13 pm org.xnio.xnio <clinit> info: xnio version 3.2.0.final jun 02, 2015 7:18:13 pm org.xnio.nio.nioxnio <clinit> info: xnio nio implementation version 3.3.1.final jun 02, 2015 7:18:13 pm org.jboss.remoting3.endpointimpl <clinit> info: jboss remoting version 4.0.0.final factory not null and log in wildfly:
19:18:13,731 info [org.jboss.as.naming] (default task-35) jbas011806: channel end notification received, closing channel channel id 24a74dfb (inbound) of remoting connection 29a8f328 /127.0.0.1:63595 to run example may need these dependencies in yout classpath:
jboss-remote-naminghornetq-jms-client- a xnio provider,
xnio-nio
Comments
Post a Comment