Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Hibernate from Flex

 
Ravissant Saraswat
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,
Im kind of new to both hibernate and flex and am writing code that has flex ui and connects to the database via hibernate.
Now, what I did was first create a flex project wherein a java class(not .as) is called from the .mxml file and this code functions fine.
Next, I made a JPA project in which I wrote classes to connect to database using hibernate, that runs fine too.

Next, I added the JPA project to the flex project's buildpath and imported the main class(changed the main method to a regular method) into the flex project's java class , instantiated the main class and called its regular method . Now, this is where it breaks and I get the following exception on flex ui when i call the button event on which the java class is called:


I tried adding hibernate jars to the flex project too but thsi exception still come.Could someone please help me with this..

Thanks in advance,
Ravissant
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are missing Hibernate.jar from your application's classpath. It needs to be in the classpath of the server component.
 
Ravissant Saraswat
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Paul.Well like I said earlier, I already have the hibernate jars added to the build path of both the projects but
havent
been able to get it running
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There must be a mistake there - java.lang.NoClassDefFoundErrors are almost always caused by classpath mistakes. Its worth checking this carefully.
 
Ravissant Saraswat
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
Thanks for the last reply. I think i've failed to explain the full scenario to you so let me make an attempt. I have 2 projects in my workspace, one flex project and one jpa project. The two projects function perfectly individually/in isolation.
Now what I'm trying to do next is, call a java class in the hibernate project from the flex project. For this, I added the jpa project to the flex project's buildpath and j2ee reference but everytime the code goes to the part where the method from the javaclass in the JPA project is called by the javaclass in the flex project , I get an error popup in flex that says the following :


I hope, that gives a clearer picture of the problem I have, once again thanks for replying, I really appreciate it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic