You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brad Harper <br...@gmail.com> on 2007/07/27 17:36:48 UTC

org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

CXF:wsdl2java creates the client side version of this object... what am I
missing so that it'll unmarshalled correctly?

Re: org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

Posted by Daniel Kulp <dk...@apache.org>.
Brad,

I'm 95% sure this is my fault again.   :-(

The last snapshot is from the 25th and that did break the List<Object> 
stuff.    I fixed it yesterday, but didn't deploy a new snapshot.   I'm 
doing that now, but that will take an hour or so.  

Couple notes:
That use of the @ResponseWrapper is not correct.   Technically, that 
shouldn't work.   I'm surprised it does.     It should be throwing an 
exception.     Those annotations are to specify classes that the runtime 
can use to "wrap" the parts and hold the other JAXB related annotations.   
Basically, in your case, it should point to a class that looks something 
like:
@XmlRootElement(......)
... other JAXB annotations ....
class GetAllProductsResponse {
     List<ProductSummary> _return;
    ..getter/setter....
}

The JAX-WS RI runtime requires those wrapper types to work.   In your 
case, you would first run wsgen on your service class to have it 
generate those classes for you.   With CXF, you CAN generate those with 
the java2wsdl tool with the "-s" flag.   However, the runtime should 
work without them.  (2.0 didn't due to bugs, we're hoping thats fixed in 
2.0.1)


If you want a workaround for the July 25th snapshot, there are a couple 
options:

1) Add a method like:
void bugHack(ProductSummary foo);
to the service.   The ProductSummary object will be found.

2)  Follow instructions at:
https://issues.apache.org/jira/browse/CXF-340
to add the class to the context.

3) If other classes in the same package of ProductSummary are found OK as 
they are parameters to a different method, you can add a "jaxb.index" 
file to the package that just contains the line:
ProductSummary 
(unqualified class name)


Either that or wait for the next snapshot.   :-)


Dan





On Friday 27 July 2007 16:10, Brad Harper wrote:
> The snapshot and adding @ResponseWrappers solved my service issues as
> long as I use a client other than CXF.  I've testing utilities I can
> use for now.  My main issue is when I enable my transaction advice. 
> Simply enabling this section in my config causes 4 of my 10 services
> to fail with the exception listed below:
>
> <aop:config>
>         <aop:advisor id="serviceTx" advice-ref="txAdvice"
> pointcut="execution(* *..service..*.*(..))" order="0"/>
>     </aop:config>
>
>
>     <tx:advice id="txAdvice">
>         <tx:attributes>
>             <tx:method name="find*" read-only="true"/>
>             <tx:method name="*"/>
>         </tx:attributes>
>     </tx:advice>
>
>
> All of the services are configured identically.... which is puzzling
> why the certain 4 fail.
>
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Marshalling Error:
> com.gdservices.model.thirdparty.TpMat is not known to this context
>         at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(
> JAXBEncoderDecoder.java:170)
>         at
> org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java
>
> :42)
>
>         at
> org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writePart
>s( AbstractOutDatabindingInterceptor.jav
> a:92)
>         at
> org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(
> BareOutInterceptor.java:68)
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:207)
>         at
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage
> (OutgoingChainInterceptor.java:73)
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:207)
>         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
> ChainInitiationObserver.java:73)
>         at
> org.apache.cxf.transport.servlet.ServletDestination.doMessage(
> ServletDestination.java:78)
>         at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(
> ServletController.java:224)
>         at org.apache.cxf.transport.servlet.ServletController.invoke(
> ServletController.java:137)
>         at org.apache.cxf.transport.servlet.CXFServlet.invoke(
> CXFServlet.java:271)
>         at org.apache.cxf.transport.servlet.CXFServlet.doPost(
> CXFServlet.java:249)
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:710) 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.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:230)
>         at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:175)
>         at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:104)
>         at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:261)
>         at org.apache.coyote.http11.Http11Processor.process(
> Http11Processor.java:844)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
>s( Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.xml.bind.MarshalException
>
>
> Any suggestions on how to handle my transactions?  Should my config
> above work?
>
> One key I've found is for List<Object> return types on my service
> interface, the ResponseWrapper classname attribute value needed to be
> the Object type of the list... like  below.
>
>     @WebMethod(operationName = "getAllProducts")
>     @ResponseWrapper(targetNamespace = "
> http://catalogService.service.gdservices.com",
>             className =
> "com.gdservices.service.thirdparty.ProductSummary")
> @WebResult(targetNamespace = "
> http://catalogService.service.gdservices.com",
>             name = "products")
>     List<ProductSummary> getAllProducts(Long userId, Integer
> detailLevel) throws ServiceException;
>
> This may be in the docs, but I may have overlooked it... may help
> somebody out though.
>
>  Thanks for your time.
>
> On 7/27/07, Daniel Kulp <dk...@apache.org> wrote:
> > On Friday 27 July 2007 11:36, Brad Harper wrote:
> > > CXF:wsdl2java creates the client side version of this object...
> > > what am I missing so that it'll unmarshalled correctly?
> >
> > This is probably also fixed in the latest SNAPSHOT (or by using the
> > wrappers objects).
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

Posted by Dan Diephouse <da...@envoisolutions.com>.
OK Brad sent me a config sample offline, but I wanted to respond here so it
would be properly archived. In essence, when you have a config like this:

   <jaxws:endpoint
     id="testService"
     address="/testService" >
               <jaxws:implementor>
                      <ref bean="myTestService" />
               </jaxws:implementor>
   </jaxws:endpoint>
   <bean id="myTestService" class="....TestServiceImpl"/>

And you combine it with the transaction/AOP stuff from spring, Spring will
replace the myTestService with a Java proxy which will take care of the
transactions. The downside is that this proxy won't have the annotations on
it necessary to create the web service. So CXF won't be able to create the
service properly.

There is at least one and possibly two the solutions to this. The first one
which I know works is to use the <jaxws:server> syntax which allows you to
specify the service class to use to construct the wsdl/service interface:


   <jaxws:server
     id="testService"
     address="/testService" serviceClass="...TestServiceImpl">
               <jaxws:implementor>
                      <ref bean="myTestService" />
               </jaxws:implementor>
   </jaxws:server>

The other possible solution is to tell Spring to use CGLIB bytecode weaving
instead of proxies. This can be done by adding the proxy-target-class
attribute supposedly (I'm going by the spring docs here, I've never tried
it):

<aop:config *proxy-target-class="true"*>

I think I'll probably add support for users to specify the
serviceClass/implementorClass on the <jaxws:endpoint>, but in the meantime
at least one of those solutions should work.

Cheers,

- Dan

On 7/30/07, Dan Diephouse <da...@envoisolutions.com> wrote:
>
> Hi Brad,
>
> Any chance you could at least attach your complete spring configuration? I
> think the config you outlined should work, but I would like to see more. Of
> course a test case would be welcome too :-)
>
> - Dan
>
> On 7/27/07, Brad Harper <br...@gmail.com> wrote:
> >
> > The snapshot and adding @ResponseWrappers solved my service issues as
> > long
> > as I use a client other than CXF.  I've testing utilities I can use for
> > now.  My main issue is when I enable my transaction advice.  Simply
> > enabling
> > this section in my config causes 4 of my 10 services to fail with the
> > exception listed below:
> >
> > <aop:config>
> >         <aop:advisor id="serviceTx" advice-ref="txAdvice"
> > pointcut="execution(* *..service..*.*(..))" order="0"/>
> >     </aop:config>
> >
> >
> >     <tx:advice id="txAdvice">
> >         <tx:attributes>
> >             <tx:method name="find*" read-only="true"/>
> >             <tx:method name="*"/>
> >         </tx:attributes>
> >     </tx:advice>
> >
> >
> > All of the services are configured identically.... which is puzzling why
> > the
> > certain 4 fail.
> >
> > INFO: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: Marshalling Error:
> > com.gdservices.model.thirdparty.TpMat is not known to this context
> >         at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(
> > JAXBEncoderDecoder.java:170)
> >         at org.apache.cxf.jaxb.io.DataWriterImpl.write(
> > DataWriterImpl.java
> > :42)
> >         at
> > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(
> > AbstractOutDatabindingInterceptor.jav
> > a:92)
> >         at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(
> > BareOutInterceptor.java:68)
> >         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > PhaseInterceptorChain.java:207)
> >         at
> > org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage
> > (OutgoingChainInterceptor.java:73)
> >         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > PhaseInterceptorChain.java:207)
> >         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
> > ChainInitiationObserver.java:73)
> >         at org.apache.cxf.transport.servlet.ServletDestination.doMessage
> > (
> > ServletDestination.java:78)
> >         at
> > org.apache.cxf.transport.servlet.ServletController.invokeDestination(
> > ServletController.java:224)
> >         at org.apache.cxf.transport.servlet.ServletController.invoke(
> > ServletController.java:137)
> >         at org.apache.cxf.transport.servlet.CXFServlet.invoke (
> > CXFServlet.java:271)
> >         at org.apache.cxf.transport.servlet.CXFServlet.doPost(
> > CXFServlet.java:249)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >         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.apache.catalina.core.StandardWrapperValve.invoke(
> > StandardWrapperValve.java:230)
> >         at org.apache.catalina.core.StandardContextValve.invoke(
> > StandardContextValve.java:175)
> >         at org.apache.catalina.core.StandardHostValve.invoke(
> > StandardHostValve.java:128)
> >         at org.apache.catalina.valves.ErrorReportValve.invoke(
> > ErrorReportValve.java:104)
> >         at org.apache.catalina.core.StandardEngineValve.invoke (
> > StandardEngineValve.java:109)
> >         at org.apache.catalina.connector.CoyoteAdapter.service(
> > CoyoteAdapter.java:261)
> >         at org.apache.coyote.http11.Http11Processor.process(
> > Http11Processor.java:844)
> >         at
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> > Http11Protocol.java:581)
> >         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> > JIoEndpoint.java:447)
> >         at java.lang.Thread.run(Thread.java:595)
> > Caused by: javax.xml.bind.MarshalException
> >
> >
> > Any suggestions on how to handle my transactions?  Should my config
> > above
> > work?
> >
> > One key I've found is for List<Object> return types on my service
> > interface,
> > the ResponseWrapper classname attribute value needed to be the Object
> > type
> > of the list... like  below.
> >
> >     @WebMethod(operationName = "getAllProducts")
> >     @ResponseWrapper(targetNamespace = "
> > http://catalogService.service.gdservices.com",
> >             className = "
> > com.gdservices.service.thirdparty.ProductSummary")
> >     @WebResult(targetNamespace = "
> > http://catalogService.service.gdservices.com",
> >             name = "products")
> >     List<ProductSummary> getAllProducts(Long userId, Integer
> > detailLevel)
> > throws ServiceException;
> >
> > This may be in the docs, but I may have overlooked it... may help
> > somebody
> > out though.
> >
> > Thanks for your time.
> >
> >
> > On 7/27/07, Daniel Kulp < dkulp@apache.org> wrote:
> > >
> > > On Friday 27 July 2007 11:36, Brad Harper wrote:
> > > > CXF:wsdl2java creates the client side version of this object... what
> > > > am I missing so that it'll unmarshalled correctly?
> > >
> > > This is probably also fixed in the latest SNAPSHOT (or by using the
> > > wrappers objects).
> > >
> > > --
> > > J. Daniel Kulp
> > > Principal Engineer
> > > IONA
> > > P: 781-902-8727    C: 508-380-7194
> > > daniel.kulp@iona.com
> > > http://www.dankulp.com/blog
> > >
> >
>
>
>
> --
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog




-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

Posted by Brad Harper <br...@gmail.com>.
What format do you need for a test case?

I have several spring files, but most are irrelevant - here's the other
essentials:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "
http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
        <property name="driverClassName" value="@DB-DRIVERNAME@"/>
        <property name="url" value="@DB-URL@"/>
        <property name="username" value="@DB-USERNAME@"/>
        <property name="password" value="@DB-PASSWORD@"/>
        <property name="maxActive" value="100"/>
        <property name="maxIdle" value="30"/>
        <property name="maxWait" value="1000"/>
        <property name="defaultAutoCommit" value="true"/>
        <property name="removeAbandoned" value="true"/>
        <property name="removeAbandonedTimeout" value="60"/>
    </bean>
    <bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean
">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.Oracle9Dialect
                </prop>
            </props>
        </property>
        <property name="mappingResources">
            <list>
                <value>com/gdservices/model/Address.hbm.xml</value>
                <value>com/gdservices/model/AddressType.hbm.xml</value>
                <value>com/gdservices/model/Criteria.hbm.xml</value>
                <value>com/gdservices/model/CriteriaGroup.hbm.xml</value>
                <value>com/gdservices/model/CriteriaType.hbm.xml</value>
                <value>com/gdservices/model/Description.hbm.xml</value>
                <value>com/gdservices/model/Keyword.hbm.xml</value>
                <value>com/gdservices/model/Media.hbm.xml</value>
                <value>com/gdservices/model/Metalist.hbm.xml</value>
                <value>com/gdservices/model/Permission.hbm.xml</value>
                <value>com/gdservices/model/PermissionType.hbm.xml</value>
                <value>com/gdservices/model/Price.hbm.xml</value>
                <value>com/gdservices/model/PriceCalculation.hbm.xml</value>

<value>com/gdservices/model/PriceCalculationRef.hbm.xml</value>
                <value>com/gdservices/model/PriceGroup.hbm.xml</value>
                <value>com/gdservices/model/PriceGroupPrice.hbm.xml</value>
                <value>com/gdservices/model/PriceType.hbm.xml</value>
                <value>com/gdservices/model/Product.hbm.xml</value>
                <value>com/gdservices/model/ProductAttribute.hbm.xml</value>

<value>com/gdservices/model/ProductAttributeGroup.hbm.xml</value>

<value>com/gdservices/model/ProductAttributeType.hbm.xml</value>
                <value>com/gdservices/model/ProductGroup.hbm.xml</value>

<value>com/gdservices/model/ProductGroupTypeDef.hbm.xml</value>
                <value>com/gdservices/model/ProductGroupType.hbm.xml</value>
                <value>com/gdservices/model/ProductType.hbm.xml</value>
                <value>com/gdservices/model/ProductTypeDef.hbm.xml</value>
                <value>com/gdservices/model/Promo.hbm.xml</value>
                <value>com/gdservices/model/Role.hbm.xml</value>
                <value>com/gdservices/model/Rule.hbm.xml</value>
                <value>com/gdservices/model/RuleAttribute.hbm.xml</value>

<value>com/gdservices/model/RuleAttributeGroup.hbm.xml</value>

<value>com/gdservices/model/RuleAttributeType.hbm.xml</value>
                <value>com/gdservices/model/RuleType.hbm.xml</value>
                <value>com/gdservices/model/UserAttribute.hbm.xml</value>

<value>com/gdservices/model/UserAttributeGroup.hbm.xml</value>

<value>com/gdservices/model/UserAttributeType.hbm.xml</value>
                <value>com/gdservices/model/User.hbm.xml</value>
                <value>com/gdservices/model/UserType.hbm.xml</value>

                <value>com/gdservices/model/thirdparty/Cart.hbm.xml</value>

<value>com/gdservices/model/thirdparty/CartLineItem.hbm.xml</value>

<value>com/gdservices/model/thirdparty/Customer.hbm.xml</value>

<value>com/gdservices/model/thirdparty/CustomerAddress.hbm.xml</value>

<value>com/gdservices/model/thirdparty/CustomerAddressType.hbm.xml</value>

<value>com/gdservices/model/thirdparty/TpMedia.hbm.xml</value>

<value>com/gdservices/model/thirdparty/TpMediaType.hbm.xml</value>

<value>com/gdservices/model/thirdparty/TpProductOvercharge.hbm.xml</value>

<value>com/gdservices/model/thirdparty/GdPricing.hbm.xml</value>

<value>com/gdservices/model/thirdparty/UserDefineProduct.hbm.xml</value>

<value>com/gdservices/model/thirdparty/UserMedia.hbm.xml</value>
            </list>
        </property>
    </bean>
</beans>

On 7/30/07, Dan Diephouse <da...@envoisolutions.com> wrote:
>
> Hi Brad,
>
> Any chance you could at least attach your complete spring configuration? I
> think the config you outlined should work, but I would like to see more.
> Of
> course a test case would be welcome too :-)
>
> - Dan
>
> On 7/27/07, Brad Harper <br...@gmail.com> wrote:
> >
> > The snapshot and adding @ResponseWrappers solved my service issues as
> long
> > as I use a client other than CXF.  I've testing utilities I can use for
> > now.  My main issue is when I enable my transaction advice.  Simply
> > enabling
> > this section in my config causes 4 of my 10 services to fail with the
> > exception listed below:
> >
> > <aop:config>
> >         <aop:advisor id="serviceTx" advice-ref="txAdvice"
> > pointcut="execution(* *..service..*.*(..))" order="0"/>
> >     </aop:config>
> >
> >
> >     <tx:advice id="txAdvice">
> >         <tx:attributes>
> >             <tx:method name="find*" read-only="true"/>
> >             <tx:method name="*"/>
> >         </tx:attributes>
> >     </tx:advice>
> >
> >
> > All of the services are configured identically.... which is puzzling why
> > the
> > certain 4 fail.
> >
> > INFO: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: Marshalling Error:
> > com.gdservices.model.thirdparty.TpMat is not known to this context
> >         at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(
> > JAXBEncoderDecoder.java:170)
> >         at org.apache.cxf.jaxb.io.DataWriterImpl.write(
> DataWriterImpl.java
> > :42)
> >         at
> > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(
> > AbstractOutDatabindingInterceptor.jav
> > a:92)
> >         at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(
> > BareOutInterceptor.java:68)
> >         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > PhaseInterceptorChain.java:207)
> >         at
> > org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage
> > (OutgoingChainInterceptor.java:73)
> >         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> > PhaseInterceptorChain.java:207)
> >         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
> > ChainInitiationObserver.java:73)
> >         at org.apache.cxf.transport.servlet.ServletDestination.doMessage
> (
> > ServletDestination.java:78)
> >         at
> > org.apache.cxf.transport.servlet.ServletController.invokeDestination(
> > ServletController.java:224)
> >         at org.apache.cxf.transport.servlet.ServletController.invoke(
> > ServletController.java:137)
> >         at org.apache.cxf.transport.servlet.CXFServlet.invoke(
> > CXFServlet.java:271)
> >         at org.apache.cxf.transport.servlet.CXFServlet.doPost(
> > CXFServlet.java:249)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> >         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.apache.catalina.core.StandardWrapperValve.invoke(
> > StandardWrapperValve.java:230)
> >         at org.apache.catalina.core.StandardContextValve.invoke(
> > StandardContextValve.java:175)
> >         at org.apache.catalina.core.StandardHostValve.invoke(
> > StandardHostValve.java:128)
> >         at org.apache.catalina.valves.ErrorReportValve.invoke(
> > ErrorReportValve.java:104)
> >         at org.apache.catalina.core.StandardEngineValve.invoke(
> > StandardEngineValve.java:109)
> >         at org.apache.catalina.connector.CoyoteAdapter.service(
> > CoyoteAdapter.java:261)
> >         at org.apache.coyote.http11.Http11Processor.process(
> > Http11Processor.java:844)
> >         at
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> > Http11Protocol.java:581)
> >         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> > JIoEndpoint.java:447)
> >         at java.lang.Thread.run(Thread.java:595)
> > Caused by: javax.xml.bind.MarshalException
> >
> >
> > Any suggestions on how to handle my transactions?  Should my config
> above
> > work?
> >
> > One key I've found is for List<Object> return types on my service
> > interface,
> > the ResponseWrapper classname attribute value needed to be the Object
> type
> > of the list... like  below.
> >
> >     @WebMethod(operationName = "getAllProducts")
> >     @ResponseWrapper(targetNamespace = "
> > http://catalogService.service.gdservices.com",
> >             className = "
> com.gdservices.service.thirdparty.ProductSummary
> > ")
> >     @WebResult(targetNamespace = "
> > http://catalogService.service.gdservices.com",
> >             name = "products")
> >     List<ProductSummary> getAllProducts(Long userId, Integer
> detailLevel)
> > throws ServiceException;
> >
> > This may be in the docs, but I may have overlooked it... may help
> somebody
> > out though.
> >
> > Thanks for your time.
> >
> >
> > On 7/27/07, Daniel Kulp <dk...@apache.org> wrote:
> > >
> > > On Friday 27 July 2007 11:36, Brad Harper wrote:
> > > > CXF:wsdl2java creates the client side version of this object... what
> > > > am I missing so that it'll unmarshalled correctly?
> > >
> > > This is probably also fixed in the latest SNAPSHOT (or by using the
> > > wrappers objects).
> > >
> > > --
> > > J. Daniel Kulp
> > > Principal Engineer
> > > IONA
> > > P: 781-902-8727    C: 508-380-7194
> > > daniel.kulp@iona.com
> > > http://www.dankulp.com/blog
> > >
> >
>
>
>
> --
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog
>

Re: org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

Posted by Dan Diephouse <da...@envoisolutions.com>.
Hi Brad,

Any chance you could at least attach your complete spring configuration? I
think the config you outlined should work, but I would like to see more. Of
course a test case would be welcome too :-)

- Dan

On 7/27/07, Brad Harper <br...@gmail.com> wrote:
>
> The snapshot and adding @ResponseWrappers solved my service issues as long
> as I use a client other than CXF.  I've testing utilities I can use for
> now.  My main issue is when I enable my transaction advice.  Simply
> enabling
> this section in my config causes 4 of my 10 services to fail with the
> exception listed below:
>
> <aop:config>
>         <aop:advisor id="serviceTx" advice-ref="txAdvice"
> pointcut="execution(* *..service..*.*(..))" order="0"/>
>     </aop:config>
>
>
>     <tx:advice id="txAdvice">
>         <tx:attributes>
>             <tx:method name="find*" read-only="true"/>
>             <tx:method name="*"/>
>         </tx:attributes>
>     </tx:advice>
>
>
> All of the services are configured identically.... which is puzzling why
> the
> certain 4 fail.
>
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Marshalling Error:
> com.gdservices.model.thirdparty.TpMat is not known to this context
>         at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(
> JAXBEncoderDecoder.java:170)
>         at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java
> :42)
>         at
> org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(
> AbstractOutDatabindingInterceptor.jav
> a:92)
>         at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(
> BareOutInterceptor.java:68)
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:207)
>         at
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage
> (OutgoingChainInterceptor.java:73)
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:207)
>         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
> ChainInitiationObserver.java:73)
>         at org.apache.cxf.transport.servlet.ServletDestination.doMessage(
> ServletDestination.java:78)
>         at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(
> ServletController.java:224)
>         at org.apache.cxf.transport.servlet.ServletController.invoke(
> ServletController.java:137)
>         at org.apache.cxf.transport.servlet.CXFServlet.invoke(
> CXFServlet.java:271)
>         at org.apache.cxf.transport.servlet.CXFServlet.doPost(
> CXFServlet.java:249)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>         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.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:230)
>         at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:175)
>         at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:104)
>         at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:261)
>         at org.apache.coyote.http11.Http11Processor.process(
> Http11Processor.java:844)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.xml.bind.MarshalException
>
>
> Any suggestions on how to handle my transactions?  Should my config above
> work?
>
> One key I've found is for List<Object> return types on my service
> interface,
> the ResponseWrapper classname attribute value needed to be the Object type
> of the list... like  below.
>
>     @WebMethod(operationName = "getAllProducts")
>     @ResponseWrapper(targetNamespace = "
> http://catalogService.service.gdservices.com",
>             className = "com.gdservices.service.thirdparty.ProductSummary
> ")
>     @WebResult(targetNamespace = "
> http://catalogService.service.gdservices.com",
>             name = "products")
>     List<ProductSummary> getAllProducts(Long userId, Integer detailLevel)
> throws ServiceException;
>
> This may be in the docs, but I may have overlooked it... may help somebody
> out though.
>
> Thanks for your time.
>
>
> On 7/27/07, Daniel Kulp <dk...@apache.org> wrote:
> >
> > On Friday 27 July 2007 11:36, Brad Harper wrote:
> > > CXF:wsdl2java creates the client side version of this object... what
> > > am I missing so that it'll unmarshalled correctly?
> >
> > This is probably also fixed in the latest SNAPSHOT (or by using the
> > wrappers objects).
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog
> >
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

Posted by Brad Harper <br...@gmail.com>.
The snapshot and adding @ResponseWrappers solved my service issues as long
as I use a client other than CXF.  I've testing utilities I can use for
now.  My main issue is when I enable my transaction advice.  Simply enabling
this section in my config causes 4 of my 10 services to fail with the
exception listed below:

<aop:config>
        <aop:advisor id="serviceTx" advice-ref="txAdvice"
pointcut="execution(* *..service..*.*(..))" order="0"/>
    </aop:config>


    <tx:advice id="txAdvice">
        <tx:attributes>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="*"/>
        </tx:attributes>
    </tx:advice>


All of the services are configured identically.... which is puzzling why the
certain 4 fail.

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error:
com.gdservices.model.thirdparty.TpMat is not known to this context
        at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(
JAXBEncoderDecoder.java:170)
        at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java
:42)
        at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(
AbstractOutDatabindingInterceptor.jav
a:92)
        at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(
BareOutInterceptor.java:68)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:207)
        at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage
(OutgoingChainInterceptor.java:73)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:207)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
ChainInitiationObserver.java:73)
        at org.apache.cxf.transport.servlet.ServletDestination.doMessage(
ServletDestination.java:78)
        at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(
ServletController.java:224)
        at org.apache.cxf.transport.servlet.ServletController.invoke(
ServletController.java:137)
        at org.apache.cxf.transport.servlet.CXFServlet.invoke(
CXFServlet.java:271)
        at org.apache.cxf.transport.servlet.CXFServlet.doPost(
CXFServlet.java:249)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        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.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:261)
        at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:844)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:581)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.bind.MarshalException


Any suggestions on how to handle my transactions?  Should my config above
work?

One key I've found is for List<Object> return types on my service interface,
the ResponseWrapper classname attribute value needed to be the Object type
of the list... like  below.

    @WebMethod(operationName = "getAllProducts")
    @ResponseWrapper(targetNamespace = "
http://catalogService.service.gdservices.com",
            className = "com.gdservices.service.thirdparty.ProductSummary")
    @WebResult(targetNamespace = "
http://catalogService.service.gdservices.com",
            name = "products")
    List<ProductSummary> getAllProducts(Long userId, Integer detailLevel)
throws ServiceException;

This may be in the docs, but I may have overlooked it... may help somebody
out though.

 Thanks for your time.


On 7/27/07, Daniel Kulp <dk...@apache.org> wrote:
>
> On Friday 27 July 2007 11:36, Brad Harper wrote:
> > CXF:wsdl2java creates the client side version of this object... what
> > am I missing so that it'll unmarshalled correctly?
>
> This is probably also fixed in the latest SNAPSHOT (or by using the
> wrappers objects).
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
>

Re: org.apache.cxf.interceptor.Fault: Unmarshalling Error : [Lcom.gdservices.service.catalogservice.TpFrame; is not known to this context

Posted by Daniel Kulp <dk...@apache.org>.
On Friday 27 July 2007 11:36, Brad Harper wrote:
> CXF:wsdl2java creates the client side version of this object... what
> am I missing so that it'll unmarshalled correctly?

This is probably also fixed in the latest SNAPSHOT (or by using the 
wrappers objects).

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog