[JBoss Messaging] - javax.jms.InvalidDestinationException: Destination is not an
by chaituu
followed this url and deployed new new messaging instance
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingBuildInstructions
i created mdb.ear and deployed in the mesaging instance.my requirement is i am trying to lookup remote queue;
i followed below url for scoped ear for Remote Messaging Instance.
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingUser_Deploying_a_s...
mdb.ear was deployed with no errors in messaging instance .
in mesaging instance in directory jboss-messaging.sar i changed destinations-service.xml to create new queue(testQueue);
below in jms-ds.xml in messaging instance;
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <connection-factories>
|
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=JMSProvider,server=172.16.7.12">
| <attribute name="ProviderName">QueuehostJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">
| org.jboss.jms.jndi.JNDIProviderAdapter
| </attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
| <!-- Use HAJNDI to access JMS -->
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=172.16.7.12:1099
| </attribute>
| </mbean>
|
|
| <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
| name="jboss.messaging:service=ServerSessionPoolMBean,name=StdJMSPool">
| <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
| <attribute name="PoolName">StdJMSPool</attribute>
| <attribute name="PoolFactoryClass">org.jboss.jms.asf.StdServerSessionPoolFactory</attribute>
| </mbean>
|
|
| <tx-connection-factory>
| <jndi-name>JmsXA</jndi-name>
| <xa-transaction/>
| <rar-name>jms-ra.rar</rar-name>
| <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/QueuehostJMSProvider</config-property>
| <max-pool-size>20</max-pool-size>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| <depends>jboss.messaging:service=ServerPeer</depends>
| </tx-connection-factory>
|
| </connection-factories>
|
|
in messaging instance only i changed standardjboss.xml
****************************************************
|
|
| <invoker-proxy-binding>
| <name>my-mdb-invoker</name>
| <invoker-mbean>message-driven-bean</invoker-mbean>
| <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
| <proxy-factory-config>
| <JMSProviderAdapterJNDI>QueuehostJMSProvider</JMSProviderAdapterJNDI>
| <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
| <MinimumSize>1</MinimumSize>
| <MaximumSize>15</MaximumSize>
| <KeepAliveMillis>30000</KeepAliveMillis>
| <MaxMessages>1</MaxMessages>
| <MDBConfig>
| <ReconnectIntervalSec>10</ReconnectIntervalSec>
| <DLQConfig>
| <DestinationQueue>queue/DLQ</DestinationQueue>
| <MaxTimesRedelivered>10</MaxTimesRedelivered>
| <TimeToLive>0</TimeToLive>
| </DLQConfig>
| </MDBConfig>
| </proxy-factory-config>
| </invoker-proxy-binding>
|
|
in the corresponding mdb.ear i changed jboss.xml
********************************
|
|
| <message-driven>
| <ejb-name>ExampleMessageDrivenBean</ejb-name>
| <configuration-name>Standard Message Driven Bean</configuration-name>
| <destination-jndi-name>queue/testQueue</destination-jndi-name>
| <invoker-bindings>
| <invoker>
| <invoker-proxy-binding-name>my-mdb-invoker</invoker-proxy-binding-name>
| </invoker>
| </invoker-bindings>
| </message-driven>
|
|
client code is in default instance
| Properties env = new Properties();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| env.put(Context.PROVIDER_URL, "172.16.7.12:1099");
|
| Context remoteCtx = new InitialContext(env);
| Queue queue = (Queue)remoteCtx.lookup("queue/testQueue");
| QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:JmsXA");
|
|
I am getting JmsXA not bound exception(what is the right way of look up ?)
when i changed from JmsXA to java:/XAConnectionFactory i am getting queueFactory
but i am getting below exception.
| javax.jms.InvalidDestinationException: Destination is not an instance of SpyDestination JBossQueue[testQueue]
|
see my messaging instance log file
| 2006-12-05 16:37:24,986 34739 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/DLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,032 34785 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/testTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,032 34785 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/securedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,048 34801 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/testDurableTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,251 35004 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/testQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,298 35051 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/A] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,298 35051 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/B] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,314 35067 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/C] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,329 35082 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/D] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,345 35098 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/ex] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,345 35098 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/openTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
| 2006-12-05 16:37:25,939 35692 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] @main Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA to JNDI name 'java:JmsXA'
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992227#3992227
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992227
19 years, 4 months
[Beginners Corner] - Portlet using lucene gives ArrayIndexOutOfBoundsException
by francsi
Hello!
I've buld a Portlet using the apache lucene API to search our website.
Indexing will be performed as a job in java (works fine).
My portlet is using the following method to do a simple search:
| private static List sucheSchlagwort(String queries)throws Exception{
| String index = "index";
| String field = "contents";
|
| int repeat = 0;
| boolean raw = false;
| String normsField = null;
| //
| //
| IndexReader reader = IndexReader.open(index);
| if (normsField != null)
| reader = new OneNormsReader(reader, normsField);
|
| Searcher searcher = new IndexSearcher(reader);
| Analyzer analyzer = new StandardAnalyzer();
| BufferedReader in = null;
| // in = new BufferedReader(new FileReader(queries));
| QueryParser parser = new QueryParser(field, analyzer);
| List alleErgebnisse = new ArrayList();
|
| String line = queries; // in.readLine();
|
| Query query = parser.parse(line);
|
|
| Hits hits = searcher.search(query);
|
|
| // ANFANG
| // FIXME: Ausgabe ins Ausgabeportlet, nicht println
| for (int i = 0; i < hits.length(); i++) {
| Ergebnis ergebnis = new Ergebnis();
| Document doc = hits.doc(i);
| String path = doc.get("path");
| if (path != null) {
| ergebnis.setLink(doc.get("path"));
| System.out.println(doc.get("path"));
| String title = doc.get("title");
| if (title != null) {
| ergebnis.setTitel(doc.get("title"));
| System.out.println(doc.get("title"));
| }
| } else {
| ergebnis.setLink("Kein Link zu diesem Dokument vorhanden");
| }
| alleErgebnisse.add(ergebnis);
|
|
| if (queries != null) // non-interactive
| break;
| }
| // ENDE
|
| reader.close();
| return alleErgebnisse;
|
| }
|
Implementet into a simple java class it works fine on shell. Started as part of my portlet, it sends me the following error:
| 2006-12-08 12:34:42,393 ERROR [STDERR] java.lang.ArrayIndexOutOfBoundsException: -1
| 2006-12-08 12:34:42,393 ERROR [STDERR] at java.util.ArrayList.get(ArrayList.java:323)
| .
| .
| .
| 2006-12-08 12:34:42,413 ERROR [STDERR] at org.apache.lucene.index.IndexReader.open(IndexReader.java:95)
| 2006-12-08 12:34:42,413 ERROR [STDERR] at SuchportletPortlet.sucheSchlagwort(SuchportletPortlet.java:54)
| .
| .
| .
|
Looks like it comes from here:
| IndexReader reader = IndexReader.open(index);
|
Changing the index to a non existing path sends an error that the path is not existing. So there must be a problem with reading the index. Don't you think?
What about the read/write permissions under the JBOSS directory?
And remember... in a standard java program it works...
Greetings,
Jan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992226#3992226
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992226
19 years, 4 months