[JBoss-user] [JBoss.NET] - Error deserializing custom java object (using jboss.net xdoc

2004-12-08 Thread mburbidg
I'm building a web service using jboss.net and it's associated xdoclet tags. 
I'm following the example in the article posted at 
www.nsdev.org/jboss/stories/jboss-net.html.

One of my web service messages takes a simple custom java object as one of it's 
parameters. I've followed the example in the before mentioned article to set up 
my custom java class so that it is correctly serialized and deserialized.

When I run an axis based client generated from the WSDL exported by my web 
service I get the following exception:

org.xml.sax.SAXException: Deserializing parameter 'scriptParameters':  could 
not find deserializer for type {http://sample}RunScriptParameters
at 
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at 
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
...

RunScriptParameters is the name of my custom java class.

I've annotated my custom java class with exdoclet tags as follows:

package sample;
  | 
  | /** The RunScriptParameters Class
  |  *  @jboss-net.xml-schema urn="sample:RunScriptParameters"
  |  */
  | public class RunScriptParameters implements java.io.Serializable
  | {
  | private java.lang.String scriptText;
  | 
  | RunScriptParameters()
  | {
  | }
  | 
  | public java.lang.String getScriptText()
  | {
  | return scriptText;
  | }
  | 
  | public void setScriptText(java.lang.String scriptText)
  | {
  | this.scriptText = scriptText;
  | }
  | }
My build.xml file contains the following element in the xdoclet build rule:

http://localhost:8080/jboss-net/services/${ejb.build.name}"; />

Note the prefix "sample" matches the prefix in the urn attribute in the xdoclet 
tag on the java class.

The following web service file is generated by xdoclet:


  | 
  | 
  | 
  | 
  | 
  | 
  | http://xml.apache.org/axis/wsdd/";
  | targetNamespace="http://localhost:8080/jboss-net/services/IdsEJB";
  | xmlns:sample="http://localhost:8080/jboss-net/services/IdsEJB";
  | xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
  | 
  | 
  | 
  |   
  | 
  | 
  | 
  |
  | 
  |
  |
  | 
  | 
  | 
  | 
  | 
  |   
  | 
  |   
  | 
  | 
  | 
  |
  |
  | 
  |
  | 
  | 
  | 
  | 
  | 
  |   
  | 
  | 
  | 
  | 
  | 
  |   http://schemas.xmlsoap.org/soap/encoding/"/>
  | 
  | 
  | 
  | 

The wsdl file that is returned from my service and from which I generated the 
axis based client is:


  | http://10.51.241.60:8080/jboss-net/services/IdsEJB"; 
xmlns="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:apachesoap="http://xml.apache.org/xml-soap"; 
xmlns:impl="http://10.51.241.60:8080/jboss-net/services/IdsEJB"; 
xmlns:intf="http://10.51.241.60:8080/jboss-net/services/IdsEJB"; 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:tns1="http://net.jboss.org/jmx"; 
xmlns:tns2="http://localhost:8080/jboss-net/services/IdsEJB"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>http://net.jboss.org/jmx"; 
xmlns="http://www.w3.org/2001/XMLSchema";>http://schemas.xmlsoap.org/soap/encoding/"/>http://localhost:8080/jboss-net/services/IdsEJB"; 
xmlns="http://www.w3.org/2001/XMLSchema";>http://schemas.xmlsoap.org/soap/encoding/"/>
  |   
  | 
  |   
  |   
  |   
  |   
  |   
  |   
  | 
  |   
  |   
  | 
  |   
  |   
  | 
  | 
  |   
  |   
  | 
  |   
  |   
  | http://schemas.xmlsoap.org/soap/http"/>
  | 
  |   
  |   
  | http://schemas.xmlsoap.org/soap/encoding/"; 
namespace="http://10.51.241.60:8080/jboss-net/services/IdsEJB"; use="encoded"/>
  |   
  |   
  | http://schemas.xmlsoap.org/soap/encoding/"; 
namespace="http://10.51.241.60:8080/jboss-net/services/IdsEJB"; use="encoded"/>
  |   
  | 
  | 
  |   
  |   
  | http://schemas.xmlsoap.org/soap/encoding/"; 
namespace="http://10.51.241.60:8080/jboss-net/services/IdsEJB"; use="encoded"/>
  |   
  |   
  | http://schemas.xmlsoap.org/soap/encoding/"; 
namespace="http://10.51.241.60:8080/jboss-net/services/IdsEJB"; use="encoded"/>
  |   
  | 
  |   
  |   
  | 
  |   http://10.51.241.60:8080/jboss-net/services/IdsEJB"/>
  | 
  |   
  | 

I know this is a bunch of code, but I'm at my wits end trying to figure out 
which little piece I've missed or is not quite right. I'd appreciate any tips 
or pointers as to what could be wrong.

Thanks!
Mike-

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3857914#3857914

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3857914


--

[JBoss-user] [Persistence & CMP/JBoss] - Primary key exception on deploy (startup)...

2005-03-09 Thread mburbidg
I'm writing a very simply CMP entity bean. I'm using xdoclet to generate most 
of the bean. When I deploy my bean I get the following exception:

org.jboss.deployment.DeploymentException: Bean StatBean has PK of type 
java.lang.String, so it should have a cmp-field named CASE_INSENSITIVE_ORDER

Any idea what might be wrong?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3869438#3869438

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3869438


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB/JBoss] - InstantiationException creating CMP entity bean from session

2005-03-11 Thread mburbidg
I've built a very simple CMP entity bean called StatisticsBean. It has two 
fields name and value. They are both of type java.lang.String and the name 
field is the primary key. I'm using xdoclet to generate the related files from 
the bean. The bean deploys without warnings or errors. From my session bean I 
execute the following:

StatisticLocalHome statHome = StatisticBeanUtil.getLocalHome();
  | StatisticLocal stat = statHome.create("foo-cnt", "0");

When I do, I get the following exception and stack trace:

anonymous wrote : 10:32:58,576 ERROR [LogInterceptor] 
TransactionRolledbackLocalException in method: public abstract 
sample.StatisticLocal sample.StatisticLocalHome.create(java.l
  | ang.String,java.lang.String) throws javax.ejb.CreateException, causedBy:
  | java.lang.InstantiationException
  | at 
sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
  | at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
  | at java.lang.Class.newInstance0(Class.java:308)
  | at java.lang.Class.newInstance(Class.java:261)
  | at 
org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createBeanClassInstance(JAWSPersistenceManager.java:165)
  | at 
org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:114)
  | at 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:250)
  | at 
org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:221)
  | at 
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:168)
  | at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:78)
  | ...

I cannot see what I'm doing wrong. I'm sure it's something very small.

Here's my bean:

package sample;
  | 
  | import javax.ejb.EntityBean;
  | import javax.ejb.EntityContext;
  | import javax.ejb.RemoveException;
  | import javax.ejb.CreateException;
  | import javax.ejb.FinderException;
  | import java.lang.String;
  | 
  | /**
  |  * 
  |  * @ejb.bean
  |  *  name="StatisticBean"
  |  *  jndi-name="ejb/StatisticBeanRemote"
  |  *  local-jndi-name="ejb/StatisticBeanLocal"
  |  *  cmp-version="2.x"
  |  *  primkey-field="name"
  |  *  schema="StatSchema"  
  |  *
  |  * @ejb.interface
  |  *  remote-class="sample.Statistic"
  |  *  local-class="sample.StatisticLocal"
  |  *
  |  * @ejb.home
  |  *  remote-class="sample.StatisticHome"
  |  *  local-class="sample.StatisticLocalHome"
  |  *
  |  * @ejb.pk
  |  *  class="java.lang.String"
  |  *  generate="false"
  |  *
  |  * @ejb.util generate="physical"
  |  *
  |  * @jboss.container-configuration name="Standard CMP EntityBean"
  |  *
  |  * @jboss.persistence
  |  *  datasource="default"
  |  *
  |  */
  | 
  | public abstract class StatisticBean implements EntityBean
  | {
  | /**
  |  * @ejb.create-method
  |  * @return Primary Key
  |  * @throws CreateException
  |  */
  | public String ejbCreate(String name, String value) throws CreateException
  | {
  | setName(name);
  | setValue(value);
  | 
  | return null;
  | }
  | 
  | public void ejbPostCreate(String name, String value) throws CreateException
  | {
  | }
  | 
  | /**
  |   * @ejb.select query="select o.name from Stats o where o.name = ?1"
  |   * @param s Name we are searching with
  |   * @return Set of Primary Keys with that name
  |   * @throws FinderException
  |   */
  | public abstract String ejbSelectByName(String name) throws FinderException;
  | 
  | /**
  |   * @ejb.interface-method
  |   * @ejb.persistence jdbc-type="VARCHAR" sql-type="VARCHAR"
  |   * @ejb.pk-field
  |   * @return the name of this bean
  |   */
  | public abstract String getName();
  | /**
  |  * @ejb.interface-method
  |  * @param s Set the name of this bean
  |  */
  | public abstract void setName(String s);
  | 
  | /**
  |  * @ejb.interface-method
  |  * @ejb.persistence jdbc-type="VARCHAR" sql-type="VARCHAR"
  |  * @return the value of this bean
  |  */
  | public abstract String getValue();
  | /**
  |  * @ejb.interface-method
  |  * @param s Set the value of this bean
  |  */
  | public abstract void setValue(String s);
  | 
  | }

Here's the bean implementation class, derived from this that is generated by 
xdoclet:

/*
  |  * Generated by XDoclet - Do not edit!
  |  */
  | package sample;
  | 
  | /**
  |  * CMP layer for StatisticBean.
  |  */
  | public abstract class StatisticBeanCMP
  |extends sample.StatisticBean
  |implements javax.ejb.EntityBean
  | {
  | 
  |public void ejbLoad() 
  |{
  |}
  | 
  |public void ejbStore() 
  |{
  |}
  | 
  |public void ejbActivate() 
  |{
  |}
  | 
  |public void ejbPassivate() 
  |