persistence@glassfish.java.net

Re: Unintelligible error "String index out of range: 3"

From: Christof <java.net_at_techneut.be>
Date: Tue, 20 Jun 2006 12:38:04 +0200

Hi,

I have reported this problem already at the end of march. For me it was
and still is a show stopper ('still' because the problem is in the
released version of appserver 9).
It is fixed in version v2 of glassfish (just download a snapshot).

I'm a proponent for a patch for v1. The bug 557's last additional
comment mentions a fix for UR1. Was that a request or a fact ?

Christof

Dmitry Mozheyko wrote:
> -----Original Message-----
> From: "Guy Pelletier" <guy.pelletier_at_oracle.com>
> To: <persistence_at_glassfish.dev.java.net>
> Date: Mon, 19 Jun 2006 07:34:18 -0400
> Subject: Re: Unintelligible error "String index out of range: 3"
>
>
>> Dmitry,
>>
>> I'm not sure which build you are using, but you may want to have a look at
>> bug:
>> https://glassfish.dev.java.net/issues/show_bug.cgi?id=557
>>
>> You may need to update your version of glassfish.
>>
>
> In "V1 UR1 Build 01 Promotion" this problem not fixed.
>
>
>> Cheers,
>> Guy
>>
>> ----- Original Message -----
>> From: "Dmitry Mozheyko" <mozheyko_d_at_mail.ru>
>> To: <persistence_at_glassfish.dev.java.net>
>> Sent: Monday, June 19, 2006 3:54 AM
>> Subject: Unintelligible error "String index out of range: 3"
>>
>>
>>
>>> Hello all.
>>>
>>> I need unidirectional @ManyToMany relationship between two classes
>>> inheritable from one common parent:
>>>
>>> #######################
>>> # Person.java
>>> #######################
>>> package ejb;
>>>
>>> import java.io.Serializable;
>>> import java.util.Date;
>>> import javax.persistence.Entity;
>>> import javax.persistence.GeneratedValue;
>>> import javax.persistence.GenerationType;
>>> import javax.persistence.Id;
>>> import javax.persistence.Inheritance;
>>> import javax.persistence.InheritanceType;
>>> import javax.persistence.Temporal;
>>> import javax.persistence.TemporalType;
>>>
>>> @Entity
>>> @Inheritance(strategy=InheritanceType.JOINED)
>>> public class Person implements Serializable {
>>>
>>> @Id
>>> @GeneratedValue(strategy = GenerationType.AUTO)
>>> private Long id;
>>>
>>> private String firstName;
>>>
>>> private String lastName;
>>>
>>> @Temporal(TemporalType.DATE)
>>> private Date birthDay;
>>>
>>>
>>> public Person() {
>>> }
>>>
>>> public Long getId() {
>>> return id;
>>> }
>>>
>>> public void setId(Long id) {
>>> this.id = id;
>>> }
>>>
>>> public String getFirstName() {
>>> return firstName;
>>> }
>>>
>>> public void setFirstName(String firstName) {
>>> this.firstName = firstName;
>>> }
>>>
>>> public String getLastName() {
>>> return lastName;
>>> }
>>>
>>> public void setLastName(String lastName) {
>>> this.lastName = lastName;
>>> }
>>>
>>> public Date getBirthDay() {
>>> return birthDay;
>>> }
>>>
>>> public void setBirthDay(Date birthDay) {
>>> this.birthDay = birthDay;
>>> }
>>>
>>> }
>>> #######################
>>> # Customer.java
>>> #######################
>>> package ejb;
>>>
>>> import javax.persistence.Entity;
>>>
>>> @Entity
>>> public class Customer extends Person {
>>>
>>> private String address;
>>>
>>> public String getAddress() {
>>> return address;
>>> }
>>>
>>> public void setAddress(String address) {
>>> this.address = address;
>>> }
>>>
>>> }
>>>
>>> #######################
>>> # Employee.java
>>> #######################
>>> package ejb;
>>>
>>> import java.util.Collection;
>>> import javax.persistence.Entity;
>>> import javax.persistence.ManyToMany;
>>>
>>> @Entity
>>> public class Employee extends Person {
>>>
>>> private String room;
>>>
>>> @ManyToMany
>>> private Collection<Customer> customers;
>>>
>>> public String getRoom() {
>>> return room;
>>> }
>>>
>>> public void setRoom(String room) {
>>> this.room = room;
>>> }
>>>
>>> public Collection<Customer> getCustomers() {
>>> return customers;
>>> }
>>>
>>> public void setCustomers(Collection<Customer> customers) {
>>> this.customers = customers;
>>> }
>>>
>>> }
>>>
>>> When i deploy this application i see this error:
>>> String index out of range: 3
>>> at java.lang.String.substring(String.java:1765)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataHelper.getAttributeNameFromMethodName(MetadataHelper.java:99)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescriptor.getAccessorFor(MetadataDescriptor.java:317)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processMapKey(MetadataProcessor.java:1295)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor.processMapKey(EJBAnnotationsProcessor.java:1327)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processManyToMany(MetadataProcessor.java:1192)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor.processManyToMany(EJBAnnotationsProcessor.java:1303)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processRelationshipAccessor(MetadataProcessor.java:1641)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor.processRelatedEntity(EJBAnnotationsProcessor.java:1786)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.annotations.EJBAnnotationsProcessor.processORAnnotations(EJBAnnotationsProcessor.java:1543)
>>> at
>>> oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:405)
>>> at
>>> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:156)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.loadPersistenceUnitBundle(PersistenceProcessor.java:457)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.generateDDLFiles(PersistenceProcessor.java:286)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processAppBundle(PersistenceProcessor.java:176)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:118)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:193)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:152)
>>> at
>>> com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109)
>>> at
>>> com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66)
>>> at
>>> com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:429)
>>> at
>>> com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:225)
>>> at
>>> com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
>>> at
>>> com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
>>> at
>>> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
>>> at
>>> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
>>> at
>>> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
>>> at
>>> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
>>> at
>>> com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
>>> at
>>> com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
>>>
>>> Why?
>>>
>>>