elmarakby / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

RuntimeException: Member is not writable #216

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I try to create an entity, whose getters are annotated with @Basic, but not 
member variables. The exception below is thrown.

What is the expected output? What do you see instead?
JPAMember.create() creates incorrect JPAMember$GetterSetterMember, passing only 
the getter method to it and thus making it read only. Then the code tries to 
write. 

What version of the product are you using? On what operating system?
0.7.0

Please provide any additional information below.
Stacktrace from the exception
Daemon Thread [http-bio-8080-exec-5] (Suspended (exception RuntimeException))   
    owns: SocketWrapper<E>  (id=32746)  
    JPAMember$GetterSetterMember.set(T) line: 196   
    JPAProducer.setAttribute(Attribute<?,?>, OProperty<?>, Object) line: 489    
    JPAProducer.applyOProperties(EntityManager, ManagedType<?>, Collection<OProperty<?>>, Object) line: 445 
    JPAProducer.createNewJPAEntity(EntityManager, EntityType<?>, OEntity, boolean) line: 690    
    JPAProducer.applyOLinks(EntityManager, EntityType<?>, List<OLink>, Object) line: 560    
    JPAProducer.createNewJPAEntity(EntityManager, EntityType<?>, OEntity, boolean) line: 692    
    OEntityToJPAEntityCommand.execute(JPAContext) line: 21  
    Chain.execute(JPAContext) line: 29  
    JPAProducer.createEntity(String, OEntity) line: 306 
    EntitiesRequestResource.createEntity(HttpHeaders, UriInfo, ODataProducer, String, OEntity) line: 109    
    EntitiesRequestResource.createEntity(HttpHeaders, UriInfo, ContextResolver<ODataProducer>, String, String, String, InputStream) line: 98    
    NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
    NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available   
    DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available   
    Method.invoke(Object, Object...) line: not available    
    JavaMethodInvokerFactory$1.invoke(Method, Object, Object...) line: 60   
    AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(Object, HttpContext) line: 205  
    AbstractResourceMethodDispatchProvider$ResponseOutInvoker(ResourceJavaMethodDispatcher).dispatch(Object, HttpContext) line: 75  
    HttpMethodRule.accept(CharSequence, Object, UriRuleContext) line: 288   
    ResourceClassRule.accept(CharSequence, Object, UriRuleContext) line: 108    
    RightHandPathRule.accept(CharSequence, Object, UriRuleContext) line: 147    
    RootResourceClassesRule.accept(CharSequence, Object, UriRuleContext) line: 84   
    WebApplicationImpl._handleRequest(WebApplicationContext, ContainerRequest) line: 1469   
    WebApplicationImpl._handleRequest(WebApplicationContext, ContainerRequest, ContainerResponse) line: 1400    
    WebApplicationImpl.handleRequest(ContainerRequest, ContainerResponse) line: 1349    
    WebApplicationImpl.handleRequest(ContainerRequest, ContainerResponseWriter) line: 1339  
    ServletContainer$InternalWebComponent(WebComponent).service(URI, URI, HttpServletRequest, HttpServletResponse) line: 416    
    ServletContainer.service(URI, URI, HttpServletRequest, HttpServletResponse) line: 537   
    ServletContainer.service(HttpServletRequest, HttpServletResponse) line: 699 
    ServletContainer(HttpServlet).service(ServletRequest, ServletResponse) line: 848    
    GeneratedMethodAccessor66.invoke(Object, Object[]) line: not available  
    DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available   
    Method.invoke(Object, Object...) line: not available    
    SecurityUtil$1.run() line: 274  
    SecurityUtil$1.run() line: 271  
    AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]   
    Subject.doAsPrivileged(Subject, PrivilegedExceptionAction<T>, AccessControlContext) line: not available 
    SecurityUtil.execute(Method, Object, Object[], Principal) line: 306 
    SecurityUtil.doAsPrivilege(String, Servlet, Class<?>[], Object[], Principal) line: 166  
    ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 299  
    ApplicationFilterChain.access$000(ApplicationFilterChain, ServletRequest, ServletResponse) line: 57 
    ApplicationFilterChain$1.run() line: 193    
    ApplicationFilterChain$1.run() line: 189    
    AccessController.doPrivileged(PrivilegedExceptionAction<T>) line: not available [native method] 
    ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 188  
    StandardWrapperValve.invoke(Request, Response) line: 224    
    StandardContextValve.invoke(Request, Response) line: 169    
    Authenticator(AuthenticatorBase).invoke(Request, Response) line: 472    
    Authenticator.invoke(Request, Response) line: 165   
    StandardHostValve.invoke(Request, Response) line: 168   
    ErrorReportValve.invoke(Request, Response) line: 98 
    TenantValidationValve.invokeNextValve(Request, Response) line: 159  
    TenantValidationValve.invoke(Request, Response) line: 73    
    RequestTracingValve.invoke(Request, Response) line: 27  
    StandardEngineValve.invoke(Request, Response) line: 118 
    CoyoteAdapter.service(Request, Response) line: 407  
    Http11Processor(AbstractHttp11Processor<S>).process(SocketWrapper<S>) line: 987 
    Http11Protocol$Http11ConnectionHandler(AbstractProtocol$AbstractConnectionHandler<S,P>).process(SocketWrapper<S>, SocketStatus) line: 579   
    JIoEndpoint$SocketProcessor.run() line: 309 
    ThreadPoolExecutor$Worker.runTask(Runnable) line: not available 
    ThreadPoolExecutor$Worker.run() line: not available 
    TaskThread(Thread).run() line: not available    

Original issue reported on code.google.com by vanjo1...@gmail.com on 12 Sep 2012 at 2:57