[JBoss Messaging] - Do you have example code embeding JBMBootstrapServer for JBM
by Gary Marsh
I am able to run the JBMBootstrapServer from the command line using the run.bat that comes with JMB 2.0.0Alpha but when I create my own Main() program that embeds JBMBootstrapServer I get some unusual behavior where I get a JMSSecurity exception stating unable to validate user.
package com.nichpro.jms;
|
| import java.util.HashMap;
| import java.util.Map;
|
| import org.jboss.kernel.spi.deployment.KernelDeployment;
| import org.jboss.messaging.microcontainer.JBMBootstrapServer;
|
|
| /**
| * Main Class : [Description Goes Here]
| *
| *
| * @author gary.v.marsh
| *
| */
| public class Main {
|
| private JBMBootstrapServer bootstrapServer ;
| private KernelDeployment deployment;
| private static Main bootMain;
| private Map<String, KernelDeployment> deployedMap;
| /**
| * main performs {input functionality here}
| *
| * @param args
| */
| public static void main( String[ ] args ) {
|
| bootMain = new Main();
| bootMain.configure(args);
|
| }
|
| protected void configure(String[] args)
| {
| int index = 0;
| String[] bootargs = null;
|
| deployedMap = new HashMap<String, KernelDeployment>();
|
| try
| {
| String[] argString = {"/NichPro/MDS_POJO_With_JBM/config/jbm-standalone-beans.xml"};
|
| bootstrapServer = new JBMBootstrapServer(argString);
| bootstrapServer.run();
| System.out.println("Using JBMBootstrapServer to deploy : " + argString);
|
| }
| catch (Throwable t)
| {
| t.printStackTrace();
| }
| }
|
|
| private static Main getMain()
| {
| if (bootMain == null)
| throw new IllegalArgumentException("Main in not initialized, should run Main.main()!");
|
| return bootMain;
| }
|
|
|
The Error Message with full path to xml file:
| java.lang.RuntimeException: Unable to find resource:/NichPro/MDS_POJO_With_JBM/config/jbm-standalone-beans.xml
| at org.jboss.messaging.microcontainer.JBMBootstrapServer.deploy(JBMBootstrapServer.java:148)
| at org.jboss.messaging.microcontainer.JBMBootstrapServer.bootstrap(JBMBootstrapServer.java:107)
| at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
| at org.jboss.messaging.microcontainer.JBMBootstrapServer.run(JBMBootstrapServer.java:73)
| at com.nichpro.jms.Main.configure(Main.java:57)
| at com.nichpro.jms.Main.main(Main.java:37)
| 11:35:18,021 INFO @Thread-0 [JBMBootstrapServer] Shutting down
|
|
| Now when I just pass the file name jbm-standalone-bean.xml I get the following error :
|
|
| 11:41:02,911 INFO @main [XmlDeployer] deploying ConnectionFactory
| | 11:41:02,911 WARN @main [JMSServerManagerImpl] Binding for /ConnectionFactory already exists
| | 11:41:02,911 WARN @main [JMSServerManagerImpl] Binding for java:/ConnectionFactory already exists
| | 11:41:02,911 WARN @main [JMSServerManagerImpl] Binding for java:/XAConnectionFactory already exists
| | 11:41:02,911 INFO @main [XmlDeployer] deploying ClusteredConnectionFactory
| | 11:41:02,927 WARN @main [JMSServerManagerImpl] Binding for java:/ClusteredConnectionFactory already exists
| | 11:41:02,927 WARN @main [JMSServerManagerImpl] Binding for java:/ClusteredXAConnectionFactory already exists
| | 11:41:02,927 INFO @main [XmlDeployer] deploying MyExampleConnectionFactory
| | Starting MonitorMgrImpl...
| | javax.jms.JMSSecurityException: Unable to validate user: null
| | at org.jboss.messaging.core.remoting.impl.wireformat.MessagingExceptionMessage.decodeBody(MessagingExceptionMessage.java:60)
| | at org.jboss.messaging.core.remoting.impl.wireformat.EmptyPacket.decode(EmptyPacket.java:183)
| | at org.jboss.messaging.core.remoting.impl.mina.MessagingCodec.doDecode(MessagingCodec.java:430)
| | at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:173)
| | at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:170)
| | at org.apache.mina.common.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:405)
| | at org.apache.mina.common.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:40)
| | at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:823)
| | at org.apache.mina.common.DefaultIoFilterChain$HeadFilter.messageReceived(DefaultIoFilterChain.java:607)
| | at org.apache.mina.common.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:405)
| | at org.apache.mina.common.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:399)
| | at org.apache.mina.common.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:434)
| | at org.apache.mina.common.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:396)
| | at org.apache.mina.common.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:388)
| | at org.apache.mina.common.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:43)
| | at org.apache.mina.common.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:706)
| | at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
| | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
| | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
| | at java.lang.Thread.run(Thread.java:619)
| | Caused by: MessagingException[errorCode=105 message=Unable to validate user: null]
| | ... 20 more
| | MonitorMgrInpl stop() was called..
| |
| | Starting DataProcAgentImpl...
| |
| | javax.jms.JMSSecurityException: Unable to validate user: null
| | at org.jboss.messaging.core.remoting.impl.wireformat.MessagingExceptionMessage.decodeBody(MessagingExceptionMessage.java:60)
| | at org.jboss.messaging.core.remoting.impl.wireformat.EmptyPacket.decode(EmptyPacket.java:183)
| | at org.jboss.messaging.core.remoting.impl.mina.MessagingCodec.doDecode(MessagingCodec.java:430)
| | at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:173)
| | at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:170)
| | at org.apache.mina.common.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:405)
| | at org.apache.mina.common.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:40)
| | at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:823)
| | at org.apache.mina.common.DefaultIoFilterChain$HeadFilter.messageReceived(DefaultIoFilterChain.java:607)
| | at org.apache.mina.common.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:405)
| | at org.apache.mina.common.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:399)
| | at org.apache.mina.common.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:434)
| | at org.apache.mina.common.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:396)
| | at org.apache.mina.common.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:388)
| | at org.apache.mina.common.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:43)
| | at org.apache.mina.common.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:706)
| | at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
| | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
| | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
| | at java.lang.Thread.run(Thread.java:619)
| | Caused by: MessagingException[errorCode=105 message=Unable to validate user: null]
| | ... 20 more
| | Starting DataDirMonitor...
| | DirMonitorImpl setupTopic() ....
| | 11:41:03,068 INFO @main [JBMBootstrapServer] JBM Server Started
| | Using JBMBootstrapServer to deploy : [Ljava.lang.String;@30c963
|
|
| A good embedded example would be very helpful.
|
| Regards,
|
| GMarsh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201924#4201924
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201924
17 years, 5 months
[EJB 3.0] - Re: jboss 5.0.0.GA and ejb3
by ALRubinger
The reason for this is because starting in the 5.0.0.Beta releases we moved jbossall-client to a manifest-only JAR. This means that instead of repackaging all of the classes in the JARs you mention into one uber-JAR, jbossall-client contains a ClassPath entry in the manifest to point to the relative location of the JARs listed. Therefore, they're expected to be in the same directory.
As a workaround, you could write a script that does:
mkdir mytempdir
| for(each JAR listed)
| { extractContentsInto > mytempdir) }
| JAR(contentsOf mytempdir)
...and then use your own JAR.
If you feel this makes things unusable/unfriendly, address it on the jboss-dev public mailing list. We don't want add "bloat" to the distro by repackaging classes, but maybe we could look into adding a script so that users have the option of making their own single jbossall-client.
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201916#4201916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201916
17 years, 5 months
[EJB/JBoss] - want transaction commit control inside bean
by jamicide
Currently I am using a MDB which uses container-controlled transactions. The MDB can specify to rollback the transaction, at which point it gets re-tried.
A new situation has arisen where I don't want certain messages from being placed on the JMS queue while other (possibly conflicting) messages are being run.
When we have a message ready to place on the JMS queue, the solution proposed involves:
1) checking whether any conflicting messages are currently queued
a. if so, block until they have completed
b. if not, proceed and block subsequent messages from queuing until
this unit of work is complete
2) place the message on the JMS queue
3) when the message/unit of work is complete, signal the waiting messages (from 1.a) that they can proceed
Can the transaction settings for MDBs be changed such that I can manually commit the transaction within the bean and then perform this signalling step (step 3) from within the bean, while still maintaining the ability to rollback the transaction and have the JMS provider re-invoke the MDB (as you would see using Container managed transactions, where the transaction is not started in the bean itself).
Alternatively, is there a way of attaching a listener to a particular message/unit of work so that I may know when it has dropped out of the active JMS system (either by being successfully processed or by rolling back the maximum number of times)? I could then do the Step 3 work in this listener.
Or thirdly is there a superior solution to what I've outlined above?
Any help is greatly appreciated.
I use JBoss4.0.3SP1.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201915#4201915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201915
17 years, 5 months
[JBoss Tools (users)] - Re: JBoss Tools - RichFaces 3.3.0
by krasig
Hi Max, Hi akazakov
anonymous wrote : Contributions welcome to keep up to speed with additions.
I know that all data for content assistance is in ...schemas\tld\RichFaces3.X.xml in format ;
| ...
| ...
| <element-type body-content="allowed" content="mixed"
| end-tag="required" name="editor" start-tag="required">
| <description>
| <![CDATA[The editor component is used for creating a WYSIWYG editor on a page.]]>
| </description>
| <attribute-type name="autoResize" required="false">
| <description>
| Attribute enables to get the Editor area to resize to the boundaries of the contents
| </description>
| <proposal type="beanProperty"/>
| <proposal type="bundleProperty"/>
| <proposal type="jsfVariables"/>
| <proposal type="enumeration">
| <param value="true"/>
| <param value="false"/>
| </proposal>
| </attribute-type>
| <attribute type="autoResize"/>
| ...
| ...
| </element-type>
|
and i'm ready to help you with this
Can't understand format of VPE template.
P.S. in xml file many places where must have enumeration like "true","false" are empties.
Regards.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201914#4201914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201914
17 years, 5 months