Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316263

Summary: NamedQueries on entity produce java.lang.ArrayStoreException exception when entity is used as webservice parameter (jax-ws).
Product: z_Archived Reporter: Mykola Golubyev <golubev.nikolay>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mykola Golubyev CLA 2010-06-09 06:36:57 EDT
Build Identifier: 

I have an JPA entity "A" with NamedQueries annotation

@Entity
@Table(name = "A")
@NamedQueries
({
   @NamedQuery
   (
      name = "...",
      query = "..."
   ),
   @NamedQuery
   (
      name = "...",
      query = "..."
   )
})
public class A implements Serializable { ... }

and I have a web service

@Stateless
@WebService
public class AService
{
   public void addA(A a) { ... }
}


I have found that eclipselink-2.0.0.jar has 
\javax\persistence\NamedQuery.class 
but not
\javax\persistence\NamedQueries.class 

My maven configuration for ejb module is

      <dependency>
         <groupId>org.eclipse.persistence</groupId>
         <artifactId>eclipselink</artifactId>
         <version>2.1.0-RC4</version>
         <scope>provided</scope>
      </dependency>

      <dependency>
         <groupId>org.eclipse.persistence</groupId>
         <artifactId>javax.persistence</artifactId>
         <version>2.0.0</version>
         <scope>compile</scope>
      </dependency>

And I put eclipselink-2.0.0.jar into ear's lib.

when I try to deploy this I get

java.lang.ArrayStoreException: $Proxy243
        at sun.reflect.annotation.AnnotationParser.parseAnnotationArray(AnnotationParser.java:694)
        at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:466)
        at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.Class.initAnnotationsIfNecessary(Class.java:3031)
        at java.lang.Class.getAnnotation(Class.java:2989)
        at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:102)
        at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:53)
        at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.getApplicableAdapter(PropertyInfoImpl.java:241)
        at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.<init>(PropertyInfoImpl.java:122)
        at com.sun.xml.bind.v2.model.impl.ERPropertyInfoImpl.<init>(ERPropertyInfoImpl.java:53)

Reproducible: Always

Steps to Reproduce:
1. Create entity with @NamedQueries annotation
2. Create jax-ws webservice that will use entity class as parameter
3. Pack webservice as ejb module
4. Create ear application and put eclipselink-2.0.0.jar to libs
5. Deploy application to Jboss
Comment 1 Tom Ware CLA 2010-06-14 14:50:14 EDT
I suspect that this is a classpath issue with your JBoss server.  

I am not sure where the JAXB RI is located in JBoss by default, but in order to use EclipseLink annotations, it will have to be somewhere where it can see JPA.

I am not sure what EclipseLink can do to solve this for you.

I suggest trying the EclipseLink users mailing list or some similar support list for JBoss.

It is probably best to try to get support from the forums/mailing lists before filing bugs.

I am closing this as INVALID.  Please feel free to open a new bug, if your support inquiries help you to find an issue EclipseLink can help resolve for you.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:24:07 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink