[JBoss Seam] - POJOs instantiated twice
by jweidner
org.jboss.seam.Component.instantiateJavaBean is constructing two instances of all my POJOs. Is that suppose to happen? The first one gets instantiated by the first line of instantiateJavaBean. The second instance is created by org.jboss.seam.Component.wrap. (I'm new to JSF, Seam, and Facelets, so excuse me if this is a stupid question.) Here's my constructor:
public Location() {
System.out.println( "Location constructed. " + this );
Thread.dumpStack();
}
Below is the line printed and the start of the two stack traces.
Location constructed. com.aaa.travel.Location@61a2e7
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1158)
at com.aaa.travel.Location.(Location.java:22)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.jboss.seam.Component.instantiateJavaBean(Component.java:1045)
at org.jboss.seam.Component.instantiate(Component.java:1008)
at org.jboss.seam.Component.newInstance(Component.java:1718)
at org.jboss.seam.Component.getInstance(Component.java:1625)
at org.jboss.seam.Component.getInstance(Component.java:1592)
at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:46)
at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42
)
at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:574)
at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:455)
at org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingImpl.java:172)
at org.jboss.seam.core.Expressions$1.getType(Expressions.java:46)
at org.jboss.seam.core.Page$PageParameter.getConverter(Page.java:48)
at org.jboss.seam.core.Pages.applyRequestParameterValues(Pages.java:523)
at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:186)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:51)
)
Location constructed. com.aaa.travel.Location$$EnhancerByCGLIB$$771353c0@abf658
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1158)
at com.aaa.travel.Location.(Location.java:22)
at com.aaa.travel.Location$$EnhancerByCGLIB$$771353c0.()
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.jboss.seam.Component.wrap(Component.java:1065)
at org.jboss.seam.Component.instantiateJavaBean(Component.java:1054)
at org.jboss.seam.Component.instantiate(Component.java:1008)
at org.jboss.seam.Component.newInstance(Component.java:1718)
at org.jboss.seam.Component.getInstance(Component.java:1625)
at org.jboss.seam.Component.getInstance(Component.java:1592)
at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:46)
at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42
)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998280#3998280
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998280
19 years, 3 months
[JBoss Seam] - Re: Seam and Portal Future
by swestbom
What is missing from seam applications is independent state maintenance for the various portlets on the page. We have many applications that we want to bring together under one site. These sites are all intranet based so the weight isn't as much of an issue (this can be ameliorated to a considerable degree).
Also, where appropriate, we use traditional MVC (Sorry, not yours Gavin) and AJAX within portlets to deal with weight and avoid having to rebuild the whole page when an action is called within a portlet, so it is a hybrid.
I really don't think that portlets are a big pain because I am not using seam to build them, I use that XML crazy other framework that Gavin King loves to take cracks at.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998276#3998276
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998276
19 years, 3 months
[JBossWS] - WebService does not receive all the parameters passed from t
by rkodumagulla1
I am using JBoss IDE Plugin for Eclipse 3.2.1 and running JBoss 4.0.5 GA app server. I am able to create a web service and deploy it to the server. However, when the WSClientProxy sends requests the web service by passing the parameters, the web service only gets the first parameter and the other parameters are always null
Did any body else run into this issue? Any help will be appreciated.
Here is my WSClient Proxy Class
------------------------------------------------------------------
package localhost.mtcse.services.SimpleWebService;
import java.rmi.RemoteException;
public class SimpleWebServiceProxy implements localhost.mtcse.services.SimpleWebService.SimpleWebService {
private String _endpoint = null;
private localhost.mtcse.services.SimpleWebService.SimpleWebService simpleWebService = null;
public SimpleWebServiceProxy() {
_initSimpleWebServiceProxy();
}
private void _initSimpleWebServiceProxy() {
try {
simpleWebService = (new localhost.mtcse.services.SimpleWebService.SimpleWebServiceServiceLocator()).getSimpleWebService();
if (simpleWebService != null) {
if (_endpoint != null)
((javax.xml.rpc.Stub)simpleWebService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
else
_endpoint = (String)((javax.xml.rpc.Stub)simpleWebService)._getProperty("javax.xml.rpc.service.endpoint.address");
}
}
catch (javax.xml.rpc.ServiceException serviceException) {}
}
public String getEndpoint() {
return _endpoint;
}
public void setEndpoint(String endpoint) {
_endpoint = endpoint;
if (simpleWebService != null)
((javax.xml.rpc.Stub)simpleWebService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
}
public localhost.mtcse.services.SimpleWebService.SimpleWebService getSimpleWebService() {
if (simpleWebService == null)
_initSimpleWebServiceProxy();
return simpleWebService;
}
public java.lang.String testParameters(java.lang.String parm1, java.lang.String parm2, java.lang.String parm3) throws java.rmi.RemoteException{
if (simpleWebService == null)
_initSimpleWebServiceProxy();
return simpleWebService.testParameters(parm1, parm2, parm3);
}
public static void main(String[] args) throws RemoteException {
SimpleWebServiceProxy swsp = new SimpleWebServiceProxy();
System.out.println(swsp.testParameters("Work1", "Work2", "Work3"));
}
}
-----------------------------------------------------------------
Here is my web service
-----------------------------------------------------------------
package org.dhhs.mtcse.service;
import org.dhhs.mtcse.session.*;
import java.util.*;
import com.finalist.util.log.*;
import org.dhhs.mtcse.exception.GenericBusinessException;
import org.apache.commons.beanutils.BeanUtils;
import org.dhhs.mtcse.util.log.*;
import org.apache.axis.AxisFault;
public class SimpleWebService {
/**
* The logger object.
*/
private static Logger log = LogService
.getLogger(SimpleWebService.class);
public String testParameters(String parm1, String parm2, String parm3) throws Exception {
log.debug("Parm 1: " + parm1);
log.debug("Parm 2: " + parm2);
log.debug("Parm 3: " + parm3);
return "Returned String is " + parm1 + " " + parm2 + " " + parm3;
}
}
------------------------------------------------------------
Here is the wsdl generated by Axis in JBoss
------------------------------------------------------------
?
<wsdl:definitions targetNamespace="http://localhost:8080/mtcse/services/SimpleWebService">
?
<!--
WSDL created by Apache Axis version: 1.2
Built on May 03, 2005 (02:20:24 EDT)
-->
?
<wsdl:types>
?
?
</wsdl:types>
?
<wsdl:message name="testParametersResponse">
<wsdl:part element="impl:testParametersReturn" name="testParametersReturn"/>
</wsdl:message>
?
<wsdl:message name="testParametersRequest">
<wsdl:part element="tns1:parm1" name="parm1"/>
<wsdl:part element="tns1:parm2" name="parm2"/>
<wsdl:part element="tns1:parm3" name="parm3"/>
</wsdl:message>
?
<wsdl:portType name="SimpleWebService">
?
<wsdl:operation name="testParameters" parameterOrder="parm1 parm2 parm3">
<wsdl:input message="impl:testParametersRequest" name="testParametersRequest"/>
<wsdl:output message="impl:testParametersResponse" name="testParametersResponse"/>
</wsdl:operation>
</wsdl:portType>
?
<wsdl:binding name="SimpleWebServiceSoapBinding" type="impl:SimpleWebService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
?
<wsdl:operation name="testParameters">
<wsdlsoap:operation soapAction=""/>
?
<wsdl:input name="testParametersRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
?
<wsdl:output name="testParametersResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
?
<wsdl:service name="SimpleWebServiceService">
?
<wsdl:port binding="impl:SimpleWebServiceSoapBinding" name="SimpleWebService">
<wsdlsoap:address location="http://localhost:8080/mtcse/services/SimpleWebService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Appreciate your help.
RK
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998275#3998275
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998275
19 years, 3 months
[JBoss Seam] - Re: Seam and Portal Future
by bsmithjj
Just a bit more on this discussion - mainly in response to the following:
"norman.richards(a)jboss.com" wrote : Portal does solve some big issues. jboss.org runs on portal, and I couldn't imagine trying to do something with that scope by building up all the components in Seam. There are too many moving pieces, developed by different teams that need to come together. Things like that really need advanced infrastructure, and I really don't think *I* would want to write that.
|
Big issues - what big issues does the Portal solve? There are many technologies suitable for building up large web sites - using a system that's primary feature is support for JSR 168 API's wouldn't be my first choice for building a 'large site' - I don't really count the CMS component of the portal as a serious component (partly because the API's, behavior, and schema seem to be a moving target between point releases). It doesn't bother me, because I think the 'Seam way' is much better than trying to map my features onto portlet API's, however, I should point out that your statement about Seam can be interpreted to mean that Seam can't cut it for the 'real stuff' ;-).
anonymous wrote : When writing the dvd store, I tried to simulate the effect of a portal...
Did you really simulate the effect of a portal or did you make an effort to factor the view into logical components?
anonymous wrote : Portal is clearly too heavy a tool, but I don't know of a lightweight portal solution for these types of things. I'm very curious to see how other people approach these types of issues and whether or not someone can come up with something to sit on top of seam to simply create a portal-lite environment.
I think you can already achieve a lot of this kind of portalizing effect using Facelets templates / components. Probably the least portable part of building a portal is the page layout and portlet-page embedding aspects. Having 'done' both with JBPortal and Seam - I sincerely think the Facelets way gets easier the more pages and components you have - and thus seems more 'scalable' to me from a development-process perspective.
good discussion!
Brad Smith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998269#3998269
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998269
19 years, 3 months