[Beginners Corner] - Very strange scenario
by kart3186
I have a very old version of my EAR and a new version of EAR. Previously, my JBoss was deployed with the old EAR. It was working fine. Now I undeployed it and deployed it with new EAR. When I tested the newly deployed one, I found that it is partially the previous deployment and partially the new deployment. Some JSPs and Beans are from the previous deployment and some are from new deployment. I don't understand how this is possible. The new EAR that I deployed works fine in another machine with JBoss freshly installed. I tried removing the entire tmp folder in the default installation. But still the same behavior happens. Anyone has faced such wierd scenario before ? Any help is appreciated.
-Karthik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164058#4164058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164058
17 years, 11 months
[JBossWS] - How to catch/get known of broken pipe exception within serve
by javaboss2008
Hi developers,
I have created a WS with some WebMethods running on Jboss as an Eclipse Dynamic Web Project. I am doing that with the annotations from javax.jws.*.
Now, it is possible that a method needs some time to reply to a clients call. The client could stop waiting for the reply by setting a timeout value on the WS call like:
client:
// a very short time to test the error
| int timeout = 10; // in ms
|
| // set the timeout property
| Map<String, Object> ctxt = ((BindingProvider)service).getRequestContext();
| ctxt.put(com.sun.xml.internal.ws.client.dispatch.impl.protocol.MessageDispatcherHelper.REQUEST_TIMEOUT, timeout);
|
| // now call the WS method
| result = service.myMethod(number);
If now the client stops waiting for the reply and after some time my serverside method wants to return its result to the client it fails with a java.net.SocketException 'Broken Pipe'. Unfortunately my servermethod finished successfully without getting known of the failed communication. The exception can only be seen in the jboss log.
Is there a common way to get known of the clientside connection reset within my serverside method? Does the WS-Framework provide any concept to manage such a race condition in an elegant way?
Or have u any other ideas on how I could solve my problem? I need to know, that the client has not recieved my result, cause in that case I need to rollback some actions that have been done on server side.
jboss-log4j serverlog:
2008-07-12 20:25:19,546 INFO [myws.MyWebServiceImpl] Webservice called: myMethod(5000001)
| 2008-07-12 20:25:19,766 DEBUG [myws.MyWebServiceImpl] returning result
| 2008-07-12 20:25:19,767 ERROR [org.jboss.ws.core.server.AbstractServiceEndpointServlet] Error processing web service request
| ClientAbortException: java.net.SocketException: Broken pipe
| at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
| at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
| at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:309)
| at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)
| at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98)
| at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:485)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.net.SocketException: Broken pipe
| at java.net.SocketOutputStream.socketWrite0(Native Method)
| at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
| at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
| at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:764)
| at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:124)
| at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:570)
| at org.apache.coyote.Response.doWrite(Response.java:560)
| at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
| ... 27 more
|
Thanks a lot for help.
javaboss2008
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164054#4164054
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164054
17 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - Hibernate bidirectional many-to-many issues
by imavroukakis
Hi,
I'm trying to play around with hibernate annotations, I'm coming up against a brick wall with a certain issue regarding a many to many relationship.
| @Entity
| public class Recipe implements Serializable{
|
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| @Column(name = "recipe_id")
| private Long id;
|
| @ManyToOne
| @JoinColumn(name="user_fk")
| private User user;
|
| @ManyToMany(
| targetEntity=gr.zymari.entities.Ingredient.class,
| cascade={CascadeType.ALL, CascadeType.MERGE}
| )
| @JoinTable(
| name="Recipe_Ingredients",
| joinColumns = @JoinColumn( name = "recp_id"),
| inverseJoinColumns = @JoinColumn( name = "ingr_id")
| )
| private Set<Ingredient> ingredients;
|
| public class Ingredient implements Serializable{
|
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| @Column(name = "ingredient_id")
| private Long id;
|
| private Integer quantity;
| private String name;
|
| @ManyToMany(
| cascade = {CascadeType.ALL, CascadeType.MERGE},
| mappedBy= "ingredients",
| targetEntity=Recipe.class
| )
| private Set<Recipe> recipies;
|
| @Entity
| public class User implements Serializable{
|
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| @Column(name = "user_id")
| private Long id;
|
| @OneToMany(mappedBy="user" ,cascade = {CascadeType.ALL, CascadeType.MERGE})
| private Set<Recipe> recipies;
|
This is the code that saves the User object
| Transaction tx = getHibSession().beginTransaction();
| tx.begin();
| Ingredient blackStuff = new Ingredient();
| blackStuff.setName("Chocolate");
| blackStuff.setMeasure(Measure.GRAM);
| blackStuff.setQuantity(100);
| recipe.addIngredient(blackStuff);
| user.addRecipe(recipe);
| recipe.setUser(user);
| getHibSession().saveOrUpdate(user);
| tx.commit();
|
The problem is that when I save the User object, it is persisted along with the Recipe object, however the table that is supposed to contain the many-to-many relationship of Recipe-Ingredient is empty. Can anyone shed some light on what I am doing wrong?
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164052#4164052
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164052
17 years, 11 months