[jboss-user] [Beginners Corner] - Jboss unmarshalling
Hello I created a class which uses jboss Unmarshaller. It works just fine, but i cannot unmarshall xml file which does not contain the main element from schema. That means when file i want to unmarshall contains some element from schema, but this is not a global element i receive exception: Exception in thread main org.jboss.xb.binding.JBossXBException: Failed to parse source: Element account is not bound as a global element. at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse (SaxJBossXBParser.java:156) ... This the class i created: import java.io.File; | import java.io.FileInputStream; | import java.io.FileNotFoundException; | import java.io.InputStream; | import org.jboss.xb.binding.JBossXBException; | import org.jboss.xb.binding.Unmarshaller; | import org.jboss.xb.binding.UnmarshallerFactory; | import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; | import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder; | | | public class XBUnmarshaller { | | SchemaBinding schema; | Unmarshaller unmarshaller; | | private void setUp(){ | unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); | } | | public XBUnmarshaller(String schemaFile) throws FileNotFoundException { | this(new FileInputStream(new File(schemaFile))); | } | | public XBUnmarshaller(InputStream stream){ | setUp(); | schema = XsdBinder.bind(stream, UTF-8); | } | | public Object unmarshallXml(String fileName) throws FileNotFoundException, JBossXBException{ | return unmarshallXml(new FileInputStream(new File(fileName))); | } | | public Object unmarshallXml(InputStream inputXml) throws JBossXBException{ | return unmarshaller.unmarshal(inputXml, schema); | } Could you tell me if it is possible to unmarshall such xml file? If the answer is yes, then please tell me how to do it. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4081755#4081755 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4081755 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Beginners Corner] - Re: mbean inside war archive
Hello Place your jboss-service.xml file inside sar archive. So you will have two archives. Now you only need to create ear archive containing war and sar archives. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4044239#4044239 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4044239 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
I haven't worked with jms much, so i don't know, but i took a look at MBean attributes, this one monitoring queue, and there are two attributes which are the ones you need: ScheduledMessageCount InProcessMessageCount But i don't know how they work, you must to check them. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032665#4032665 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032665 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hello If you really need remote access you need to change one line in your code. Change this line: MBeanServer server = MBeanServerLocator.locateJBoss(); to this one: MBeanServerConnection server = (MBeanServerConnection) ictx.lookup(jmx/invoker/RMIAdaptor); That should help. Best regards. vitor_b P.S. Do you have any experience in working with XML? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031941#4031941 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031941 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hello It looks that reference to this object cannot be sent outside JVM in which this object lives. This is an simple object, not bean, so you cannot access it. Honestly I don't know how to do that. From inside server you could access and use that reference. So... personally i would create session bean working on server, which will expose some methods. These methods would get info about yoour queue via MBean Proxy. You could create MBean proxy in ejbCreate method, and this bean could be stateless. So you would lokup for that bean, call methods on it, and all logic taking info about your queue would be inside that bean methods. It is heavier but I don't know the other way. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032007#4032007 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032007 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Thanks for your reply. The problem with my Queue was that described in section 2. I did not call connection.start() method. My mistake. If we talk about books: i haven't seen any good one. I learned from Jboss wiki knowledgebase: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMX If you have any questions just ask, but i'm not an expert, so it is possible that I won't be able to answer to your questions. Anyway, i will try :) Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031511#4031511 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031511 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - Re: beginner needs help
Sorry for such a long time you had to wait for my reply. First thing you need is: JWSDP (Java Web Services Developer Pack). You can download it from www.sun.com. I use jwsdp-1.4. And here it is ant task which will generate for you jaxrpc-mapping and wsdl files: First we need to set path to JWSDP: property name=jwsdp.dir value=your path\jwsdp-1.4 / | property name=classes.dir value=compiled classes\bin / Replace values in to your specific ones. Now we have to specify jar libraries we will use: path id=jwsdp.lib.path | fileset dir=${jwsdp.dir}/jwsdp-shared | include name=**/*.jar/ | /fileset | | fileset dir=${jwsdp.dir}/jaxrpc | include name=**/*.jar/ | /fileset | | fileset dir=${jwsdp.dir}/saaj | include name=**/*.jar/ | /fileset | /path We need one more library (we need class com.sun.tools.javac.Main): path id=wscompile.task.classpath | path refid=jwsdp.lib.path/ | fileset dir=${java.home}/../lib includes=tools.jar/ | /path Now we define our own ant task: taskdef name=wscompile classname=com.sun.xml.rpc.tools.ant.Wscompile classpathref=wscompile.task.classpath/ And we run it: target name=run-wscompile depends=xdoclet-build | wscompile base=${res-generated-dir} | fork=true | server=true | features=rpcliteral | mapping=${res-gen-ws}/jaxrpc-mapping.xml | config=${res-hand-made-dir}/wscompile-config.xml | nonClassDir=${res-gen-ws} | | classpath | path refid=wscompile.task.classpath/ | pathelement location=${classes.dir}/ | /classpath | | /wscompile | /target res-gen-ws and res-hand-made-dir are my dirs. res-gen-ws is the directory which will contain generated jaxrpc-mapping and wsdl files. But wscompile task needs one more thing: wscompile-config.xml This file contains info which will be used for generating files for you. My file looks like that: ?xml version=1.0 encoding=UTF-8? | configuration xmlns=http://java.sun.com/xml/ns/jax-rpc/ri/config; | service name=NameWebService |targetNamespace=http://localhost:8080/jmsprototype; |typeNamespace=http://localhost:8080/jmsprototype/types; |packageName=ws.bean | interface name=ws.bean.WebService/ | /service | /configuration packageName - package contains web service classes Element interface contains WebService class, that implements interface java.rmi.Remote. service name - name for service in wsdl file service name=NameWebService You still have to create webservices.xml file yourself. But that is not a very hard thing to do. If you have any questions just ask. I will check this topic later. Take care vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031523#4031523 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031523 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - Marshalling
Hello Since there is no user forum dedicated for unmarshalling and marshalling problems i think this is the best place where i can ask question related to these topics. Ususally our Webservice get xml document, unmarshall it, do some business logic, then marshall result and send it to caller. Marshalling and unmarshalling are done automatically. Now i would like to marshall my output object manually. I have my object and xml schema. It looks like i have everything i need. But i really don't know how to do it. There should be very simple API enables that funcionality. But i found two things: JbossXB and JAXB. 1. JbossXB There is a big problem. For every class we want to marshall we need class which implements interface ObjectModelProvider. I've taken a look at example: http://wiki.jboss.org/wiki/Wiki.jsp?page=ObjectModelProvider Provider classes are not very simple. And my output is much more complex that that one used in this example. I have no time to write so many Providers for my classes. Besides of lack of time there is one more importnat reason. This object can be changed. Unfortunately there is no other way to marshall with JbossXb using my xml schema. 2. JAXB This is the second way i know. But examples i saw need so many generated classes and interfaces. This is not a problem. But where generating all this stuff interfaces and business classes are also generated. These classes are used for marshalling. But i have my own business classes, and these ones don't implements so many interfaces like: com.sun.xml.bind.RIElement, com.sun.xml.bind.JAXBObject, primer.po.impl.runtime.UnmarshallableObject, primer.po.impl.runtime.XMLSerializable, primer.po.impl.runtime.ValidatableObject So my one question is; how to mashall my business doc using my xml schema? Is there way to do that? Any sugestions are really welcome, becouse i'm really lost. Thank you in advance. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031536#4031536 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031536 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hmm... This line: MBeanServer server = MBeanServerLocator.locateJBoss(); should work when calling from non-MBean, for example from EJB session bean in the same JVM. I don't think that you calling it in this way. I have JBoss 4.0.5 GA, but that class was available in version 3.2.7 or even earlier. I tested this code before posting it and it works fine for me. My code was in stateless session bean deployed on JBoss. So try it from the same JVM. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031583#4031583 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031583 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue
Hello I have a solution for you. The key is JMX API. As you know there is a MBean which you can view using jboss jmx console. One thing we have to do is to acces that MBean. Here is some code i have written for you: String domain = jboss.mq.destination; | String service = service=Queue; | String name = name=testQueue; | | String stringObjectName = domain + : + service + , + name; | | MBeanServer server = MBeanServerLocator.locateJBoss(); | | try{ | ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); | | org.jboss.mq.server.jmx.QueueMBean queueMBean = | (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( | server, | queueObjectName, | org.jboss.mq.server.jmx.QueueMBean.class, | false | ); | | logger.info(queue depth: + queueMBean.getQueueDepth()); | | }catch (Exception e){ | logger.info(cannot get depth of the queue: + e.getMessage(),e); | } When you have a proxy then you can get all queue properties by calling method: getNameOfAttribute (ex. queueMBean.getQueueDepth();) These three strings set up at the begining are taken from jmx-console page for MBean monitoring Queue. If you have any questions, just ask. As a reward please look at my question (Queue - I can send but cannot receive) i'm going to write right now. Since you are working with queues maybe you will be able to help me. Take care vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031029#4031029 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031029 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Queue - I can send but cannot receive
Hello JBoss: 4.0.5 GA I'm still facing some problems working with JMS. The last problem is that i cannot receive message from queue. I can send it, but cannot receive it later. All from mothod inside simle stateless session bean. This method works in a transaction (Container, Required). First getting stuff InitialContext ictx = new InitialContext(); | ConnectionFactory cf = (ConnectionFactory) ictx.lookup(java:JmsXA); | Connection con = cf.createConnection(); | Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE); | | Queue queue = (Queue ) ictx.lookup(queue/testQueue); | | logger.info(queue.getQueueName()); Now we can perform some operations on queue: First we can send message: MessageProducer sender = session.createProducer(queue); | | Order order = new Order(); | order.setOrderId(orderId); | | Message message = session.createObjectMessage(order); | | sender.send(message); | logger.info(Message has been sent); Sending messages works fine. Now i would like to receive one message: MessageConsumer consumer = session.createConsumer(queue); | Message m = consumer.receiveNoWait(); | | if (m == null){ | logger.error(m is null); | }else{ | logger.info(got message, yupi); | } But I cannot get message from queue testQueue. Everytime single time i get null. Queue depth is huge now after so many tries :( I deployed MDB, and that MDB was able to consume messages from this queue. I have no idea what i'm doing wrong. Any sugestions? Thank you for all your replies in advance. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031032#4031032 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031032 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: Queue - I can send but cannot receive
Thank you for this helpful reply. I added method start() at the begining and stop() method at the end. But that was not a good move. I received Exception: anonymous wrote : | javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6 When i removed method stop() everything works fine. consumer.close(); | session.close(); | //con.stop(); | con.close(); | ictx.close(); Thanks again. I would have lost much more time if i had not been told what is wrong. Best regards. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031073#4031073 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031073 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: Queue - I can send but cannot receive
With connection.start() everything works fine. Connection con = cf.createConnection(); | con.start(); //new line | Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE); I had some problems when i added connection.stop() method to my code. So i removed stop() method call, and again everything works corectly. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4031179#4031179 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031179 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Jboss Hypersonic
Hello There is Hypersonic DB integrated with Jboss. I would like to know how to configure it in order to be sure that all data will be stored on Hard Disc. I know that sometimes data can be stored only in memory and i would like to avoid this situation. All data has to be stored on my HD. And the second quesstion is: where data is stored, i mean in which directory. Any help is greatly appreciated. Thank you in advance. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4030533#4030533 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4030533 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - Re: beginner needs help
Hello Thank you for your reply. I haven't tried your solution, since i created ant task, which generates mapping and wsdl files for me. With these files my web service (even with more complex input and output) works fine. And i didn't have to add these tags. Maybe that was becouse of my version of jbossws (1.4) but I'm really not sure. I only had to create wscompile-config.xml file. The problem described in my first post was occured becouse i created these files by my hand. I did it becouse i need to understand every aspect of creating these files. And the last thing: i've seen webservice with extremally complex input and output, but someone else created it. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4030545#4030545 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4030545 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Message Cache configuration problem
Hello I'm confused. That what i need to achieve is to store all JMS messages in persistent storage, for example in DB. PersistenceManager will help me, but first i have to force MessageCache not to store any single message. All messages have to be stored in DB. I tried to set attributes HighMemoryMark and MaxMemoryMark to 0, but that didn't help much. At least one message is cached. There is also attribute MaximumHard, and it seems to be a solution, but unfortunately 0 means that there is no limit for number of messages stored in cache. That is a terrible thing for me, becouse that means that there is no way to prevent cache from caching messages. My messages are very important, it is unacceptable to loose even one, for example when lack of electricity happens. Is my way of thinking correct? Any solutions? Thank you for your replies in advance. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4030599#4030599 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4030599 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Messaging, JMS JBossMQ] - Re: Message Cache configuration problem
Hello Thank you very much for your replies. I need only a small confirmation. That all means that: 1. Non persisted messages are stored in the same persistent storage like messages marked as persistent, when cache manager is out of memory 2. Messages marked as persistent can be both: in memory (cache) and persistent storage at the same time 3. When lack of electricity happens all non persistent messages from memory will be lost (stored non persistent ones will survive). Short answers like yes/no would be enought. Best regards vitor_b P.S. hard to be a beginner View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4030871#4030871 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4030871 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - beginner needs help
-nameHelloPort/java-port-name | /port-mapping | /service-interface-mapping | service-endpoint-interface-mapping | service-endpoint-interfaceorg.jboss.chap12.hello.Hello/service-endpoint-interface | wsdl-port-type xmlns:portTypeNS=http://hello.chap12.jboss.org/;portTypeNS:Hello/wsdl-port-type | wsdl-binding xmlns:bindingNS=http://hello.chap12.jboss.org/;bindingNS:HelloBinding/wsdl-binding | service-endpoint-method-mapping | java-method-namehello/java-method-name | wsdl-operationhello/wsdl-operation | method-param-parts-mapping | param-position0/param-position | param-typeorg.jboss.chap12.hello.Input/param-type | wsdl-message-mapping | wsdl-message xmlns:wsdlMsgNS=http://hello.chap12.jboss.org/;wsdlMsgNS:Hello_hello/wsdl-message | wsdl-message-part-nameinputt/wsdl-message-part-name | parameter-modeIN/parameter-mode | /wsdl-message-mapping | /method-param-parts-mapping | wsdl-return-value-mapping | method-return-valuejava.lang.String/method-return-value | wsdl-message xmlns:wsdlMsgNS=http://hello.chap12.jboss.org/;wsdlMsgNS:Hello_helloResponse/wsdl-message | wsdl-message-part-nameresult/wsdl-message-part-name | /wsdl-return-value-mapping | /service-endpoint-method-mapping | /service-endpoint-interface-mapping | /java-wsdl-mapping | For me looks like everything is fine, but it is not. The question is: why? Could you help me? Thank you in advance. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4029280#4029280 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4029280 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - overriding jboss configuration
Hello There is a file: standardjboss.xml This file contains JBoss configuration. But there is a posibility to override some properties by adding element container-configurations to jboss.xml file from META-INF of our archive, example: jboss | enterprise-beans | ... | /enterprise-beans | container-configurations | container-configuration extends (name of proper configuration) |container-pool-conf | MaximumSize2/MaximumSize | strictMaximumSizetrue/strictMaximumSize |/container-pool-conf | /container-configuration | /container-configurations | /jboss | This example will change pooling configuration. And here i have some questions: This configuration is written in jboss.xml file. Does this mean that configuration will be overridden only for beans in this specific archive? Lets suppose i have an application contains 5 jar files. Configuration is overridden in only one jboss.xml file. This configuration sets new pooling properties for stateless session beans, but i have stateless session beans in all 5 jar files. So deas this mean that specific configuration will be in force only for beans from this one jar file? Thank you for your reply in advance :) vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025749#4025749 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025749 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - Re: web service and asynchronous processing
Hello Thank you for your reply, but unfortunately there are some things i don't understand. Could you clarify these for me please? We have Message Addressing Properties: wsa:Toxs:anyURI/wsa:To ? | wsa:Fromwsa:EndpointReferenceType/wsa:From ? | wsa:ReplyTowsa:EndpointReferenceType/wsa:ReplyTo ? | wsa:FaultTowsa:EndpointReferenceType/wsa:FaultTo ? | wsa:Actionxs:anyURI/wsa:Action | wsa:MessageIDxs:anyURI/wsa:MessageID ? | wsa:RelatesTo RelationshipType=xs:anyURI?xs:anyURI/wsa:RelatesTo * | wsa:ReferenceParametersxs:any*/wsa:ReferenceParameters ? where EndpointReferenceType means: wsa:EndpointReference | wsa:Addressxs:anyURI/wsa:Address | wsa:ReferenceParametersxs:any*/wsa:ReferenceParameters ? | wsa:Metadataxs:any*/wsa:Metadata? | /wsa:EndpointReference That is ok, but there is on the page http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide#WS-Addressing something like this: handler-chains xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; | xsi:schemaLocation=http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd | | handler-chain | protocol-bindings##SOAP11_HTTP/protocol-bindings | handler | handler-nameApplication Server Handler/handler-name | handler-classorg.jboss.test.ws.jaxws.samples.wsaddressing.ServerHandler/handler-class | /handler | /handler-chain | | /handler-chains At this point i have some questions: 1. in which file should i put handler-chains element? 2. What does element handler-class contain? What is this class? Does this class is able to read SOAPMessage? I think i should i think write this class myself, but what is the contract for writing this class? What interface should it implement? SOAPHandler? Do i have to implement logic which will take info from soap message header? 3. I think these properties are handled automatically, this means webservice will send reply to adderss taken from element: wsa:ReplyTo, and i don't need to do anything in order to get this done. Am i right? 4. If 3 is true, that means that message addressing properties don't support property i need. Client should have entry point which will accept soap message sent by server after message from queue is processed. But this entry point will not be any identified by message addressing properties received in request .request..RequestObject Client - WebService --- Client - WebService ..| ConfirmationObjectv Queue ...| ...SOAPMessage.| Client (EP) --- SessionBean --- Client (EP) SessionBean . (dot) - only used as a spaces, to format this message EP - this should be a client entry point, where all results after processing objects from queue will be sent. There won't be address of this EP in the request. Any help will be appreciated. cheers vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025145#4025145 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025145 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - web service and asynchronous processing
Hello I really need your help, so please read my question and post your reply if you know the answer, so ... Webservices generally have one or more business methods exposed for clients. for example: public ResponseObject businessMethod(RequestObject request) A client sends a request, this request is transformed to an object, this object is passed as a parameter to our business method. The method do some work, then returns ResponseObject, application server sends the response to the client. The client waits for the answer. So this is synchronous communication. WebServices use SOAP. Application server knows where has to send the reply. But lets suppose that in some cases i would like to do some business logic later, not just when a request is received. I have been thinking of it and i would like you to help me. So I could expose another method, like: public ConfirmationObject asyncBusinessMethod(RequestObject request) This method would put RequestObject in JMS queue and then send reply. This reply means that request is accepted, and will be processing later. Client can continue its work. The Queue will hold all async requests. Requests will be taken from the queue later, one after the other. There will be for example a session bean (not MDB becouse i don't want it to take objects when they are available, just later), this bean will take a request from queue and then call first described method: businessMethod(...) . This method will create a reply, but now there is a big problem. Where it should be send? We have no info about client which has sent this message to our application. How to handle this? Generally client will have a end point, waiting for async response. It will use SOAP. How to send the async response using SOAP to client? Or should I do it in completely different way? The goal is asynchronous handling of requests. If there was only one client i could create and send SOAP message like that: ResponseObject response = ... | //add the response object to SOAP message | //then | SOAPConnection connection = ... | java.net.URL endpoint = new URL (http://www.one.known.client;); | SOAPMessage response = connection.call(response, endpoint); | //endpoint - client end point waiting for async reply, hardcoded or in app config Could that be done from a session bean? If there were many clients we wouldn't know to which client we should send the reply. Once again how to handle that? Please help me, I'm a beginner and this is not easy for me at all. Thank you in advance. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4024926#4024926 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4024926 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions
Hey genman Thanks for your reply. 1. I know everything i need now :) 2. In this case that is not a very big problem, merge file is not big. Better think that even when we have to write merge files, often we don't have to write all we need ourselves, anly a part. But hmm... not in this case. 3. Your answer to my question is clear for me. And i see the difference now, after removing line from my jboss-service.xml file: attribute name=JndiNameResourceName/attribute | This line was the reason why i couldnt see persistence in action. Everytime i deployed my xmbean my attribute got a default value. But still i need a small clarification or confirmation: Persistence applies only to situation when we redeploy our mbean or restart server? And where jboss stores persistence state for mbeans? I stopped my server and deleted all files from 'server'/tmp/deploy drectory, but after started server again the attribute of my mbean had exactly the same value like before. Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4022979#4022979 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022979 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions
One more thing: Standard MBean has three default attributes: - StateString - State - Name My XMBean has only attributes i created. So if i want to provide these attributes for my XMBean what should i do? Is there any way to enable them, or i should create attributes myself and change their values personally? I mean, do i have to do things like this?: public class MyService extends ServiceMBeanSupport { | |private String StateString; |private int State; | |public void start() throws Exception { | //some work | ... | this.State = MBeanSupport.STARTED; | this.StateString = MBeanSupport.states[MBeanSupport.STARTED]; |} | |//other methods here | } Thanks in advance vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4022988#4022988 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022988 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Management, JMX/JBoss] - Re: xmbean as service... and two more questions
Hey Thank you for the reply. defaltAttributes and defaultOperations work fine with xml using dtd file version 1.2. But unfortunately i cannot force my ant task to generate proper xml file for my xmbean (dtd version 1.0, cannot merge etc.). But that is a completely different story. And once again persistence. I believe (after some experiments) that persistence for mbean means: stored attribute values for this proper mbean. So it is not important what persistence strategy is when our mbean is deployed. We can change values of some of attributes and everything works fine. Difference is only when we undeploy our mbean, and later deploy again. When an attribute of our mbean has no default value (in jboss-service.xml) value of this attribute will be initialized with value taken from file containing stored values for attributes. I haven't seen other influence of persistence strategy on mbean. And my question was: is there any influence on mbean, different from described above? Best regards vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4023263#4023263 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4023263 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Management, JMX/JBoss] - xmbean as service... and two more questions
Hello I have a few questions, not very hard i think. So lets look at them: 1. I have created my first xmbean, lets say 'MyService'. This bean extends class 'ServiceMBeanSupport'. I have generated MyService.xml file, and it looks ok. I haven't generated interface 'MyServiceMBean' for my xmbean. I think i don't need it. My xmbean for now has only a few attributes and operations, and these operations work fine. The problem is that when deploying xmbean methods like createService(), startService() are not called. This is strange for me. What is wrong with my xmbean? In contrary i can create common mbean which implements interface for bean, then remove from my jboss-service.xml file line xmbean-dd=home/jmx/beans/MyService.xml and methods like startService() are called. Any suggestions what is wrong with my xmbean? My methods createService(), startService() do nothing atm, example: protected void startService() throws Exception { | log.info(startService()); | } 2. generating jboss-service.xml My ant task looks like that atm: target name=xdoclet-jmx-deploy depends=create-folders |jmxdoclet | mergeDir=${merge-dir} | excludedTags=@version,@autor,@todo | destDir=${res-service-dir}/META-INF | verbose=true | addedTags=@xdoclet-generated at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version ${version} | | fileset dir=src includes=home/jmx/beans/*Service.java / | jbossxmlservicetemplate servicefile=jboss / |/jmxdoclet | /target The problem here is that everything i need in my jboss-service.xml file i have to write by hand in merge file jboss-service.ent. If i remove 'mergeDir' from jmxdoclet task I will receive empty jboss-service.xml. That is strange for me, becouse i created all tags in my MyService.java file. The same info which is necessary to generate file MyService.xml. That should be enought to create jboss-service.xml file also. 3. Could you explain me persist policy strategies? (OnUpdate, NoMoreOftenThan, Never, OnTimer) I don't get what persistence for mbean means. Please, if you know anything which could help me to solve my problems just reply :) I will be very gratefull for any help. Thank you in advance. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4022447#4022447 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4022447 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Beginners Corner] - jta transactions - simple question
Hello Jboss: 4.0.5GA java: 1.4 I think I'm missing something. Below you can find a simple piece of code. It is similar to every example which shows how to handle with jta transactions. It is from my stateful session bean. Ok lets look at that: UserTransaction uT = sessionContext.getUserTransaction(); | try { | uT.begin(); | | uT.setRollbackOnly(); | | uT.commit(); | | }catch (Exception ex) { | try { |System.out.println(Caught exception: + ex.getMessage()); |uT.rollback(); |System.out.println(rollback OK); | } catch (Exception rex){ |System.out.println(***); |System.out.println(Caught exception: + rex.getMessage()); |throw new EJBException(Rollback failed: + rex.getMessage()); | } | throw new EJBException(Transaction failed: + ex.getMessage()); | | } I expected to catch exception thrown by commit() method due to transaction rolled back. Then rollback transaction, and... the end. But something doesn't work like i expected. There is an exception thrown by method rollback(). Why? Below interesting output: 22:29:44,625 INFO [STDOUT] Caught exception: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=LENOVO-98B03F24/89, BranchQual=, localId=89] OK 22:29:44,625 INFO [STDOUT] *** ??? 22:29:44,671 INFO [STDOUT] Caught exception: No transaction.??? 22:29:44,671 ERROR [LogInterceptor] EJBException in method: public abstract void home.main.Main.rollbackMethod() throws java.rmi.RemoteException: javax.ejb.EJBException: Rollback failed: No transaction. at home.main.MainBean.rollbackMethod(MainBean.java:128) ... Can you explain me why i cannot roll back my transaction? vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3986998#3986998 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3986998 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Beginners Corner] - Re: jta transactions - simple question
Hello Thank you for your answer. I put uT.setRollbackOnly() only to check what would happen. Now I've changed this line to: throw new Exception(dark force exception) and rollback method in catch (Exception ex) works quite fine. So i belive that failed commit() method is the reason of missed transaction. I belive also that when i can mark transaction for rolback i must check if the transaction is marked for rollback before call commit() method. I think the best way will be replace commit() with: if (uT.getStatus() == Status.STATUS_MARKED_ROLLBACK) | throw new Exception(dark force exception); | else | uT.commit(); I think throwing an exception is a good thing. Exception will be caught, and efter rollback will be thrown to the client. Thanks to that client will know that something wrong has happened. Am I right? vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3987029#3987029 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3987029 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - Re: DataSource and connection pool
Hello Thank you for your reply. I've found an MBean registered with: jboss.jca:name=XAOracleDS,service=ManagedConnectionPool where XAOracleDS is a jndi name of my DataSource. There are information I was looking for. Thanks again. vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3985267#3985267 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3985267 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - DataSource and connection pool
Hello I've created datasource xml file with elements: min-pool-size5/min-pool-size max-pool-size100/max-pool-size I can locate and use it, but now I would like to know if there is any way to check: - number of connections in pool - number of used connections in pool? There must be a way to do this... i think. Any suggestions? vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3985172#3985172 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3985172 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Management, JMX/JBoss] - MBeanService + Standard MBeans = ???
Hello I'm using: JBOSS: jboss-4.0.5.GA java version: 1.4.2_12 system: Windows XP Home Edition 1. I've created one service: CFGLoaderService extending class ServiceMBeanSupport. 2. This service creates some of standard MBeans in method start_service() using method createMBean 3. Each standard MBean creates one important thing: object (type RuleBase - Drools library - but this is not the most important thing, i think) 4. This object is binding to JNDI. At this stage of process we have: - one service - some standard MBeans - each MBean have reference to object, and this object is bound with JNDI In addition each standard MBean has method 'reload()' which creating new object, and this new object is bound with the old JNDI name. So using the same JNDI name client can locate new object. ServiceMBean has metod 'reload()' too. This metod calls metod 'reload' from appropiate standard MBean using mbs.invoke() method (mbs MBeanServer). Now unexpected (for me) result: Service creates Standard MBeans. Client locate object using JNDI and can find that object. But he cannot use this object becouse of some issues. (don't think about these issues now, look at the following description) Now we can open JMX console (http://localhost:8080/jmx-console/) and from standard MBean invoke method 'reload'. After this move we can locate object via JNDI and use it. Everything works fine. Now we can from JMX console use service method 'reload', which calls method 'reload' from appropiate standard MBean. After this move we can locate object via JNDI and we cannot use it (issues). How is it possible??? Service method 'reaload' calls method 'reaload' from standard MBean which works fine when called from JMX console. So from Service we cannot reload standard MBean. As i described at the begining after creating standard MBeans we cannot use them either. I think that happens due to the same reason for which 'reload' method from service doesn't work fine. If you are interested i can send you my code. Of course I don't have to tell you that you are my last chance to find a solution :). Thanks in advance vitor_b View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3983833#3983833 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3983833 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Eclipse IDE (users)] - missed org.jboss.naming package
Hello All I would like to register my MBeans using JNDI, and then from another bean localize registered MBeans. I found an example, how to do that: http://wiki.jboss.org/wiki/Wiki.jsp?page=BindMBeanToJNDI Unfortunately my Eclipse cannot resolved org.jboss.naming package. I cannot find that package too. So, thats the problem now: where can I find that package, can I download it from the net? I have: JBossIDE for Eclipse Version: 2.0.0 Build id: 2.0.0.Beta2 and jboss-4.0.5.GA Any suggestions? Thank in advantage. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981298#3981298 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981298 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Eclipse IDE (users)] - Re: missed org.jboss.naming package
I've just found it: {jboss.home}/server/default/lib/jboss.jar cheers :) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981301#3981301 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981301 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user