[Persistence, JBoss/CMP, Hibernate, Database] - Re: Hibernate and JBOSS JTA failed transactions
by smithbstl
I am still dealing with this issue, does anyone have any ideas?
its just weird because some transactions work, some fail. I would say about 25% work
here are some shorter more recent server logs that illustrate the problem
Unsuccessful Transaction
2006-08-10 11:55:54,031 INFO [STDOUT] Update Called
2006-08-10 11:55:54,031 INFO [STDOUT] ***Account Save***
2006-08-10 11:55:54,031 INFO [STDOUT] AcctID: 325
2006-08-10 11:55:54,031 INFO [STDOUT] AcctNum: 5106
2006-08-10 11:55:54,031 INFO [STDOUT] AcctName: Test3
2006-08-10 11:55:54,031 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/SessionFactory
2006-08-10 11:55:54,031 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=402882a50cf90095010cf900970d0000
2006-08-10 11:55:54,031 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2006-08-10 11:55:54,031 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4731817795710976
2006-08-10 11:55:54,031 DEBUG [org.hibernate.transaction.JTATransaction] Looking for UserTransaction under: UserTransaction
2006-08-10 11:55:54,031 DEBUG [org.hibernate.transaction.JTATransaction] Obtained UserTransaction
2006-08-10 11:55:54,031 DEBUG [org.hibernate.transaction.JTATransaction] begin
2006-08-10 11:55:54,031 DEBUG [org.hibernate.transaction.JTATransaction] commit
Successful Transaction
2006-08-10 11:56:14,578 INFO [STDOUT] Update Called
2006-08-10 11:56:14,578 INFO [STDOUT] ***Account Save***
2006-08-10 11:56:14,578 INFO [STDOUT] AcctID: 167
2006-08-10 11:56:14,578 INFO [STDOUT] AcctNum: 5104
2006-08-10 11:56:14,578 INFO [STDOUT] AcctName: Salaries - Adjustments
2006-08-10 11:56:14,578 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/SessionFactory
2006-08-10 11:56:14,578 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=402882a50cf90095010cf900970d0000
2006-08-10 11:56:14,578 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
2006-08-10 11:56:14,578 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4731817879871488
2006-08-10 11:56:14,578 DEBUG [org.hibernate.transaction.JTATransaction] Looking for UserTransaction under: UserTransaction
2006-08-10 11:56:14,578 DEBUG [org.hibernate.transaction.JTATransaction] Obtained UserTransaction
2006-08-10 11:56:14,578 DEBUG [org.hibernate.transaction.JTATransaction] begin
2006-08-10 11:56:14,578 DEBUG [org.hibernate.transaction.JTATransaction] Began a new JTA transaction
2006-08-10 11:56:14,578 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2006-08-10 11:56:14,578 DEBUG [org.hibernate.transaction.JTATransaction] commit
2006-08-10 11:56:14,578 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
2006-08-10 11:56:14,578 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
2006-08-10 11:56:14,578 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
2006-08-10 11:56:14,578 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2006-08-10 11:56:14,578 DEBUG [org.hibernate.pretty.Printer] listing entities:
2006-08-10 11:56:14,578 DEBUG [org.hibernate.pretty.Printer] com.stlouiscity.budget.database.beans.AccountBean{acctNum=5104, acctName=Salaries - Adjustments, acctId=167}
2006-08-10 11:56:14,578 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2006-08-10 11:56:14,578 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2006-08-10 11:56:14,625 DEBUG [org.hibernate.SQL] update Budget.Account set Acct_Num=?, Acct_Name=? where Acct_ID=?
2006-08-10 11:56:14,625 INFO [STDOUT] Hibernate: update Budget.Account set Acct_Num=?, Acct_Name=? where Acct_ID=?
2006-08-10 11:56:14,625 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
2006-08-10 11:56:14,625 DEBUG [org.hibernate.jdbc.AbstractBatcher] success of batch update unknown: 0
2006-08-10 11:56:14,625 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2006-08-10 11:56:14,625 DEBUG [org.hibernate.jdbc.ConnectionManager] skipping aggressive-release due to flush cycle
2006-08-10 11:56:14,625 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2006-08-10 11:56:14,625 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2006-08-10 11:56:14,625 DEBUG [org.hibernate.transaction.JTATransaction] Committed JTA UserTransaction
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964636#3964636
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964636
19 years, 9 months
[Tomcat, HTTPD, Servlets & JSP] - Re: Explicit document source root using context/docbase
by gburcher
Thanks for the suggestion. I had already seen the UsingContextDotXML wiki entry. This entry presumes that I have a web-app root directory, say MyWebApp.war, located in the jboss-install\server\default\deploy\jbossweb-tomcat55.sar directory.
The entry says to put the context.xml file in MyWebApp.war\WEB-INF. My whole purpose is to put the MyWebApp.war directory somewhere else, outside of the JBoss install directory. But I tried it anyway. I put an empty MyWebApp.war directory with WEB-INF in the jbossweb-tomcat55.sar directory. I put my context.xml file in WEB-INF. Here are the contents of the context.XML file:
<Context docBase="c:/MyLocation/MyWebApp.war" reloadable="true">
| </Context>
In the c:/MyLocation/MyWebApp.war directory I put the full deployment tree, including WEB-INF, that would normally go under the jbossweb-tomcat55.sar directory. With this configuration I get a 404 error on any jsp that I try to hit. Not sure if I could put the docBase value inside jboss-web.xml instead of context.xml. Can't find documentation of the allowed contents of jboss-web.xml.
It seems like there should be a way to define a web-app/context outside of the root directory for the web-app/context and specify the location of the root directory. Otherwise, there is a catch-22. I want to specify the root location of my web-app, but jboss/tomcat has to look inside the root location of my web-app to read the configuration info.
I'm close to giving up on this one. Is there anyone associated with JBoss development who can offer help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964635#3964635
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964635
19 years, 9 months
[JBoss Seam] - Re: When can @Logger be used?
by appendix
Ok, I managed to get the @Logger working in the simple bean:
| @Name("user1A6")
| public class User1A6 {
|
| private String username;
| private String password;
|
| @Logger private org.jboss.seam.log.Log log_seam;
|
| public User1A6() {
| System.out.println("===== User1A6 constructor");
| }
|
| public String getPassword() {
| System.out.println("===== User1A6.getPassword called");
| log_seam.info("===== User1A6.getPassword called");
| return password;
| }
|
| public void setPassword(String password) {
| System.out.println("===== User1A6.setPassword called: "+password);
| log_seam.info("===== User1A6.setPassword called: "+password);
| this.password = password;
| }
|
| public String getUsername() {
| System.out.println("===== User1A6.getUsername called");
| log_seam.info("===== User1A6.getUsername called");
| return username;
| }
|
| public void setUsername(String username) {
| System.out.println("===== User1A6.setUsername2 called: "+username);
| log_seam.info("===== User1A6.setUsername called: "+username);
| this.username = username;
| }
|
| public void frontendLog()
| {
| log_seam.debug( "User1A6 has been called from the frontend - @Logger" );
| }
|
The logger is accessible except in the constructor, which makes sense after all ;)
BUT if the bean is a entity-bean, I'm getting exceptions when I'm using the logger again!
Here's the code from a seam-example:
| @Entity
| @Name("user")
| @Scope(SESSION)
| @Table(name = "users")
| public class User implements Serializable {
|
| @Logger private org.jboss.seam.log.Log log;
|
| private String username;
| private String password;
| private String name;
|
| public User(String name, String password, String username) {
| this.name = name;
| this.password = password;
| this.username = username;
| }
|
| public User() {
| }
|
| @Id
| @NotNull
| @Length(min = 5, max = 15)
| public String getUsername() {
| log.info("===== User.getUsername: ");
| return username;
| }
|
| public void setUsername(String username) {
| log.debug("==== User.setUsername: ");
| this.username = username;
| }
|
| @NotNull
| @Length(min=5, max=15)
| public String getPassword() {
| log.info("===== User.getPassword: " );
| return password;
| }
|
| public void setPassword(String password) {
| log.debug("==== User.setPassword: ");
| this.password = password;
| }
|
| // ... some more getter/setter and methods
|
|
When the page refering to the user is called, I'll get a NullPointer Exception:
| javax.faces.el.EvaluationException: /home.xhtml @19,113 value="#{user.username}": org.jboss.seam.example.registration.User
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:75)
| at org.apache.myfaces.renderkit.RendererUtils.getStringValue(RendererUtils.java:225)
| at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:131)
| at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:49)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:554)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.faces.el.EvaluationException: Bean: org.jboss.seam.example.registration.User, property: username
| at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:404)
| at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
| at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
| at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
| at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
| ... 35 more
| Caused by: java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
| ... 41 more
| Caused by: java.lang.NullPointerException
| at org.jboss.seam.example.registration.User.getUsername(Unknown Source)
| ... 46 more
|
The logger should work in this case as well, right?
If I replace the seam logger with the one from apache.commons.logging everything's great!
Sorry for the long post and I'll appreciate your help!
Thanks, Kurt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964622#3964622
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964622
19 years, 9 months