Re: [jboss-dev-forums] [JBoss AS 7 Development] - JBoss 7 Management Web UI
by goldengate001
goldengate001 [https://community.jboss.org/people/goldengate001] commented on the document
"JBoss 7 Management Web UI"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-16697#comment-10078
--------------------------------------------------
Is JMS Metrics available on standalone mode?
I can see the subscriptions count updated accurately, but when messages are sent to the topic, "Messages Added" metric does not get updated.
standalone-full.xml entry is as follows:
| | <hornetq-server> |
| | <persistence-enabled>true</persistence-enabled> |
| | <journal-file-size>102400</journal-file-size> |
| | <journal-min-files>2</journal-min-files> |
| | <journal-directory path="../test1/data/messaging"/> |
| | <connectors> |
| | <netty-connector name="netty" socket-binding="messaging"/> |
| | <netty-connector name="netty-throughput" socket-binding="messaging-throughput"> |
| | <param key="batch-delay" value="50"/> |
| | </netty-connector> |
| | <in-vm-connector name="in-vm" server-id="0"/> |
| | </connectors> |
| | <acceptors> |
| | <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> |
| | <in-vm-acceptor name="in-vm" server-id="0"/> |
| | </acceptors> |
| | <security-settings> |
| | <security-setting match="#"> |
| | <permission type="send" roles="guest"/> |
| | <permission type="consume" roles="guest"/> |
| | <permission type="createNonDurableQueue" roles="guest"/> |
| | <permission type="deleteNonDurableQueue" roles="guest"/> |
| | </security-setting> |
| | </security-settings> |
| | <address-settings> |
| | <address-setting match="#"> |
| | <dead-letter-address>jms.queue.DLQ</dead-letter-address> |
| | <expiry-address>jms.queue.ExpiryQueue</expiry-address> |
| | <redelivery-delay>0</redelivery-delay> |
| | <max-size-bytes>10485760</max-size-bytes> |
| | <address-full-policy>BLOCK</address-full-policy> |
| | <message-counter-history-day-limit>10</message-counter-history-day-limit> |
| | </address-setting> |
| | </address-settings> |
| | <jms-connection-factories> |
| | <connection-factory name="InVmConnectionFactory"> |
| | <connectors> |
| | <connector-ref connector-name="in-vm"/> |
| | </connectors> |
| | <entries> |
| | <entry name="java:/ConnectionFactory"/> |
| | </entries> |
| | </connection-factory> |
| | <connection-factory name="RemoteConnectionFactory"> |
| | <connectors> |
| | <connector-ref connector-name="netty"/> |
| | </connectors> |
| | <entries> |
| | <entry name="RemoteConnectionFactory"/> |
| | <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/> |
| | </entries> |
| | </connection-factory> |
| | <pooled-connection-factory name="hornetq-ra"> |
| | <transaction mode="xa"/> |
| | <connectors> |
| | <connector-ref connector-name="in-vm"/> |
| | </connectors> |
| | <entries> |
| | <entry name="java:/JmsXA"/> |
| | </entries> |
| | </pooled-connection-factory> |
| | </jms-connection-factories> |
| | <jms-destinations> |
| | <jms-queue name="testQueue"> |
| | <entry name="queue/test"/> |
| | <entry name="java:jboss/exported/jms/queue/test"/> |
| | </jms-queue> |
| | <jms-topic name="TestTopic"> |
| | <entry name="topic/TestTopic"/> |
| | <entry name="java:jboss/exported/jms/topic/TestTopic"/> |
| | </jms-topic> |
| | </jms-destinations> |
| | </hornetq-server> |
--------------------------------------------------
11 years, 10 months
[JBoss Web Development] - CDI cannot retrieve servlet responde using @Context annotation
by sebastián scarano
sebastián scarano [https://community.jboss.org/people/opensas] created the discussion
"CDI cannot retrieve servlet responde using @Context annotation"
To view the discussion, visit: https://community.jboss.org/message/742035#742035
--------------------------------------------------------------
I have a jax-rs web service returning json, and I'd like to add cors headers to it.
so I Have the following class:
[...]
import javax.enterprise.context.RequestScoped;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Path;
[...]
@Stateful
@Path("/grupo")
@RequestScoped
@TransactionAttribute
public class GrupoEndpoint
{
@Context
private HttpServletResponse response;
@GET
public List<Grupo> listAll()
{
@SuppressWarnings("unchecked")
final List<Grupo> results = em.createQuery("SELECT x FROM Grupo x").getResultList();
// here response is null!!!
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
return results;
}
But response is always null, is there something I might be missing?
Ps: I asked the same question on stackoverflow, in case you'd like to improve your SO reputation ;-)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/742035#742035]
Start a new discussion in JBoss Web Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 10 months
Re: [jboss-dev-forums] [PicketBox Development] - JBoss AS7: Security : Custom Login Modules
by Alexey Tomin
Alexey Tomin [https://community.jboss.org/people/alxt] commented on the document
"JBoss AS7: Security : Custom Login Modules"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-17357#comment-10067
--------------------------------------------------
In 7.1.1 I try use custom module
1. in standalone-full.xml:
<security-domain name="RolesLoginModule">
<authentication>
<login-module code="ru.infosfera.common.auth.server_module.RolesLoginModule" flag="required"/>
...
2. in my EAR in JAR add class ru.infosfera.common.auth.server_module.RolesLoginModule (implements LoginModule) and in class log all operations (initialize, login, commit, abort, logout).
3. in JAR add META-INF/jboss.xml with
<jboss><security-domain>RolesLoginModule</security-domain></jboss>
In EAR no files for jboss.
4. In client add parameters fomr InitialContext
params.put("java.naming.security.principal", username);
params.put("java.naming.security.credentials", password);
5. After make InitialContext call LoginContext.login() with CallbackHandler, what return username and password (overlapping of #4)
6. Try get remote interface (lookup) and failed:
2:09:04.629:Remoting "config-based-naming-client-endpoint" read-1:ERROR:org.jboss.remoting.remote.connection::JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
12:09:04.629:main :TRACE:ru.infosfera.common.ejb.JndiHelper ::not found jndiName: ejb:StartNg.twf-3.S3-SNAPSHOT/Common.auth.ejb-3.S3-SNAPSHOT//AdmContextBL!ru.infosfera.common.auth.bl.AdmContextRemote
javax.security.auth.login.LoginException: Failed to create remoting connection
7. In server NO LOG from my RolesLoginModule.
What am I doing wrong?
How to do the right thing?
--------------------------------------------------
11 years, 10 months
[JBoss AS 7 Development] - Re: connecting a remote hornetQ server
by srinivaas venkat
srinivaas venkat [https://community.jboss.org/people/sv_srinivaas] created the discussion
"Re: connecting a remote hornetQ server"
To view the discussion, visit: https://community.jboss.org/message/741920#741920
--------------------------------------------------------------
Hi, I'm using JBoss 7.1.0 Final with Hornetq 2.2.13. Final
Hi, I'm also getting the same exception on starting my remote host that has the MDB that connects to the cluster of jms nodes. The moment I start my mdb rempte host, I get the below exceptions in server console on mdb as well as on the jms nodes. I have also set the user and password for pooled-connection-factory but then the same gets deleted on server start.
Otherwise everything works fine with mdb, able to consume messages from cluster and sending the reply messages, just that i get the below exception andI i have not tested the xa recovery yet.
MDB console log
-------------------------
08:42:02,209 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "mdb.jar"
08:42:10,463 WARN [org.hornetq.jms.server.recovery.HornetQXAResourceWrapper] (Periodic Recovery) Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=epctjmsdev3-wipo-int, org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=epctjmsdev4-wipo-int], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576,], username=null, password=null]]
08:42:10,474 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to connect to any providers for xa recovery
at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:275) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.recover(HornetQXAResourceWrapper.java:77) [hornetq-jms-2.2.13.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:503) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:471) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:385) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:166) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-4.16.2.Final.jar:]
Caused by: HornetQException[errorCode=2 message=null]
at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.connect(HornetQXAResourceWrapper.java:351) [hornetq-jms-2.2.13.Final.jar:]
at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:251) [hornetq-jms-2.2.13.Final.jar:]
... 7 more
08:42:10,513 WARN [org.hornetq.jms.server.recovery.HornetQXAResourceWrapper] (Periodic Recovery) Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=epctjmsdev3-wipo-int, org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5445&host=epctjmsdev4-wipo-int], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576,], username=null, password=null]]
This message repeats every 2 mins
JMS node log
--------------------
.09:17:12,889 ERROR [org.hornetq.core.protocol.core.impl.HornetQPacketHandler] (Old I/O server worker (parentId: 1705769926, [id: 0x65abfbc6, jms_node1/a.b.c.d:5445])) Failed to create session : HornetQException[errorCode=105 message=Unable to validate user: null]
at org.hornetq.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:147) [hornetq-core-2.2.13.Final.jar:]
at org.hornetq.core.server.impl.HornetQServerImpl.createSession(HornetQServerImpl.java:807) [hornetq-core-2.2.13.Final.jar:]
at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handleCreateSession(HornetQPacketHandler.java:187) [hornetq-core-2.2.13.Final.jar:]
at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handlePacket(HornetQPacketHandler.java:85) [hornetq-core-2.2.13.Final.jar:]
at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:508) [hornetq-core-2.2.13.Final.jar:]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741920#741920]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 10 months