File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Flex and the fly likes Calling Hibernate from Flex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Calling Hibernate from Flex" Watch "Calling Hibernate from Flex" New topic
Author

Calling Hibernate from Flex

Ravissant Saraswat
Greenhorn

Joined: Mar 15, 2010
Posts: 20
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

Joined: Apr 14, 2004
Posts: 10336

You are missing Hibernate.jar from your application's classpath. It needs to be in the classpath of the server component.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravissant Saraswat
Greenhorn

Joined: Mar 15, 2010
Posts: 20
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

Joined: Apr 14, 2004
Posts: 10336

There must be a mistake there - java.lang.NoClassDefFoundErrors are almost always caused by classpath mistakes. Its worth checking this carefully.
Ravissant Saraswat
Greenhorn

Joined: Mar 15, 2010
Posts: 20
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Hibernate from Flex
 
Similar Threads
Flex3 with Java - Questions
Beginning Java and Flex: Question
Flex to web service communication problem
PopUpManager error
Newbie Question: Java EE vs Tomcat+Hibernate+Struts