[Messaging, JMS & JBossMQ] - How to use Messaging from a remote client? (JBoss 4.2.0)
by JasonHsu
I have thre questions.... the scenario for the quesiton, please see below..
Q1. Why do I have bind a IP other than 127.0.0.1 then I can get the response from "telnet <server name> 1099" ? And if I use "run -b 192.168.x.x"
then "telnet localhost 1099" doesn't work at all.
Q2. How to make a console applicaiton (I think UI application has the same issue) communicate with Messaging from remote?
Q3. How to make a web application on remote Tomcat to communicate with Messaging?
Please let me know what code or file I should write and what kind of modification should be made on JBoss. I've searched dozens of articles. They just
focused on explaining individual parameter or config sections or discrete codes. They help very limited.
Please help. Thank you.
Jason
I'll try to describe what I did step by step here.
I'm using JBoss 4.2.0 GA. I want to create two programs to use its JMS remotely. One is a console application the other is web application on tomcat.
My console application works fine on the same machine with JBoss by setting the
java.naming.provider.url=jnp://localhost:1099
Then I change to use <server name> instead of 'localhost'. It's dead. I tried to add "-Djboss.bind.address=192.168.x.x" to the variable
%JAVA_OPTS% in run.bat of JBoss. However, there was error still.(Q1) Then I spent two days to figured it out. Finally, I found there is
a parameter '-b' of run.bat. So the "run -b 192.168.x.x" is working.
Now I use
java.naming.provider.url=jnp://<server name>:1099
in jndi.properities. I got the error:
Exception in thread "main" java.security.AccessControlException: access denied (
| java.util.PropertyPermission java.security.auth.login.config write)
| at java.security.AccessControlContext.checkPermission(AccessControlConte
| xt.java:264)
| at java.security.AccessController.checkPermission(AccessController.java:
| 427)
| at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
| at java.lang.System.setProperty(System.java:699)
| at TTestJBoss.<init>(TTestJBoss.java:29)
| at TTestJBoss.main(TTestJBoss.java:24)
I spent another two days then add
| set POLICY_FILE=.\jboss_client.policy
| set AUTH_FILE=.\auth.conf
|
| and "-Djava.security.policy="%POLICY_FILE%" -Djava.security.auth.login.config=%AUTH_FILE%" in the execution line in
| the run.bat created by myself to execute my console application.
|
The content of these two files are
| in jboss_client.policy:
|
| grant {
| permission java.security.AllPermission;
| };
|
| ============================================
| in auth.conf (I copy it from %JBOSS_HOME%\client) :
|
| srp-client {
| // Example client auth.conf for using the SRPLoginModule
| org.jboss.security.srp.jaas.SRPLoginModule required
| password-stacking="useFirstPass"
| principalClassName="org.jboss.security.SimplePrincipal"
| srpServerJndiName="SRPServerInterface"
| debug=true
| ;
|
| // jBoss LoginModule
| org.jboss.security.ClientLoginModule required
| password-stacking="useFirstPass"
| ;
|
| // Put your login modules that need jBoss here
| };
|
| other {
| // jBoss LoginModule
| org.jboss.security.ClientLoginModule required
| ;
|
| // Put your login modules that need jBoss here
| };
|
Actually, I have no idea of these two files. Anyway, the error message changed which is better than no change at all.
Here is the best error I got now: Line 1-6 are the information from my program. TopicListener is the class I created.
| got ctx
| About to get connection factory
| got factory
| About to get destination
| got destination
| Error occurs while the TopicListener is listening to the topic/topic1
| javax.jms.JMSSecurityException: User: null is NOT authenticated
| at org.jboss.mq.security.SecurityManager.authenticate(SecurityManager.ja
| va:230)
| at org.jboss.mq.security.ServerSecurityInterceptor.authenticate(ServerSe
| curityInterceptor.java:66)
| at org.jboss.mq.server.TracingInterceptor.authenticate(TracingIntercepto
| r.java:613)
| at org.jboss.mq.server.JMSServerInvoker.authenticate(JMSServerInvoker.ja
| va:172)
| at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocke
| tManagerHandler.java:238)
| at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.j
| ava:395)
| at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
| utor.java:743)
| at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048016#4048016
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048016
18 years, 11 months
[Messaging, JMS & JBossMQ] - Re: JMS error with SQLServer
by balaji_srini
This is what I see in my mssql-jdbc2-service.xml:
| BLOB_TYPE=BINARYSTREAM_BLOB
| INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
| INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID, TXOP) VALUES(?,?,?,?,?)
| SELECT_ALL_UNCOMMITED_TXS = SELECT TXID FROM JMS_TRANSACTIONS
| SELECT_MAX_TX = SELECT MAX(TXID) FROM JMS_MESSAGES
| DELETE_ALL_TX = DELETE FROM JMS_TRANSACTIONS
| SELECT_MESSAGES_IN_DEST = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE DESTINATION=?
| SELECT_MESSAGE_KEYS_IN_DEST = SELECT MESSAGEID FROM JMS_MESSAGES WHERE DESTINATION=?
| SELECT_MESSAGE = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
| MARK_MESSAGE = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE MESSAGEID=? AND DESTINATION=?
| UPDATE_MESSAGE = UPDATE JMS_MESSAGES SET MESSAGEBLOB=? WHERE MESSAGEID=? AND DESTINATION=?
| UPDATE_MARKED_MESSAGES = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=?
| UPDATE_MARKED_MESSAGES_WITH_TX = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? AND TXID=?
| DELETE_MARKED_MESSAGES_WITH_TX = DELETE FROM JMS_MESSAGES WHERE TXID IN (SELECT TXID FROM JMS_TRANSACTIONS) AND TXOP=?
| DELETE_TX = DELETE FROM JMS_TRANSACTIONS WHERE TXID = ?
| DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXID=? AND TXOP=?
| DELETE_TEMPORARY_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXOP='T'
| DELETE_MESSAGE = DELETE FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
| CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES (MESSAGEID INTEGER NOT NULL, DESTINATION VARCHAR(150) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB IMAGE)
| CREATE_IDX_MESSAGE_TXOP_TXID = CREATE INDEX JMS_MESSAGES_TXOP_TXID ON JMS_MESSAGES (TXOP, TXID)
| CREATE_IDX_MESSAGE_DESTINATION = CREATE INDEX JMS_MESSAGES_DESTINATION ON JMS_MESSAGES (DESTINATION)
| CREATE_IDX_MESSAGE_MESSAGEID_DESTINATION = CREATE UNIQUE CLUSTERED INDEX JMS_MESSAGES_IDX ON JMS_MESSAGES (MESSAGEID, DESTINATION)
| CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS ( TXID INTEGER, PRIMARY KEY (TXID) )
| CREATE_TABLES_ON_STARTUP = TRUE
Please help. Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048010#4048010
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048010
18 years, 11 months
[JBossCache] - Re: BdbjeCacheLoader exception with JTA distributed transact
by nanreh
One additional possible hint: when I shut the process down a shutdown hook runs to do an orderly shutdown of jacorb which is being used by JBoss Transactions for distributed transactions. BdbjeCacheLoader throws an exception when it's asked to shutdown apparently due to a lingering open transaction:
| jvm 1 | com.sleepycat.je.DatabaseException: (JE 3.2.23) There is 1 existing transaction opened against the Environment.
| jvm 1 | Aborting open transactions ...
| jvm 1 |
| jvm 1 | at com.sleepycat.je.Environment.close(Environment.java:331)
| jvm 1 | at org.jboss.cache.loader.bdbje.BdbjeCacheLoader.stop(BdbjeCacheLoader.java:259)
| jvm 1 | at org.jboss.cache.loader.CacheLoaderManager.stopCacheLoader(CacheLoaderManager.java:333)
| jvm 1 | at org.jboss.cache.CacheImpl.stop(CacheImpl.java:870)
| jvm 1 | at com.scea.scne.acs.shard.cache.JBossCacheShardStore$3.run(JBossCacheShardStore.java:72)
|
thanks...
f
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048003#4048003
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048003
18 years, 11 months