[Clustering/JBoss] - Re: Does clustering require traffic over 1098 as well as 118
by annecotter
Thanks for the answer Brian.
I have two machines with multiple interfaces. Clustering traffic is configured to go over bge2, and all other traffic (JNDI/RMI/JMS) is over bge1. If the two machines don't have IP connectivity over bge1 I get the following messages when a new member joins the cluster:
2006.07.21 12:51:20 WARN [org.jgroups.protocols.pbcast.NAKACK] [dino2:11800 (additional data: 17 bytes)] discarded message from non-member 10.10.10.10:11800
When the two machines can see each other over bge1 (as well as bge2), clustering works fine. In this case when a new member joins the cluster, I see traffic over 1098 at the beginning of the join. This is why I was suspecting RMI calls between the servers. Am I missing any obvious reasons why the first case doesn't work? What causes my second machine (10.10.10.10) to go from being a non-member, to being considered a member so that the first machine won't discard it's messages?
Thanks
Anne
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960484#3960484
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960484
19 years, 9 months
[JBossWS] - Dates in Web Services
by wconroy
I am having trouble using dates in web services. I have the following
| @WebService(name = "EndpointInterface",
| targetNamespace = "http://test.com/test",
| serviceName = "TestWebservice")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @Stateless
| public class TestWebservice implements TestWebserviceRemote {
|
| @WebMethod
| public void getData(Date theDate) {
| Logger.getLogger(TestWebservice.class).info("Got Date: " + theDate);
| }
| }
|
It produces this as the wsdl when I deploy it on 4.0.4.GA with JbossWS 1.0.1
| <?xml version="1.0" encoding="UTF-8"?>
| <definitions name="TestWebservice" targetNamespace="http://skyroad.com/securitiesservice" xmlns:tns="http://skyroad.com/securitiesservice" xmlns:xsd="http:/
| /www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
| <types>
| </types>
| <message name="EndpointInterface_getDataResponse">
| </message>
| <message name="EndpointInterface_getData">
| <part name="Date_1" type="xsd:dateTime"/>
| </message>
| <portType name="EndpointInterface">
| <operation name="getData" parameterOrder="Date_1">
| <input message="tns:EndpointInterface_getData"/>
| <output message="tns:EndpointInterface_getDataResponse"/>
| </operation>
| </portType>
| <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
| <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="getData">
| <soap:operation soapAction=""/>
| <input>
| <soap:body use="literal" namespace="http://skyroad.com/securitiesservice"/>
| </input>
| <output>
| <soap:body use="literal" namespace="http://skyroad.com/securitiesservice"/>
| </output>
| </operation>
| </binding>
| <service name="TestWebservice">
| <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
| <soap:address location="http://dlnx07.skyroadtech.com:8080/securitiesServiceWS/TestWebservice"/>
| </port>
| </service>
| </definitions>
|
When I try to consume the service, the server throws the following exception
| 12:29:47,089 ERROR [SOAPFaultExceptionHelper] SOAP request exception
| org.jboss.ws.WSException: Java type 'class java.util.Date' is not assignable from: java.util.GregorianCalendar
| at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:277)
| at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
| at org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103)
| at org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
| at org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB3.invokeServiceEndpoint(ServiceEndpointInvokerEJB3.java:115)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:115)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:219)
| at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
| at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:109)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
|
Is there something that I need to do in order for the dates in my request to get parsed correctly? I have looked through the samples, but they are very trivial and dont seem to have dates.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960478#3960478
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960478
19 years, 9 months
[JBossWS] - Re: A class as a parameter in a webservice
by EstrellaRichardson
Actually,
I think what you need to do is to add getter/setter methods to your class. Make it comply with the Java beans rules and when you run WSTools, it will give the specifics of your libro class.
Example:
import java.io.Serializable;
public class InfoObj implements Serializable {
private static final long serialVersionUID = 0;
private String contactName = null;
private String address = null;
private String city = null;
private String state = null;
private String zip = null;
public void setContactName(String name){
contactName = name;
}
public void setAddress(String addr){
address = addr;
}
public void setCity(String iCity){
city = iCity;
}
public void setState(String st){
state = st;
}
public void setZip(String iZip){
zip = iZip;
}
public String getContactName(){
return contactName;
}
public String getAddress(){
return address;
}
public String getCity(){
return city;
}
public String getState(){
return state;
}
public String getZip(){
return zip;
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960477#3960477
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960477
19 years, 9 months
[JBoss Seam] - Stale Session Objects ? DataModelSelection Problems
by kryptontri
JBoss 4.0.4.GA
JBoss Seam 1.0.1 GA
Hi
I am having issues dealing with 1 to many relationships and DataModelSelection, in that
session data i think, doesn't seem to be cleared, this issue happens sporadically, i am looking for a pattern to see when it fails.
Basically, I have a set of rate objects that i can add for a contractor's page
This is the vew
anonymous wrote :
|
|
|
| <c:choose>
| <c:when test='${ratesPageManager.rates == null or ratesPageManager.rowCount == 0}'>
| Empty Rates
| </c:when>
| <c:otherwise>
| <h:dataTable value="#{ratesPageManager.rates}" var="item" rendered="#{ratesPageManager.rowCount>0}" rowClasses="rvgRowOne,rvgRowTwo">
| <h:column>
| <f:facet name="header"><h:outputText value="Duration"/></f:facet>
| <h:outputText value="#{item.duration}"/>
| </h:column>
| <h:column>
| <f:facet name="header"><h:outputText value="Unit"/></f:facet>
| <h:outputText value="#{item.unit}"/>
| </h:column>
| <h:column>
| <f:facet name="header"><h:outputText value="Currency"/></f:facet>
| <h:outputText value="#{item.currency}"/>
| </h:column>
| <h:column>
| <f:facet name="header"><h:outputText value="Cost"/></f:facet>
| <h:outputText value="#{item.cost}"/>
| </h:column>
| <h:column>
| <f:facet name="header">Action</f:facet>
| <h:commandLink action="#{ratesPageManager.deleteRate}">Delete</h:commandLink>
| </h:column>
|
| </h:dataTable>
| </c:otherwise>
| </c:choose>
|
|
|
|
|
|
|
| <h:form>
|
|
| <h:outputLabel for="duration">Duration:</h:outputLabel>
| <h:selectOneMenu id="duration" value="#{rate.duration}"><f:selectItems value="#{ratesManager.durations}"/></h:selectOneMenu>
| <h:outputLabel for="unit">Unit:</h:outputLabel>
| <h:selectOneMenu id="unit" value="#{rate.unit}"><f:selectItems value="#{ratesManager.units}"/></h:selectOneMenu>
| <h:outputLabel for="currency">Currency:</h:outputLabel>
| <h:selectOneMenu id="currency" value="#{rate.currency}"><f:selectItems value="#{ratesManager.currencys}"/></h:selectOneMenu>
| <h:outputLabel for="cost">Cost:</h:outputLabel>
| <h:selectOneMenu id="cost" value="#{rate.cost}"><f:selectItems value="#{ratesManager.costs}"/></h:selectOneMenu>
|
|
|
| <h:commandButton value="Add Rate" action="#{ratesPageManager.addRate}" class="button"/>
|
|
|
| </h:form>
|
|
|
|
For the Session bean behind this
anonymous wrote :
| @Stateful
| @Scope(ScopeType.SESSION)
| @Name("ratesPageManager")
| @Interceptors(SeamInterceptor.class)
| @LoggedIn
| public class RatesPageManagerBean implements RatesPageManager {
|
| private static final Log log = LogFactory.getLog(RatesPageManagerBean.class.getName());
|
| @In
| @Out
| @Valid
| private User user;
|
| @In
| @Out
| @Valid
| private Profile profile;
|
| @In(required = false)
| @Out
| @Valid
| private RatesPage ratesPage;
|
| @PersistenceContext
| private EntityManager em;
|
| @In
| private transient FacesContext facesContext;
|
| @DataModel
| private List rates = new ArrayList();
|
| @Out(required=false)
| @DataModelSelection
| private Rate selectedRate;
|
| @In(required = false, create = true)
| @Out(required=false)
| private Rate rate;
|
| public Rate getRate() {
| return rate;
| }
|
| public void setRate(Rate rate) {
| this.rate = rate;
| }
|
| @IfInvalid(outcome = REDISPLAY)
| public String create() {
| if (profile.getRatesPage() == null) {
| em.persist(ratesPage);
| profile.setRatesPage(ratesPage);
| profile = em.merge(profile);
| return "viewRatesPage";
| } else {
| facesContext.addMessage(null, new FacesMessage("RatesPage already exists"));
| return "viewProfile";
| }
| }
|
| public String select() {
| profile = user.getProfile();
| ratesPage = profile.getRatesPage();
| rates.clear();
| rates.addAll(ratesPage.getRates());
| clearRatesOnDisplay();
| return "viewRatesPage";
| }
|
|
| private boolean isUnSet(Rate rateToCheck) {
|
| boolean isOk = (
| (rateToCheck.getCost() == 0) || (rateToCheck.getCurrency().equals("-")) ||
| (rateToCheck.getDuration() == 0) || (rateToCheck.getUnit().equals("-"))
| );
| log.info("Rate check:: cost=" + rateToCheck.getCost() + " currency=" +rateToCheck.getCurrency()
| + " duration=" + rateToCheck.getDuration() + " unit=" + rateToCheck.getUnit());
| return isOk;
| }
|
|
| public String addRate() {
| log.info("addRate() called");
|
| if(isUnSet(rate)) {
| log.warn("Failed rates check");
| rate = null;
| facesContext.addMessage(null, new FacesMessage("Please enter rates"));
| return "viewRatesPage";
| }
| log.info("trying to add rate ..");
| rate.setRatesPage(ratesPage);
| em.persist(rate);
| ratesPage.addRate(rate);
| ratesPage = em.merge(ratesPage);
| profile = em.merge(profile);
| log.info("Persisted! and trying to remove");
| clearRatesOnDisplay();
| return select();
| }
|
| public String deleteRate() {
| log.info("deleteRate() called, removing " + selectedRate);
| rates.remove(selectedRate);
| ratesPage.removeRate(selectedRate);
| em.remove(selectedRate);
| clearRatesOnDisplay();
| return "viewRatesPage";
| }
|
| public List getRates() {
| log.info("getRates() called size = " + this.rates.size());
| return this.rates;
| }
| public void setRates(List in) {
| this.rates = in;
| }
| public int getRowCount() {
| return this.rates.size();
| }
|
|
|
| public String delete() {
| profile.setGalleryPage(null);
| em.remove(ratesPage);
| profile = em.merge(profile);
| return "viewProfile";
| }
|
| @IfInvalid(outcome = REDISPLAY)
| public String edit() {
| ratesPage = em.merge(ratesPage);
| return "viewRatesPage";
| }
|
| @Destroy
| @Remove
| public void destroy() {
| }
|
| private void clearRatesOnDisplay() {
| Contexts.getPageContext().remove("rate");
| rate = null;
| selectedRate = null;
| }
|
The rate object which forms the many side of the relationship
anonymous wrote :
| @Entity
| @Name("rate")
| @Scope(SESSION)
| public class Rate implements Serializable {
|
| protected int Id = 0;
|
| protected int duration = 0;
| protected String unit = null;
| protected String currency = null;
| protected int cost = 0;
| protected RatesPage ratesPage = null;
|
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| public int getId() {
| return Id;
| }
|
| public void setId(int id) {
| Id = id;
| }
|
| @NotNull
| public int getDuration() {
| return duration;
| }
|
| public void setDuration(int duration) {
| this.duration = duration;
| }
|
| @NotNull
| public String getUnit() {
| return unit;
| }
|
| public void setUnit(String unit) {
| this.unit = unit;
| }
|
| @NotNull
| public String getCurrency() {
| return currency;
| }
|
| public void setCurrency(String currency) {
| this.currency = currency;
| }
|
| @NotNull
| public int getCost() {
| return cost;
| }
|
| public void setCost(int cost) {
| this.cost = cost;
| }
|
| @ManyToOne
| @JoinColumn(name = "RATES_PAGE_ID")
| public RatesPage getRatesPage() {
| return ratesPage;
| }
|
| public void setRatesPage(RatesPage ratesPage) {
| this.ratesPage = ratesPage;
| }
|
| public boolean equals(Object o) {
| if (this == o) return true;
| if (o == null || getClass() != o.getClass()) return false;
|
| final Rate rate = (Rate) o;
|
| if (Id != rate.Id) return false;
| if (cost != rate.cost) return false;
| if (duration != rate.duration) return false;
| if (currency != null ? !currency.equals(rate.currency) : rate.currency != null) return false;
| if (ratesPage != null ? !ratesPage.equals(rate.ratesPage) : rate.ratesPage != null) return false;
| if (unit != null ? !unit.equals(rate.unit) : rate.unit != null) return false;
|
| return true;
| }
|
| public int hashCode() {
| int result;
| result = Id;
| result = 29 * result + duration;
| result = 29 * result + (unit != null ? unit.hashCode() : 0);
| result = 29 * result + (currency != null ? currency.hashCode() : 0);
| result = 29 * result + cost;
| result = 29 * result + (ratesPage != null ? ratesPage.hashCode() : 0);
| return result;
| }
|
| public String toString() {
| StringBuffer buffer = new StringBuffer();
| buffer.append("Id=").append(Id);
| buffer.append(" Duration=").append(duration);
| buffer.append(" Unit=").append(unit);
| buffer.append(" Currency=").append(currency);
| buffer.append(" Cost=").append(cost);
| // buffer.append(" RatesPageId=").append(ratesPage.getId());
| return buffer.toString();
| }
|
| }
|
|
What happens is that the debug server log will show an old rate, perhaps the
previous one add or that exists in the session and displays
anonymous wrote :
| 2006-07-24 18:07:50,055 DEBUG [org.jboss.seam.Component] selected row: Id=39 Duration=1 Unit=Week Currency=$ Cost=150
|
I added the clearRatesOnDisplay method to nullify any existence of state, in
an attempt to ensure that the select menus in the view are cleaned.
Any ideas people?
TIA Krypt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960474#3960474
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960474
19 years, 9 months