[Installation, Configuration & Deployment] - JAXB 2.0 on JBoss
by rupertlssmith
I'm making use of JAXB 2.0 from the JWSDP 2.0 RI, mostly for unmarshalling XML config files compiled with xjc. I've been able to get the JAXB 2.0 jars working inside of a deployed .ear file by using an isolated class loader for my .ear.
Now, I need to write a standalone client utility that calls my deployed application and this also makes use of JAXB 2.0. In order to call my deployed app I need to put JBoss client jars on the classpath. I am unable to get this working because JAXB 2.0 conflicts with the JBoss's own JAXB stuff which is in the client jars. The JAXB specs say that you must unmarshall with the same version that you ran xjc from. There is no compatability between the output of xjc from different versions or vendor implementations.
What I'd like to know is, what exactly is the JAXB stuff in JBoss? Is it JBoss's own JAXB implementation? or is it a third party implementation? What version of JAXB does it implement and does it have an xjc compiler? Could I use it in my app and then happily share libs with jboss's JAXB implementation?
The other solution I can think of is to use some sort of class loading solution that lets me load the JAXB 2.0 jars that I need seperately from the JBosss client jars and avoid the conflict that way.
I read somewhere that JBoss 5 will use the JAXB RI, is this true?
Thanks for reading, and any replies you make.
Rupert Smith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966745#3966745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966745
19 years, 8 months
[JBoss Portal] - Re: Best way to learn
by Agathon
"danny_hon" wrote : We are also looking at what is the best framework for creating portlets. We find some issues using Struts. If we use request.setAttribute(...) in an Action class, the variable is not visible in the JSP. The work around is to use request.getSession.setAttribute(...). This is not very elegant, and we have to remove the sessiono attribute later. In addition, the validation from a form is not working. Even though it does not accept the invalid values (which is good), it does not show the error from the JSP <html:errors /> tag. It seems like these 2 problems are related to the fact that variable set by request.setAttribute() is not visible by the forwarded JSP.
|
| We are using JBP 2.2.x + Struts-Bridge 1.0. Does anyone have the same problem? Any help is appreciated.
Sorry about the late reply; I was very busy over the last little while. Perhaps I was a little over-zealous in stating there are "zero problems" using Struts in a Portlet context. This problem stems from the fact that Struts actions and the rendering of the resulting JSP are (usually) contained in two separate requests. To fix this you will need to extend the PortletRequestProcessor provided with the Struts Bridge. Here is an example:
| public class CustomPortletRequestProcessor extends PortletRequestProcessor {
| public void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
| HttpSession session = request.getSession();
| ActionMessages errors = (ActionMessages)session.getAttribute(Globals.ERROR_KEY);
| session.removeAttribute(Globals.ERROR_KEY);
|
| request.setAttribute(Globals.ERROR_KEY, errors);
|
| super.process(request, response);
|
| errors = (ActionMessages)request.getAttribute(Globals.ERROR_KEY);
|
| if (errors != null && errors.isAccessed()) {
| request.removeAttribute(Globals.ERROR_KEY);
| } else {
| session.setAttribute(Globals.ERROR_KEY, errors);
| }
| }
| }
|
The dual request is also a problem if you want to keep your Hibernate session (if you're using Hibernate) open for both requests (action and render). We haven't found a solution to this problem and are presently using a workaround; using tag libraries to load some objects/collections in the view.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966744#3966744
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966744
19 years, 8 months
[EJB 3.0] - Database triggers
by jbeer
Hi,
I am storing a heirarchical structure in the database using left and right traversal values. Every time I insert a record into a table, I have a after-insert trigger than fires and updates many records in this table (a number of rows left and right traversal values can change when inserting a new record).
This works fine. Enter EJB3. Now this doesn't work fine: When I persist an entity that affects mutliple rows in the database, I need to refresh all of the entities that were affected by the after-insert trigger in the database. I don't know the exact entities that will be affected, so it seems like clearing the entity manager might be a good way (albeit expensive) to accomplish this. Entity callbacks seemed like the way to approach this, using @PostPersist annotation on the entities that get updated. However, I can't seem to get a hold of the EntityManager (through the bean, injection, or a JNDI lookup).
a) Can you get an EntityManager from an entity callback?
b) Is there a better approach to do this? I have thought of moving the database triggers into java code in the Entity callback, but since I can't get the EntityManager at this point, that's not a viable option.
Any thoughts and help is appreciated,
Jonathan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966742#3966742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966742
19 years, 8 months
[JBoss jBPM] - SOAP Fault Exception - BPEL ATM Example
by KVAK_TNT
Hi there!
I have a big problem with the ATM-Example.
All the time I want to start the ATM-GUI or start the JUnit-Tests it fails with the following message (bellow the next paragraph)
Now I have found out that this happens not every time and I can sometimes start the GUI (but never run through the JUNit Tests).
So I checked the code and followed the lines...
Next point i found out was that It was not possible to connect to the Service twice with the same programinstance. If I had disconeccted and tried again to connect to the "ATM-Terminal" I get the same error as follows:
| 20060822 17:32:42:495 DEBUG [Link: javax.xml.rpc.soap.SOAPFaultException.<init>(SOAPFaultException.java:91)] - new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Server,string=The service is not in an appropiate state for the requested operation,actor=null,detail=null]
| 20060822 17:32:42:511 ERROR [Link: org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:713)] - Call invocation failed
| javax.xml.rpc.soap.SOAPFaultException: The service is not in an appropiate state for the requested operation
| at org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper.getSOAPFaultException(SOAPFaultExceptionHelper.java:100)
| at org.jboss.ws.binding.soap.SOAPBindingProvider.unbindResponseMessage(SOAPBindingProvider.java:505)
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:704)
| at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:398)
| at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:164)
| at $Proxy2.status(Unknown Source)
| at org.jbpm.bpel.tutorial.atm.terminal.ConnectAction.actionPerformed(ConnectAction.java:68)
| at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
| at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
| at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
| at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
| at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
| at java.awt.Component.processMouseEvent(Component.java:5488)
| at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
| at java.awt.Component.processEvent(Component.java:5253)
| at java.awt.Container.processEvent(Container.java:1966)
| at java.awt.Component.dispatchEventImpl(Component.java:3955)
| at java.awt.Container.dispatchEventImpl(Container.java:2024)
| at java.awt.Component.dispatchEvent(Component.java:3803)
| at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
| at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
| at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
| at java.awt.Container.dispatchEventImpl(Container.java:2010)
| at java.awt.Window.dispatchEventImpl(Window.java:1774)
| at java.awt.Component.dispatchEvent(Component.java:3803)
| at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
| at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
| at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
| at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
| java.rmi.RemoteException: Call invocation failed with code [Server] because of: The service is not in an appropiate state for the requested operation; nested exception is:
| javax.xml.rpc.soap.SOAPFaultException: The service is not in an appropiate state for the requested operation
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:715)
| at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:398)
| at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:164)
| at $Proxy2.status(Unknown Source)
| at org.jbpm.bpel.tutorial.atm.terminal.ConnectAction.actionPerformed(ConnectAction.java:68)
| at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
| at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
| at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
| at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
| at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
| at java.awt.Component.processMouseEvent(Component.java:5488)
| at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
| at java.awt.Component.processEvent(Component.java:5253)
| at java.awt.Container.processEvent(Container.java:1966)
| at java.awt.Component.dispatchEventImpl(Component.java:3955)
| at java.awt.Container.dispatchEventImpl(Container.java:2024)
| at java.awt.Component.dispatchEvent(Component.java:3803)
| at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
| at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
| at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
| at java.awt.Container.dispatchEventImpl(Container.java:2010)
| at java.awt.Window.dispatchEventImpl(Window.java:1774)
| at java.awt.Component.dispatchEvent(Component.java:3803)
| at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
| at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
| at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
| at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
| Caused by: javax.xml.rpc.soap.SOAPFaultException: The service is not in an appropiate state for the requested operation
| at org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper.getSOAPFaultException(SOAPFaultExceptionHelper.java:100)
| at org.jboss.ws.binding.soap.SOAPBindingProvider.unbindResponseMessage(SOAPBindingProvider.java:505)
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:704)
| ... 28 more
|
Now I have found out that there may be a timeoutproblem like at this code here:
ConnectAction.java
| public void actionPerformed(ActionEvent event) {
| Map context = AtmTerminal.getContext();
| AtmPanel atmPanel = (AtmPanel) context.get(AtmTerminal.PANEL);
|
| InitialContext ctx = null;
| try {
| ctx = getInitialContext();
| // JNDI name of service interface (in application-client.xml)
| String serviceRefName = "service/ATM";
| // lookup service interface in environment context
| AtmFrontEndService service = (AtmFrontEndService) ctx.lookup("java:comp/env/" + serviceRefName);
| // obtain dynamic proxy for web service port
| AtmFrontEnd atmFrontEnd = service.getAtmRelationPort();
| context.put(AtmTerminal.FRONT_END, atmFrontEnd);
|
| // connect to atm service
| int ticketNo = atmFrontEnd.connect();
| context.put(AtmTerminal.TICKET, new Integer(ticketNo));
|
| // update atm panel
| atmPanel.setMessage("Please log on,\nso we can begin");
| atmPanel.clearActions();
| atmPanel.addAction(new LogOnAction());
| atmPanel.addAction(new DisconnectAction());
| atmPanel.setStatus(atmFrontEnd.status(ticketNo).getValue());
| }
| catch (Exception e) {
| atmPanel.setMessage("Sorry, I am experiencing\ntechnical problems.\nPlease use another terminal.");
| e.printStackTrace();
| }
| finally {
| if (ctx != null) {
| try {
| ctx.close();
| }
| catch (NamingException e) {
| e.printStackTrace();
| }
| }
| }
| }
|
If I add a waitstate - this code works fantastically (in comparision to bevore :-) )
| // obtain dynamic proxy for web service port
| atmFrontEnd = service.getAtmRelationPort();
| context.put(AtmTerminal.FRONT_END, atmFrontEnd);
| Thread.sleep(1000); //************** New Code
|
| // connect to atm service
| int ticketNo = atmFrontEnd.connect();
| context.put(AtmTerminal.TICKET, new Integer(ticketNo));
| Thread.sleep(1000); //************** New Code
|
But this cannot be the real sollution. I have search the Inet (google) and this forum but I haven't found anything in comparision to this...
I hope anyone can tell me something about this.
Maybe some timeout settings in SOAP technologie? I have to say that I dont know anything about SOAP actually... -p)
By the way: I think the reason why I cannot really run through the JUnit test lays exactly at the same point!
Greetings
TNT
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966739#3966739
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966739
19 years, 8 months
[JBossCache] - Re: JBossCacheIDE 1.0 Released
by gurkanerdogdu
Hey Ben, for quick answer, I am just curious about whether you did the following actions or not ??
To view the object graph, you have to create the remote cache instance as "TreeCacheAop" in the wizard. And when the node instance is created in the pane(and assume you connected to the remote server successfully), when you right-click on the remote node instance, you could able to see "Show Object Graph" action. When you click the action, you are able to see the object graph in the "Object Graph View". That is the flow.
If you did all of them, but you are still not viewing the object graph, I will see it later and examine the problem if it has.
I will also add comments on your other items.
Gurkan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966733#3966733
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966733
19 years, 8 months
[JBossCache] - Re: Cannot Handle _put
by lasmith
This DOESN'T happen under load - I am the only person using the system (its in development on my local PC running XP). Here is a bit more of the log:
2006-08-22 16:03:09,421 DEBUG [com.msxi.warrantySystem.ejb.dao.GenericHibernateDAO] getting com.msxi.warrantySystem.ejb.entities.AuditType instance with id: 1
2006-08-22 16:03:09,421 DEBUG [org.jboss.cache.interceptors.OptimisticNodeInterceptor] unable to find node /com/msxi/warrantySystem/ejb/entities/AuditType/com.msxi.warrantySystem.ejb.entities.AuditType#1 in workspace.
2006-08-22 16:03:09,421 DEBUG [org.jboss.cache.interceptors.OptimisticNodeInterceptor] unable to find node /com/msxi/warrantySystem/ejb/entities/AuditType/com.msxi.warrantySystem.ejb.entities.AuditType#1 in workspace.
2006-08-22 16:03:09,421 INFO [org.jboss.cache.interceptors.OptimisticNodeInterceptor] Cannot Handle Method _put(GlobalTransaction::166, /com/msxi/warrantySystem/ejb/entities/AuditType/com.msxi.warrantySystem.ejb.entities.AuditType#1, item, CacheEntry(com.msxi.warrantySystem.ejb.entities.AuditType)[THIRD PARTY,An audit conducted by a third party], true, 0)
2006-08-22 16:03:09,421 DEBUG [org.jboss.cache.interceptors.OptimisticNodeInterceptor] Adding Method _put(GlobalTransaction::166, /com/msxi/warrantySystem/ejb/entities/AuditType/com.msxi.warrantySystem.ejb.entities.AuditType#1, item, CacheEntry(com.msxi.warrantySystem.ejb.entities.AuditType)[THIRD PARTY,An audit conducted by a third party], true, 0) to modification list
2006-08-22 16:03:09,437 DEBUG [com.msxi.warrantySystem.ejb.dao.GenericHibernateDAO] get successful, instance found
All the other log output is my own output. We use the bundled hibernate: 3.2.0.cr2. This deployed as a HAR and is configured to use the tree cache availble in JNDI like so:
| <attribute name="CacheProviderClass">org.jboss.hibernate.cache.DeployedTreeCacheProvider</attribute>
| <attribute name="DeployedTreeCacheObjectName">jboss.cache:service=HibernateTreeCache</attribute>
|
|
The tree cache mbean is configured like so:
| <server>
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
| <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=HibernateTreeCache">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.GenericTransactionManagerLookup</attribute>
| <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
| <attribute name="CacheMode">LOCAL</attribute>
| <attribute name="UseReplQueue">false</attribute>
| <attribute name="ReplQueueInterval">0</attribute>
| <attribute name="ReplQueueMaxElements">0</attribute>
| <attribute name="ClusterName">TreeCache-Cluster</attribute>
| <attribute name="ClusterConfig">
| <config>
| <UDP mcast_addr="228.1.2.3" mcast_port="48866" ip_ttl="64" ip_mcast="true" mcast_send_buf_size="150000"
| mcast_recv_buf_size="80000" ucast_send_buf_size="150000" ucast_recv_buf_size="80000" loopback="true"/>
| <PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false"/>
| <MERGE2 min_interval="10000" max_interval="20000"/>
| <!-- <FD shun="true" up_thread="true" down_thread="true" />-->
| <FD_SOCK/>
| <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false"/>
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192" up_thread="false" down_thread="false"/>
| <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false"/>
| <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false"/>
| <FRAG frag_size="8192" down_thread="false" up_thread="false"/>
| <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true"/>
| <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
| </config>
| </attribute>
| <attribute name="FetchInMemoryState">false</attribute>
| <attribute name="SyncReplTimeout">20000</attribute>
| <attribute name="LockAcquisitionTimeout">15000</attribute>
| <attribute name="InitialStateRetrievalTimeout">20000</attribute>
| <attribute name="EvictionPolicyClass"/>
| <attribute name="UseRegionBasedMarshalling">false</attribute>
| </mbean>
| </server>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966731#3966731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966731
19 years, 8 months