I am trying to marshall the VoyageResult object with the mapping file
defined below.
The getters and setters in the Class definition seems to be OK.
Thanks,
Sathya
(813) - 209 - 2238
java.lang.IllegalStateException: Field access error:
arrDateString(java.lang.String) access resulted in exception:
java.lang.reflect.InvocationTargetException
at
org.exolab.castor.mapping.loader.FieldHandlerImpl.getValue(FieldHandlerImpl.
java:383)
at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:190)
at
org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescripto
rImpl.java:885)
at org.exolab.castor.xml.Validator.validate(Validator.java:122)
at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:233)
at
org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescripto
rImpl.java:885)
at org.exolab.castor.xml.Validator.validate(Validator.java:122)
at org.exolab.castor.xml.Marshaller.validate(Marshaller.java:1890)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:763)
at
com.cpships.vss.vesselsearch.action.VesselSearchAction.process(VesselSearchA
ction.java:265)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:
280)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
com.cpships.ecomm.action.DispatchBaseAction.execute(DispatchBaseAction.java:
125)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1053)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:387)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6310)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3622)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
****************************************************************************
****************
Mapping File
<?xml version="1.0"?>
<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version
1.0//EN"
"http://castor.exolab.org/mapping.dtd">
<mapping>
<class name="com.cpships.vss.schedule.Schedule">
<map-to xml="schedule"/>
<field name="serviceName" type="java.lang.String">
<bind-xml name="servicename" node="element"/>
</field>
<field name="scheduleDate" type="java.lang.String">
<bind-xml name="scheduledate" node="element"/>
</field>
<field name="direction" type="java.lang.String">
<bind-xml name="direction" node="element"/>
</field>
<field name="voyages"
type="com.cpships.vss.domain.PublishedVoyage" collection="arraylist">
<bind-xml name="voyage" location="voyages"/>
</field>
<field name="arrivalPorts"
type="com.cpships.vss.domain.Port" collection="arraylist">
<bind-xml name="arrival" location="AllArrivals"/>
</field>
<field name="departurePorts"
type="com.cpships.vss.domain.Port" collection="arraylist">
<bind-xml name="departure"
location="AllDepartures"/>
</field>
</class>
<class name="com.cpships.vss.domain.PublishedVoyage">
<field name="code" type="java.lang.String">
<bind-xml name="voyagename" node="element"/>
</field>
<field name="vessel" type="com.cpships.vss.domain.Vessel">
<bind-xml name="vessel" node="element"/>
</field>
<field name="arrivalPorts"
type="com.cpships.vss.domain.Port" collection="arraylist">
<bind-xml name="arrival" location="arrivals"/>
</field>
<field name="departPorts" type="com.cpships.vss.domain.Port"
collection="arraylist">
<bind-xml name="departure" location="departures"/>
</field>
</class>
<class name="com.cpships.vss.domain.Vessel">
<field name="name" type="java.lang.String">
<bind-xml name="name" node="element"/>
</field>
<field name="description" type="java.lang.String">
<bind-xml name="description" node="element"/>
</field>
<field name="code" type="java.lang.String">
<bind-xml name="code" node="element"/>
</field>
<field name="flag" type="java.lang.String">
<bind-xml name="flag" node="element"/>
</field>
<field name="lloyds" type="java.lang.String">
<bind-xml name="lloyds" node="element"/>
</field>
<field name="infoLink" type="java.lang.String">
<bind-xml name="infolink" node="element"/>
</field>
</class>
<class name="com.cpships.vss.domain.PortStop">
<map-to xml="PortStop"/>
<field name="stopDateString" type="java.lang.String">
<bind-xml name="stopdate" node="element"/>
</field>
<field name="port" type="com.cpships.vss.domain.Port">
<bind-xml name="port" node="element"/>
</field>
</class>
<class name="com.cpships.vss.domain.Port">
<field name="sequence" type="java.lang.String">
<bind-xml name="sequence" node="attribute"/>
</field>
<field name="portCode" type="java.lang.String">
<bind-xml name="portcode" node="element"/>
</field>
<field name="portType" type="java.lang.String">
<bind-xml name="porttype" node="element"/>
</field>
<field name="portName" type="java.lang.String">
<bind-xml name="portname" node="element"/>
</field>
</class>
<class name="com.cpships.vss.vesselsearch.VesselSearch">
<map-to xml="vesselsearch"/>
<field name="voyageResults"
type="com.cpships.vss.vesselsearch.VoyageResult" collection="arraylist">
<bind-xml name="voyageresult"
location="VoyageResults"/>
</field>
</class>
<class name="com.cpships.vss.vesselsearch.VoyageResult">
<field name="vessel" type="com.cpships.vss.domain.Vessel">
<bind-xml name="vessel" node="element"/>
</field>
<field name="voyageName" type="java.lang.String">
<bind-xml name="voyagename" node="element"/>
</field>
<field name="direction" type="java.lang.String">
<bind-xml name="direction" node="element"/>
</field>
<field name="service" type="java.lang.String">
<bind-xml name="service" node="element"/>
</field>
<field name="portName" type="java.lang.String">
<bind-xml name="portname" node="element"/>
</field>
<field name="arrDateString" type="java.lang.String">
<bind-xml name="arrivaldate" node="element"/>
</field>
<field name="depDateString" type="java.lang.String">
<bind-xml name="departuredate" node="element"/>
</field>
</class>
</mapping>
****************************************************************************
*******************
/** (C) CP Ships Limited 20001
*
* All intellectual property rights in this software (whether in source or
object code format)
* are owned by CP Ships Limited, its subsidiaries or licensors. Any
copying, reproduction,
* use or redistribution is expressly prohibited without the prior written
consent of CP Ships Limited.
* This software (whether in source and object code format) is strictly
confidential to CP Ships Limited
* and may not be disclosed without the prior written consent of CP Ships
Limited. Any violation of
* these provisions shall entitle CP Ships Limited, its subsidiaries or
licensors (as the case may be)
* to commence legal action in respect of infringement of intellectual
property rights and / or breach
* of confidentiality. As such violation may cause irreparable harm in
respect of which it may be
* difficult to ascertain financial loss, in addition to any other rights,
injunctive relief may be
* sought as part of that action.
*/
package com.cpships.vss.vesselsearch;
import com.cpships.vss.domain.Vessel;
import java.util.Date;
import java.text.*;
//vssweb imports
import com.cpships.vss.util.AppEnums;
public class VoyageResult
{
private Vessel vessel = null;
private String voyageName = null;
private String direction = null;
private String service = null;
private String portName = null;
private Date departureDate = null;
private Date arrivalDate = null;
private String depDateString = "";
private String arrDateString = "";
public void setVessel( Vessel vessel )
{
this.vessel = vessel;
}
public Vessel getVessel()
{
return this.vessel;
}
public void setVoyageName( String voyageName )
{
this.voyageName = voyageName;
}
public String getVoyageName()
{
return this.voyageName;
}
public void setDirection( String direction )
{
this.direction = direction;
}
public String getDirection()
{
return this.direction;
}
public void setService( String service )
{
this.service = service;
}
public String getService()
{
return this.service;
}
public void setPortName( String portName )
{
this.portName = portName;
}
public String getPortName()
{
return this.portName;
}
public void setDepartureDate( Date departureDate )
{
this.departureDate = departureDate;
}
public Date getDepartureDate()
{
return this.departureDate;
}
public void setArrivalDate( Date arrivalDate )
{
this.arrivalDate = arrivalDate;
}
public Date getArrivalDate()
{
return this.arrivalDate;
}
public void setDepDateString(String s)
{
this.depDateString = s;
}
public String getDepDateString()
{
SimpleDateFormat sdf = new SimpleDateFormat(
AppEnums.DATEFMT_DASH_DDMMM );
String ret = sdf.format( this.departureDate );
System.out.println("ret det is "+ ret);
return ret;
}
public void setArrDateString(String s)
{
this.arrDateString = s;
}
public String getArrDateString()
{
SimpleDateFormat sdf = new SimpleDateFormat(
AppEnums.DATEFMT_DASH_DDMMM );
String ret = sdf.format( this.arrivalDate );
System.out.println("ret arr is "+ ret);
return ret;
}
}
****************************************************************************
******************************************
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev