• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

solution for EJB3.0 and Open JPA in WAS7

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

i am working on EJB3.0 and OpenJPA1.2.3 version on WAS7.

here i have a problem, the one to many assosiations are not picking data from database.

Earlier we used EJB3.0 and Toplink on Glassfish. we didn't find any problem at the time with one to many assosiations.

when we move from toplink to OpenJPA and glassfish to WAS7 these mappings are not supporting throwing
[12/9/10 9:00:06:068 CST] 00000018 BusinessExcep E CNTR0020E:
EJB threw an unexpected (non-declared) exception during invocation of method "stateExists" on bean "BeanId(lmt-33171#LLMT-ejb.jar#LocStateFacade, null)".

Exception data: <openjpa-1.2.3-SNAPSHOT-r422266:965640 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:

An error occurred while parsing the query filter 'SELECT o FROM LocState o where o.deleted = false and o.country.id = 88 AND UPPER(o.name) = "KARAMCHEDU"'.

Error message: org.apache.openjpa.kernel.jpql.TokenMgrError: Lexical error at line 1, column 93. Encountered: "\"" (34), after : ""

[12/9/10 0:51:13:407 CST] 00000016 RegisteredSyn E WTRN0074E: Exception caught from after_completion synchronization operation: <openjpa-1.2.3-SNAPSHOT-r422266:965640 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null

i tried mapping like this

@OneToMany(cascade ={CascadeType.ALL})
@JoinTable
(
name="ROOM_ROOMCONFIGURATION",
joinColumns={ @JoinColumn(name="ROOM_ID", referencedColumnName="ROOM_ID") },
inverseJoinColumns={ @JoinColumn(name="ROOMCONFIGURATIONS_ID", referencedColumnName="ROOMCONFIGURATIONS_ID") }
)


@OneToMany(cascade ={CascadeType.ALL})
@AssociationTable(
table=@Table(name=” ROOM_ROOMCONFIGURATION”),
joinColumns=
@JoinColumn(name=" ROOM_ID ", referencedColumnName=" ROOM_ID "),
inverseJoinColumns=
@JoinColumn(name=" ROOMCONFIGURATIONS_ID ", referencedColumnName=" ROOMCONFIGURATIONS_ID ")
)

please give me is there any differece in toplink and openJPA mappings ?

having any dependecies on servers?

can you suggest me to do changes in my application.

Thank in advance,
Rajesh Yarlagadda
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


An error occurred while parsing the query filter 'SELECT o FROM LocState o where o.deleted = false and o.country.id = 88 AND UPPER(o.name) = "KARAMCHEDU"'.
Error message: org.apache.openjpa.kernel.jpql.TokenMgrError: Lexical error at line 1, column 93. Encountered: "\"" (34), after : ""

These two lines seem to suggest there's something wrong with the JPQL.
Shouldn't you be using single quotes instead of double quotes?
SELECT o FROM LocState o where o.deleted = false and o.country.id = 88 AND UPPER(o.name) = 'KARAMCHEDU'
 
rajesh babu Y
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,

i tried with single quotes, but it was throwing me same exception.

is there any differences in mappings between toplink on Glassfish and OpenJPA on WAS7?

can you suggest what are the changes i do when i am moving from toplink in glassfish to OpenJPA in WAS7?

is OpenJPA is default for WAS7 or need any configurations in WAS7?

Thanks in Advance,
Rajesh Yarlagadda


 
Oliver Chua
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It may be that the server is caching. Try restarting your server and redeploying.
It shouldn't give you that same error if you've already fixed the JPQL.

Sorry, I haven't used OpenJPA or WAS7 to be able to help you with your question.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic