[Installation, Configuration & Deployment] - Re: Rolling over JBoss console log
by ramdas
Peter,
In my configuration, when JBoss starts, the console output is redirected to a file (using start_jboss.sh > console.log 2>&1).
I am trying to find a way to rollover the log file which is being created as a result of redirecting console output.
I realize that the format of the data output to the console is being influenced by the following in log4j.xml
| <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
| <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
| <param name="Target" value="System.out"/>
| <param name="Threshold" value="INFO"/>
|
| <layout class="org.apache.log4j.PatternLayout">
| <!-- The default pattern: Date Priority [Category] Message\n -->
| <param name="ConversionPattern" value="%d %-5p [%c{1}] %m%n"/>
| </layout>
| </appender>
|
I tried using an element in log4j.xml similar to the one i have used for creating and rolling over the JBoss server.log. But it does not have any influence on console.log - which i think makes sense since the console.log file is not created by log4j but by my shelll script which is redirecting the console output.
I am trying to find if there is a way to capture the console output to a file and also rollover that file every day.
Thanks
Ramdas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971154#3971154
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971154
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - em.remove() has problem if version is maintained by db
by getvasant
Though I posted this issue before let me rephrase again with some example. Lets say Customer and Order has one to many relationship. Assume Customer C1 has 2 Orders O1 and O2. In Customer entity I defined collection of Orders and annotated it as OneToMany. In Orders I defined Customer and annotated it as ManyToOne and JoinColumn. So code looks something like this
In Customer
|
| private List<Orders> orderList = new ArrayList<Orders>();
|
| @OneToMany(mappedBy="customer", fetch=FetchType.EAGER, cascade=CascadeType.ALL)
| public List<Orders> getOrderList()
| {
| return orderList;
| }
|
| @Version
| @Column(name="Version", insertable=false, updatable=false)
| public int getVersion()
| {
| return version;
| }
|
In Order
|
| private Customers customer;
| @ManyToOne()
| @JoinColumn(name="CustomerID")
| public Customers getCustomer()
| {
| return customer;
| }
|
| @Version
| @Column(name="Version", insertable=false, updatable=false)
| public int getVersion()
| {
| return version;
| }
|
|
As it is clear from the code that we have version field but we allow hibernate to use version for validation but updation of it is done through database trigger.
Now when I call em.remove(customer) i got an exception :
StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
When i dig into this issue I found out that when I call em.remove(customer), em first calls update on Customer and then delete of all child(Order in this case) and then parent (Customers). But since update gets called before delete which makes Version number of Customer record is incremented by 1 in database through db trigger. This makes deletion fails due to version conflict.
Any help will be really appreciated.
Thnx
V
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971150#3971150
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971150
19 years, 7 months
[JBoss Seam] - Re: Seam + Portal
by andyd
Guys,
I have been working with this for a few days to try and get it working. I have added portlet config files to the seam blog example to try and simulate the set up that I was hoping to use for a project. Have installed using the 1.2.0BETA JbossAS installer and selected the Portal profile.
I have had the seam 1.0.1GA portal example working fine. However I am getting problems when trying to move to the seam + portlet + ejb3 + facelets in an EAR config.
Does anyone have a working example of this setup? Am I doing something that won't work? Can post added configs if it will help.
Andy.
I see this [org.jboss.seam.jsf.AbstractSeamPhaseListener] There should only be one Seam phase listener per application
and a little later
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 14)
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2006-09-13 00:20:06,856 DEBUG [org.hibernate.SQL] update HitCount set pageviews=? where blog_name=?
2006-09-13 00:20:06,856 INFO [STDOUT] Hibernate: update HitCount set pageviews=? where blog_name=?
2006-09-13 00:20:06,856 DEBUG [org.hibernate.cache.NonstrictReadWriteCache] Invalidating: domain.HitCount#JBoss Seam Blog
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 15)
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] skipping aggressive-release due to flush cycle
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 14) (open ResultSets: 0, globally: 0)]
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
2006-09-13 00:20:06,856 DEBUG [org.hibernate.cache.NonstrictReadWriteCache] Invalidating (again): domain.HitCount#JBoss Seam Blog
2006-09-13 00:20:06,856 DEBUG [org.hibernate.cache.UpdateTimestampsCache] Invalidating space [HitCount], timestamp: 4743590735282177
2006-09-13 00:20:06,856 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] beginning transaction prior to phase: INVOKE_APPLICATION(5)
2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages
2006-09-13 00:20:06,856 DEBUG [org.jboss.seam.Component] initializing new instance of: facesMessages
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.Component] seam component not found: org.jboss.seam.security.authenticator
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.userinfo
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: THEME
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.portal.attribute.component_invocation
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.request
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.response
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.catalina.NAMED
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: THEMERESULT
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Contexts] destroying: javax.portlet.config
2006-09-13 00:20:06,936 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Contexts] destroying: entityManager
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.core.ManagedPersistenceContext] destroying seam managed persistence context for persistence unit: java:/blogEntityManagerFactory
2006-09-13 00:20:06,946 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Contexts] destroying: conversation
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2006-09-13 00:20:06,946 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
2006-09-13 00:20:06,946 ERROR [org.apache.myfaces.portlet.MyFacesGenericPortlet] The portlet threw an exception
java.lang.IllegalStateException: No active session context
at org.jboss.seam.Seam.isSessionInvalid(Seam.java:176)
at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:264)
at org.jboss.seam.jsf.SeamPortletPhaseListener.afterPhase(SeamPortletPhaseListener.java:99)
at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:359)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:323)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.nonFacesRequest(MyFacesGenericPortlet.java:298)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:380)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:407)
at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:561)
at org.jboss.portal.portlet.container.PortletContainer.dispatch(PortletContainer.java:482)
at org.jboss.portal.portlet.container.PortletContainerInvoker$1.dispatch(PortletContainerInvoker.java:138)
at org.jboss.portal.portlet.invocation.PortletInvocation.dispatch(PortletInvocation.java:242)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:37)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
at org.jboss.portal.core.aspects.component.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971145#3971145
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971145
19 years, 7 months