[Beginner's Corner] - System.getProperty("jboss.server.config.dir") returns null on linux
by Betto McRose Gamarra
Betto McRose Gamarra [https://community.jboss.org/people/IcarusDB] created the discussion
"System.getProperty("jboss.server.config.dir") returns null on linux"
To view the discussion, visit: https://community.jboss.org/message/802438#802438
--------------------------------------------------------------
Hi all
I'm facing this problem, I'm trying to get the server config url but I'm getting null values
is it a permission problem ?
my linux is crunchbang 10
| | String filepath = System.getProperty("jboss.server.config.dir") + |
| | File.separator + cfgFileName; |
| |
|
| | PTIProperties parameteres = new PTIProperties(); |
| | parameteres.load(new FileInputStream(filepath)); |
I check every possibility but no success at all
/**
*
*/
package py.com.icarusdb.loadconfig.test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import py.com.icarusdb.util.GlobalParameters;
import py.com.icarusdb.util.PTIProperties;
import py.com.icarusdb.util.UriBuilder;
> /**
> * @author mcrose
> *
> */
> public class loadConfig
> {
>
> private static final String JBOSS_SERVER_BASE_DIR = "jboss.server.config.url";
> private static String CFG_FILE_NAME = "auth-rest.cfg.properties";
>
> /**
> * @param args
> */
> public static void main(String[] args)
> {
> String filepath = System.getenv(JBOSS_SERVER_BASE_DIR);
>
> if(filepath == null || filepath.isEmpty())
> {
> Map<String, String> envvarz = System.getenv();
>
> System.out.println("scanning System.getevn()...");
>
> Iterator<String> iterator = envvarz.keySet().iterator();
> while (iterator.hasNext())
> {
> String key = iterator.next();
> if(key.toLowerCase().contains("jboss")) {
> System.out.println("key: " + key + "->" + envvarz.get(key));
> }
> }
>
> if(envvarz.containsKey(JBOSS_SERVER_BASE_DIR)) {
> filepath = envvarz.get(JBOSS_SERVER_BASE_DIR);
> }
> }
>
> if(filepath == null || filepath.isEmpty()) {
> filepath = System.getProperty(JBOSS_SERVER_BASE_DIR);
> }
>
> if(filepath == null || filepath.isEmpty())
> {
> System.out.println("\nscanning System.getProperties()...");
>
> Properties sysprops = System.getProperties();
> Iterator<Object> iterator = sysprops.keySet().iterator();
> while (iterator.hasNext())
> {
> Object key = iterator.next();
> if(key.toString().toLowerCase().contains("jboss")) {
> System.out.println("key: " + key + "->" + sysprops.get(key));
> }
> }
>
> if(sysprops.containsKey(JBOSS_SERVER_BASE_DIR)) {
> filepath = (String) sysprops.get(JBOSS_SERVER_BASE_DIR);
> }
>
> }
>
> if(filepath != null && !filepath.isEmpty())
> {
> System.out.println("filepath: " + filepath);
>
> filepath += CFG_FILE_NAME + GlobalParameters.SERVER_CONFIG_FILE_FOLDER;
>
> System.out.println("full-filepath: " + filepath);
>
> PTIProperties parameteres = new PTIProperties();
> try
> {
> parameteres.load(new FileInputStream(filepath));
> }
> catch (FileNotFoundException e)
> {
> e.printStackTrace();
> }
> catch (IOException e)
> {
> e.printStackTrace();
> }
>
>
> String uri = UriBuilder.buildLoginUri(parameteres);
> System.out.println("uri: " + uri);
> }
>
>
>
> }
>
>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/802438#802438]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[JBoss Messaging] - Message Retry Not working
by Ranajit Jana
Ranajit Jana [https://community.jboss.org/people/ranajitjana] created the discussion
"Message Retry Not working"
To view the discussion, visit: https://community.jboss.org/message/802348#802348
--------------------------------------------------------------
Hi,
I have used the following configuration for the message retry.
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
<expiry-address>jms.queue.expiryQueue</expiry-address>
<redelivery-delay>30</redelivery-delay>
<max-delivery-attempts>20</max-delivery-attempts>
<max-size-bytes>100000</max-size-bytes>
<page-size-bytes>20000</page-size-bytes>
<address-full-policy>PAGE</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
<last-value-queue>true</last-value-queue>
<redistribution-delay>0</redistribution-delay>
<send-to-dla-on-no-route>true</send-to-dla-on-no-route>
</address-setting>
</address-settings>
The issue I am facing is if the message fails it does not go back to the queue.Also the error which should appear in the Jms should be printed again and again if the same is called for retry.
Currently the error is showing up only one.
and I see 4 messages put into the deadLetterQueue.
When I try to dequeue and read the messages than deadletter queue print the following when we print the message.
HornetQMessage[null]:PERSISTENT.
all the queues are configured fine and I can see them from the console.
Any idea where I am going wrong.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/802348#802348]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[JBoss Messaging] - Reprocess DLQ
by ansur
ansur [https://community.jboss.org/people/ansur] created the discussion
"Reprocess DLQ"
To view the discussion, visit: https://community.jboss.org/message/802383#802383
--------------------------------------------------------------
There have been some topics on removing messages from DLQ - which doesn't seem like something easy to accomplish with JMS.
The requirement that I have is that we need to enable users to reprocess a DLQ.
My current implementation boils down to the following snippet:
final QueueBrowser browser = session.createBrowser(queue);
final Enumeration<Message> jmsMessages = browser.getEnumeration();
while(jmsMessages.hasMoreElements()) {
final Message jmsMessage = jmsMessages.nextElement();
final Destination destination = jmsMessage.getJMSDestination();
sendMessage(jmsMessage, destination, session);
}
I.e. create a browser, and for each message, get the destination and send it there. the sendMessage() method creates a MessageProducer and calls the send() method.
This is working fine, but the message isn't actually removed from the DLQ.
What behaviour would I need in order to have it removed after processing?
After all, if the message fails to process again, it would just en dup in the DLQ again - which is OK.
Finally, the above is part of a manual action. So I can't just register an MDB on the DLQ - it needs to be a manual invocation.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/802383#802383]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month