users@glassfish.java.net

RE: Re: Web Service Deployment error

From: Drinkwater, GJ \(Glen\) <"Drinkwater,>
Date: Wed, 21 Mar 2007 07:54:48 -0000

Hi
 
Thanks for that. I was wondering if anyone knew what the problem was
(glassfish or java 6) as it seems to only fail when glassfish runs on
java 6.
 
Is there a bug report on this?
 
Thanks Glen

________________________________

From: Kenneth Clark [mailto:kenneth_at_rabiddog.co.za]
Sent: 20 March 2007 08:31
To: users_at_glassfish.dev.java.net
Subject: Re: Web Service Deployment error


I had the same issue, removing the <Investigation> from the return type
would resolve this.


public ArrayList webMethodTest() {
    return new ArrayList<Investigation>(); }

something like that. Not best way to do it though I am sure


Kenneth Clark
Developer / Analyst

Rabid Dog Laboratories (tm)
Putting the art back into development

tel: +27 11 475 7409
mobile: +27 82 500 5090
e-mail: kenneth_at_rabiddog.co.za
website: http://www.rabiddog.co.za/


Drinkwater, GJ (Glen) wrote:

        Hi
        
        I have found that this error only occurs with Java 6, the code
deploys
        and works fine with Java 5.
        
        Glen
        
        -----Original Message-----
        From: Drinkwater, GJ (Glen) [mailto:g.j.drinkwater_at_dl.ac.uk]
        Sent: 12 March 2007 10:33
        To: users_at_glassfish.dev.java.net
        Subject: Web Service Deployment error
        
        Hi
        
        I get this error when i try and deploy a web service ejb
endpoint that
        is returning a collection of entities.
        
        I am using glassfish UR1. It seems be saying that the gettter
and
        setter methods are not the same type in the entity class, but
they are.
        These are just simple entities that were auto generated from a
table.
        
        Any ideas ???
        
        Web Method:
        
          @WebMethod
            public ArrayList<Investigation> webMethodTest() {
            return new ArrayList<Investigation>(); }
        
        The error is this:
        
        error: The type of the getter is
        java.util.Collection<Investigation> but that of the setter is
        java.util.Collection. They have to be the same.
                this problem is related to the following location:
                        at
        
uk.icat3.sessionbeans.search.Instrument.getInvestigationCollection
        (Unknown
        Source)
                        at uk.icat3.sessionbeans.search.Instrument
(Unknown
        Source)
                        at
        uk.icat3.sessionbeans.search.Investigation.getInstrument
        (Unknown Source)
                        at uk.icat3.sessionbeans.search.Investigation
(Unknown
        Source)
                        at
        
uk.icat3.sessionbeans.search.jaxws.WebMethodTestResponse._return(WebMeth
        odTestResponse.java:17)
                        at
        
uk.icat3.sessionbeans.search.jaxws.WebMethodTestResponse(WebMethodTestRe
        sponse.java:14)
                this problem is related to the following location:
                        at
        
uk.icat3.sessionbeans.search.Instrument.setInvestigationCollection
        (Unknown
        Source)
                        at uk.icat3.sessionbeans.search.Instrument
(Unknown
        Source)
                        at
        uk.icat3.sessionbeans.search.Investigation.getInstrument
        (Unknown Source)
                        at uk.icat3.sessionbeans.search.Investigation
(Unknown
        Source)
                        at
        
uk.icat3.sessionbeans.search.jaxws.WebMethodTestResponse._return(WebMeth
        odTestResponse.java:17)
                        at
        
uk.icat3.sessionbeans.search.jaxws.WebMethodTestResponse(WebMethodTestRe
        sponse.java:14)
        
        Investigation class:
        
        @Entity
        @Table(name = "INVESTIGATION")
        public class Investigation implements Serializable {
            
            @Id
            @Column(name = "ID", nullable = false)
            private Long id;
            
             @Column(name = "TITLE", nullable = false)
            private String title;
                   
            @JoinColumn(name = "INSTRUMENT", referencedColumnName =
"NAME")
            @ManyToOne
            private Instrument instrument;
               
            
            /** Creates a new instance of Investigation */
            public Investigation() {
            }
          
            public Investigation(Long id) {
                this.id = id;
            }
                
            public Long getId() {
                return this.id;
            }
              
            public void setId(Long id) {
                this.id = id;
            }
           
            public String getTitle() {
                return this.title;
            }
               public void setTitle(String title) {
                this.title = title;
            }
              
            public Instrument getInstrument() {
                return this.instrument;
            }
              
            public void setInstrument(Instrument instrument) {
                this.instrument = instrument;
            }
        }
        
        Instrument class.
        
        @Entity
        @Table(name = "INSTRUMENT")
        public class Instrument implements Serializable {
            
            @Id
            @Column(name = "NAME", nullable = false)
            private String name;
                  
            @OneToMany(mappedBy = "instrument")
            private Collection<Investigation> investigationCollection;
                
            /** Creates a new instance of Instrument */
            public Instrument() {
            }
                
            public Instrument(String name) {
                this.name = name;
            }
                
            public String getName() {
                return this.name;
            }
              
            public void setName(String name) {
                this.name = name;
            }
           
            public Collection<Investigation>
getInvestigationCollection() {
                return this.investigationCollection;
            }
            
               public void
setInvestigationCollection(Collection<Investigation>
        investigationCollection) {
                this.investigationCollection = investigationCollection;
            }
        }
        
        
        Thanks Glen
        
        
---------------------------------------------------------------------
        To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
        For additional commands, e-mail:
users-help_at_glassfish.dev.java.net
        
        
        
---------------------------------------------------------------------
        To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
        For additional commands, e-mail:
users-help_at_glassfish.dev.java.net