[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-java-user
Subject:    [User] Fwd: WSO2 + JPA - Problem we are facing
From:       Nirmal Fernando <nirmal () wso2 ! com>
Date:       2012-05-01 9:59:33
Message-ID: CAJ+w7F=YVycFo0QwzT-fHSMnLzwZ_Z7TCBFF1Y2RoJMmsZwiUw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Indu,

Please continue further questions related to your problem in this thread.

Thanks.

---------- Forwarded message ----------
From: Nirmal Fernando <nirmal@wso2.com>
Date: Tue, May 1, 2012 at 3:14 PM
Subject: Re: WSO2 + JPA - Problem we are facing
To: Indu Shekhar Mudigonda <induusha@yahoo.com>


Hi Indu,

Please send your questions to user@wso2.org, that way you can get the right
answers quickly and that's the way to go! :)

Anyway, I've searched through Internet and found few relevant links.

http://old.nabble.com/Issue-in-implementing-JPA-support-on-ESB-Smooks-Mediator-td33443274.html


http://wso2.org/mailarchive/architecture/2009-October/000669.html

And I think WSO2 human task component is an ideal example for you. Please
find the link to it below.

https://svn.wso2.org/repos/wso2/trunk/graphite/components/business-processes/humantask/org.wso2.carbon.humantask/


And I could see where persistenc.xml should go.
https://svn.wso2.org/repos/wso2/trunk/graphite/components/business-processes/humantask/org.wso2.carbon.humantask/src/main/resources/META-INF/





On Tue, May 1, 2012 at 2:06 PM, Indu Shekhar Mudigonda
<induusha@yahoo.com>wrote:

> Hi Nirmal !
> 
> We are working on a WSO2 Application Server based project 4.2.1.
> We need webservices communicating with a MySQL db.
> The technology we are trying to use is JPA, Hibernate.
> 
> We got webservices running, connecting to the db directly (using JDBC
> connections).
> It is JPA configuration that is giving us problems.
> 
> We figured that JPA's persistence.xml should be in
> src/main/resources/META-INF/ dir.
> The Carbon-Studio create CarbonApplicationProject creates only
> src/main/java
> 
> When we try to create src/main/resources/META-INF  and then try to create
> aar file, it does not include the resources/META-INF/persistence.xml
> Next We put persistence.xml in
> OurPackage/artifacts/services/axis2/G3DataTest/resources/META-INF
> Now the persistence.xml gets included in aar file. But we still get the
> error, when deploying the file on to WSAS.
> 
> We are getting an error:
> ERROR {org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver} -
> org/hibernate/MappingNotFoundException
> java.lang.NoClassDefFoundError: org/hibernate/MappingNotFoundException
> at
> org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:124)
>  
> A display of Classpath before accessing persistence.xml shows:
> 
> ....;D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-3.2.7.ga.jar;D:\Indu\w \
> so2as-4.1.2\repository\components\lib\hibernate-commons-annotations-4.0.1.Final.jar; \
> D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-core-4.1.2.Final.jar;D:\Ind \
> u\wso2as-4.1.2\repository\components\lib\hibernate-entitymanager-4.1.2.Final.jar;D:\ \
> Indu\wso2as-4.1.2\repository\components\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar;D:\Indu\wso2as-4.1.2\repository\components\lib\httpcore-4.0.jar;....
>  
> How do we place this persistence.xml in resources/META-INF/ dir ?
> Is there any documentation related to this?
> 



> Or any resource we can contact to get our issues resolved?
> 
> I will appreciate your any help in this regards. We are stuck with this
> issue over the last one week.
> 
> On a side note, is there any training offerred by WSO2 on its products. We
> can take some training if needed to get along with the project.
> 
> thank you for any help provided.
> 
> -Indu
> 



-- 

Thanks & regards,
Nirmal

Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/



-- 

Thanks & regards,
Nirmal

Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/


[Attachment #5 (text/html)]

Hi Indu,<br><br>Please continue further questions related to your problem in this \
thread.<br><br>Thanks.<br><br><div class="gmail_quote">---------- Forwarded message \
----------<br>From: <b class="gmail_sendername">Nirmal Fernando</b> <span \
                dir="ltr">&lt;<a \
                href="mailto:nirmal@wso2.com">nirmal@wso2.com</a>&gt;</span><br>
Date: Tue, May 1, 2012 at 3:14 PM<br>Subject: Re: WSO2 + JPA - Problem we are \
facing<br>To: Indu Shekhar Mudigonda &lt;<a \
href="mailto:induusha@yahoo.com">induusha@yahoo.com</a>&gt;<br><br><br>Hi \
Indu,<br><br>Please send your questions to <span><a href="mailto:user@wso2.org" \
target="_blank">user@wso2.org</a>, that way you can get the right answers quickly and \
that&#39;s the way to go! :)</span><br> <br>Anyway, I&#39;ve searched through \
Internet and found few relevant links.<br> <br><a \
href="http://old.nabble.com/Issue-in-implementing-JPA-support-on-ESB-Smooks-Mediator-td33443274.html" \
target="_blank">http://old.nabble.com/Issue-in-implementing-JPA-support-on-ESB-Smooks-Mediator-td33443274.html</a><br>
 <br><a href="http://wso2.org/mailarchive/architecture/2009-October/000669.html" \
target="_blank">http://wso2.org/mailarchive/architecture/2009-October/000669.html</a><br>
 <br>And I think WSO2 human task component is an ideal example for you. Please find \
the link to it below.<br><br><a \
href="https://svn.wso2.org/repos/wso2/trunk/graphite/components/business-processes/humantask/org.wso2.carbon.humantask/" \
target="_blank">https://svn.wso2.org/repos/wso2/trunk/graphite/components/business-processes/humantask/org.wso2.carbon.humantask/</a><br>


<br>And I could see where persistenc.xml should go. <a \
href="https://svn.wso2.org/repos/wso2/trunk/graphite/components/business-processes/humantask/org.wso2.carbon.humantask/src/main/resources/META-INF/" \
target="_blank">https://svn.wso2.org/repos/wso2/trunk/graphite/components/business-processes/humantask/org.wso2.carbon.humantask/src/main/resources/META-INF/</a><div \
class="HOEnZb"> <div class="h5"><br>
<br><br><br><div class="gmail_quote">On Tue, May 1, 2012 at 2:06 PM, Indu Shekhar \
Mudigonda <span dir="ltr">&lt;<a href="mailto:induusha@yahoo.com" \
target="_blank">induusha@yahoo.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" \
valign="top"><font style="outline-style:none;line-height:15px;outline-width:initial;outline-color:initial" \
face="arial" size="2">Hi Nirmal ! </font><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


We are working on a WSO2 Application Server based project 4.2.1.</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


We need webservices communicating with a MySQL db. </div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


The technology we are trying to use is JPA, Hibernate.</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


We got webservices running, connecting
 to the db directly (using JDBC connections).</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


It is JPA configuration that is giving us problems.</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


We figured that JPA&#39;s persistence.xml should be in src/main/resources/META-INF/ \
dir.</div><div style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width \
:initial;margin-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outli \
ne-style:none;outline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


The Carbon-Studio create CarbonApplicationProject creates only src/main/java  \
</div><div style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:ini \
tial;margin-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-s \
tyle:none;outline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


When we try to create src/main/resources/META-INF  and then try to create aar file, \
it does not include the resources/META-INF/persistence.xml</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


Next We put persistence.xml in </div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


  OurPackage/artifacts/services/axis2/G3DataTest/resources/META-INF</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


Now the persistence.xml gets included in aar file. But we still get the error, when \
deploying the file on to WSAS.</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<span style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial;font-size:10pt">We \
are getting an error:</span></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding- \
top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial">


ERROR
 {org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver} -  \
org/hibernate/MappingNotFoundException</div><div \
style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0 \
px;padding-right:0px;padding-bottom:0px;padding-left:0px;line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial">


java.lang.NoClassDefFoundError: org/hibernate/MappingNotFoundException</div><div \
style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0 \
px;padding-right:0px;padding-bottom:0px;padding-left:0px;line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial">


<span style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial;white-space:pre-wrap">	</span>at
  org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:124)</div></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


 </div><div style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:in \
itial;margin-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline- \
style:none;outline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


A display of Classpath before accessing persistence.xml shows:</div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<font style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial" \
face="arial" size="2">....;D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-3. \
2.7.ga.jar;D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-commons-annotation \
s-4.0.1.Final.jar;D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-core-4.1.2. \
Final.jar;D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-entitymanager-4.1.2 \
.Final.jar;D:\Indu\wso2as-4.1.2\repository\components\lib\hibernate-jpa-2.0-api-1.0.1. \
Final.jar;D:\Indu\wso2as-4.1.2\repository\components\lib\httpcore-4.0.jar;....</font></div>


<div style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;m \
argin-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:n \
one;outline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding- \
top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial;font-size:10pt">


How do we place this persistence.xml in resources/META-INF/ dir ?</div><div \
style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0 \
px;padding-right:0px;padding-bottom:0px;padding-left:0px;line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial;font-size:10pt">


Is there any documentation related to this? \
</div></div></td></tr></tbody></table></blockquote><div><br> </div><blockquote \
class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" \
valign="top"><div style="padding:0px;margin:0px;line-height:1.2em;outline-style:none;font-size:10pt;font-family:arial,helvetica,clean,sans-serif">


<div style="margin:0px;padding:0px;line-height:1.2em;outline-style:none;font-size:10pt">Or \
any resource we can contact to get our issues resolved?</div><div \
style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0 \
px;padding-right:0px;padding-bottom:0px;padding-left:0px;line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial;font-size:10pt">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div>I \
will appreciate your any help in this regards.  We are stuck with this issue over the \
last one week. </div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


On a side note, is there any training offerred by WSO2 on its products. We
 can take some training if needed to get along with the project.  </div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


<br style="line-height:1.2em;outline-style:none;outline-width:initial;outline-color:initial"></div><div \
style="padding-right:0px;padding-left:0px;padding-top:0px;outline-width:initial;margin \
-bottom:0px;padding-bottom:0px;margin-right:0px;line-height:1.2em;outline-style:none;o \
utline-color:initial;font-size:10pt;margin-left:0px;font-family:arial,helvetica,clean,sans-serif;margin-top:0px">


thank you for any help provided.</div><span><font color="#888888"><br><blockquote \
style="border-left:2px solid \
rgb(16,16,255);margin-left:5px;padding-left:5px"></blockquote><div>-Indu</div></font></span></td>
 </tr></tbody></table></blockquote></div><br><br clear="all"><br></div></div><span \
class="HOEnZb"><font color="#888888">-- <br><br>Thanks &amp; \
regards,<br>Nirmal<br><br>Software Engineer- Platform Technologies Team, WSO2 \
                Inc.<br>
Mobile: <a href="tel:%2B94715779733" value="+94715779733" \
target="_blank">+94715779733</a><br>Blog: <a href="http://nirmalfdo.blogspot.com/" \
target="_blank">http://nirmalfdo.blogspot.com/</a><br>

</font></span></div><br><br clear="all"><br>-- <br><br>Thanks &amp; \
regards,<br>Nirmal<br><br>Software Engineer- Platform Technologies Team, WSO2 \
Inc.<br>Mobile: +94715779733<br>Blog: <a href="http://nirmalfdo.blogspot.com/" \
target="_blank">http://nirmalfdo.blogspot.com/</a><br>



_______________________________________________
User mailing list
User@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic