[EJB 3.0] - javax.ejb.EJBTransactionRolledbackException due to @In @Out
by kaviarasu
Hi im using a primary and secondry table.
the user wants to write a review which is inserted into the secondry table and he has the option to edid his review.
when i use @Out annotation to the secondry table the user cant able to write into the database it giving the error
Caused by: javax.ejb.EJBTransactionRolledbackException
if i remove the @out annotation write review is working but editing the review is not working
In my bean i declared the coding as
TblReviews is primary table
TblUserReviews is secondry table
@RequestParameter
| BigDecimal revid;
| @In(required=false)
| TblReviews tr=new TblReviews();
| @In(required=false)
| @Out(required=false)
| TblUserReviews tblu;
| @Out(required=false)
| List<TblUserReviews> editreview;
public String register() {
| tr.setProductId(pro);
| tr.setUserId(identity.getUsername());
| Set<TblUserReviews> tblUserReviewsCollection= new TreeSet<TblUserReviews>();
| tblu.setReviewEntryId(tr);
| tblUserReviewsCollection.add(tblu);
| tr.setTblUserReviewsCollection(tblUserReviewsCollection);
| em.persist(tr);
| return "/prodis.xhtml";
| }
public String edit() {
| em.merge(tblu);
| return "/prodis.xhtml";
| }
public void editReview(){
| editreview= (List<TblUserReviews>) em.createQuery("select p from TblUserReviews p where userReviewId="+revid+"").getResultList();
| tblu = (TblUserReviews) editreview.get(0);
|
| }
write review page
Code:
| <h:inputTextarea value="#{tblu.reviewSummary}" style="width : 445px; height : 109px;"/>
| <h:commandButton value="Submit Review" action="#{search.register}" type="submit"/>
edit review page
<h:inputTextarea value="#{tblu.reviewSummary}" style="width : 445px; height : 109px;"/>
| <h:commandButton value="Submit Review" action="#{search.edit}" type="submit"/>
i need this urgent
thanking u
regards
kaviarasu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082480#4082480
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082480
18 years, 7 months
[JCA/JBoss] - domain authentication for jboss datasource
by kalapraveen
Hi,
PLZ READ MY PROBLEM BEFORE YOU DUMP THIS TOPIC!! THIS IS THE FIFTH TIME I AM POSTING THIS.
I am juz wondering whether there is a module that I can add in the loging-config.xml that supplies jboss the credentials of current user.
I have tried specifying com.sun.security.auth.module.NTLoginModule in the following way:
<application-policy name="EncryptDBPassword">
<login-module code="com.sun.security.auth.module.NTLoginModule" flag="required">
<module-option name="debug">true</module-option>
<module-optionname="managedConnectionFactoryName">jboss.jca:name=MDMDS,service=LocalTxCM</module-option>
</login-module>
</application-policy>
This is not working because this does not come under the family of Jboss login modules that implement the abstract class org.jboss.resource.security.AbstractPasswordCredentialLoginModule.
i will be really thankful to someone who can give a solution to this.
Thanks,
Kala.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082476#4082476
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082476
18 years, 7 months
[EJB/JBoss] - @In @Out annotation problem
by kaviarasu
Hi im using a primary and secondry table.
the user wants to write a review which is inserted into the secondry table and he has the option to edid his review.
when i use @Out annotation to the secondry table the user cant able to write into the database it giving the error
Caused by: javax.ejb.EJBTransactionRolledbackException
if i remove the @out annotation write review is working but editing the review is not working
In my bean i declared the coding as
TblReviews is primary table
TblUserReviews is secondry table
| @RequestParameter
| BigDecimal revid;
| @In(required=false)
| TblReviews tr=new TblReviews();
| @In(required=false)
| @Out(required=false)
| TblUserReviews tblu;
| @Out(required=false)
| List<TblUserReviews> editreview;
|
public String register() {
| tr.setProductId(pro);
| tr.setUserId(identity.getUsername());
| Set<TblUserReviews> tblUserReviewsCollection= new TreeSet<TblUserReviews>();
| tblu.setReviewEntryId(tr);
| tblUserReviewsCollection.add(tblu);
| tr.setTblUserReviewsCollection(tblUserReviewsCollection);
| em.persist(tr);
| return "/prodis.xhtml";
| }
| public String edit() {
| em.merge(tblu);
| return "/prodis.xhtml";
| }
public void editReview(){
| editreview= (List<TblUserReviews>) em.createQuery("select p from TblUserReviews p where userReviewId="+revid+"").getResultList();
| tblu = (TblUserReviews) editreview.get(0);
|
| }
write review page
<h:inputTextarea value="#{tblu.reviewSummary}" style="width : 445px; height : 109px;"/>
| <h:commandButton value="Submit Review" action="#{search.register}" type="submit"/>
edit review page
<h:inputTextarea value="#{tblu.reviewSummary}" style="width : 445px; height : 109px;"/>
| <h:commandButton value="Submit Review" action="#{search.edit}" type="submit"/>
i need this urgent
thanking u
regards
kaviarasu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082472#4082472
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082472
18 years, 7 months
[Javassist user questions] - ClassFormatError on Websphere 6.1 on iSeries
by soza
Hi
We have Seam 1.2.1GA POJO app that works fine on Websphere 6.1 on Windows. However the same EAR file fails on Websphere 6.1 on IBM's iSeries server. javassist throws a ClassFormatError when loading the the first Seam component for the application. Here's the exception...
Caused by: java.lang.RuntimeException: by java.lang.ClassFormatError: [PACKAGE name withheld]ServiceImpl_$$_javassist_0 0000 6305
at java.lang.Throwable.(Throwable.java:218)
at java.lang.RuntimeException.(RuntimeException.java:61)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:365)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:323)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:274)
at org.jboss.seam.Component.createProxyFactory(Component.java:1979)
at org.jboss.seam.Component.getProxyFactory(Component.java:1154)
at org.jboss.seam.Component.wrap(Component.java:1145)
at org.jboss.seam.Component.instantiateJavaBean(Component.java:1134)
at org.jboss.seam.Component.instantiate(Component.java:1088)
at org.jboss.seam.Component.newInstance(Component.java:1736)
... 73 more
Caused by: javassist.CannotCompileException: by java.lang.ClassFormatError: [PACKAGE name withheld]ServiceImpl_$$_javassist_0 0000 6305
at java.lang.Throwable.(Throwable.java:196)
at java.lang.Exception.(Exception.java:41)
at javassist.CannotCompileException.(CannotCompileException.java:73)
at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:181)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:353)
... 81 more
Caused by: java.lang.ClassFormatError: [PACKAGE name withheld]ServiceImpl_$$_javassist_0 0000 6305
at java.lang.Throwable.(Throwable.java:196)
at java.lang.Error.(Error.java:49)
at java.lang.ClassFormatError.(ClassFormatError.java:35)
at java.lang.ClassLoader.defineClass(ClassLoader.java:651
Here's the interesting part...typically ClassFormatError would also provide the message indicating the cause for failure, but in this case it just displays a sequence of numbers...
Caused by: javassist.CannotCompileException: by java.lang.ClassFormatError: [PACKAGE name withheld]ServiceImpl_$$_javassist_0 0000 6305
Both on windows and the iSeries box we are using IBM's Java 1.5 JRE. Also i'm using javassist 3.4. Anybody can shed any light on what the numbers are?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082470#4082470
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082470
18 years, 7 months
[Beginners Corner] - Problem about using SocketAppender !!
by changemylife
Hi all!
I use anonymous wrote : jboss-4.0.5.GA, EJB3.0 XP_SP2
I use anonymous wrote : Log4jSocketServer and SocketAppender to log some request from clients to server. (Example both of server and client is the same machine, and host name: pc6 and has IP is: 192.168.1.228 ).
Ok, inside server\default\conf\jboss-service.xml, I added:
| ...
| <mbean code="org.jboss.logging.Log4jSocketServer"
| name="jboss.system:type=Log4jService,service=SocketServer">
| <attribute name="Port">8888</attribute>
| <attribute name="BindAddress">${jboss.bind.address}</attribute>
| </mbean>
Then, inside server\default\conf\log4j.xml, I added:
| ...
| <appender name="MY_SOCKET" class="org.apache.log4j.net.SocketAppender">
| <param name="Port" value="8888"/>
| <param name="RemoteHost" value="pc6"/> --> or "192.168.1.228"
| <param name="ReconnectionDelay" value="30000"/>
| <param name="Threshold" value="INFO"/>
| </appender>
But when I restart JBoss Server, I received some errors:
| log4j:ERROR Could not connect to remote log4j server at [pc6]. We will try again later.
| java.net.ConnectException: Connection refused: connect
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
| ...
Please guid to me how way fixed my errors. (Sorry, my English is not good.)
Thanks very much.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082469#4082469
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082469
18 years, 7 months