Re: [Resin-interest] tag still a valid in resin 4?

2011-03-28 Thread Scott Ferguson
On 03/25/2011 06:29 PM, Keith Fetterman wrote:
> Is there a way to include the name of the thread in a log message
> generated by resin instead of the thread ID?  I see ${log.threadID} as a
> way to include the thread ID, but I'd like to display its name instead.
>
> We use Log4J in our application and it can display the thread name in
> its log messages so it would be nice to have the messages from resin
> display the names.

There's a %{thread} in the log-handler timestamp configuration. The EL 
doesn't have a ${thread}, but I've added a bug report for it (it's an 
easy addition.)

-- Scott

> Thanks,
> Keith
>
> On 03/25/2011 06:01 PM, Keith Fetterman wrote:
>> I see documentation in resin 4 for the   tag, but its not included
>> in the reference list of tags.  I only see   and
>>
>> http://caucho.com/resin-4.0/reference.xtp
>>
>> Is this an oversight in the resin 4 documentation or is has this tag
>> been replaced or discontinued?
>>
>> The   tag had a "format" attribute, which I don't see listed in the
>>and   tags.
>>
>> http://caucho.com/resin-4.0/admin/logging.xtp#Format-String
>>
>> What is the recommended way to add the format keywords to the Resin log
>> messages?
>>



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] tag still a valid in resin 4?

2011-03-28 Thread Scott Ferguson
On 03/25/2011 06:01 PM, Keith Fetterman wrote:
> I see documentation in resin 4 for the  tag, but its not included
> in the reference list of tags.  I only see  and
>
> http://caucho.com/resin-4.0/reference.xtp
>
> Is this an oversight in the resin 4 documentation or is has this tag
> been replaced or discontinued?

It's discouraged. It still exists for backward compatibility.

You should be using the log-handler and logger.
> The  tag had a "format" attribute, which I don't see listed in the
>   and  tags.
>
> http://caucho.com/resin-4.0/admin/logging.xtp#Format-String

I've just filed that as a doc issue. The "format" still exists in 
log-handler.

-- Scott

> What is the recommended way to add the format keywords to the Resin log
> messages?
>



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] com.caucho.server.cache.ProxyCacheFilterChain - unable to reset IncludeRequest

2011-03-28 Thread Keith Fetterman
We are updating our Web site from resin 3.0 to 4.0. I am seeing 
ProxyCacheFilterChain warnings in the Resin log.  I see an error message 
buried in the message "unable to reset IncludeRequest".  Has anyone seen 
a message like this and have idea what is causing it?  I looked through 
the resin documentation and I don't see anything.

> [11-03-28 09:43:38.004] {http://*:8082-1} WARNING 
> com.caucho.server.cache.ProxyCacheFilterChain {11} 
> ProxyCacheFilterChain[/docs/content/right_logos.html?null, 
> next=ServletFilterChain[resin-file]] unable to reset 
> IncludeRequest[/docs/content/right_logos.html,ForwardRequest[/templates/main_layout.jsp,ErrorRequest[/page_not_found_error.do,HttpServletRequestImpl[HttpRequest[default,
>  
> 1] 
> IncludeResponse[ForwardResponse[ForwardResponse[HttpServletResponseImpl[HttpResponseHttp[default,
>  
> 1] 

I've enabled debug logging of the cache adding the following statement 
at the top of the resin.xml, but I am not seeing any debug messages in 
the log.

> 

Please reply with any ideas on what might be causing these warnings.

Thanks,
Keith

-- 
-
Keith FettermanDirect: 206-319-9434
Mariner Supply, Inc.   206-780-5670
http://www.go2marine.com   kfetter...@go2marine.com

http://www.boatersline.com




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Resin 4: hibernate objects in HTTP session causing org.hibernate.LazyInitializationException

2011-03-28 Thread Keith Fetterman
Hi Mattias,

Thanks for the help.  That did it.

It is unfortunate that Hessian serialization does this because a lot Web 
development is based on hibernate.  We'd have to create non-hibernate 
clones of our persistent objects for storing in the session.

Keith

On 03/28/2011 02:30 AM, Mattias Jiderhamn wrote:
> By default Resin 4 uses Hessian for serialization of session data. 
> Hessian tries to traverse uninitialized Hibernate associations by 
> reflection, causing LazyInitializationException when serializing.
> For that reason, we are using Java serialization instead of Hessian 
> for session data.
>
> Here is how to configure:
>
> 
> ...
> java
> 
>
>
> 
>
> Keith Fetterman wrote (2011-03-25 23:42):
>> We have a custom Authenticator that extends resin's
>> com.caucho.server.security.AbstractAuthenticator.  In our custom
>> authenticator, I am storing a Hibernate object that contains a HashSet
>> of other Hibernate objects in my HTTP session.  When I restart Resin
>> (Resin 4.0.16), I am getting the following stack trace that is caused by
>> a "org.hibernate.LazyInitializationException" when I access the first
>> Web page after the server is started.
>>
>> It looks like resin is deserializing the Hibernate object from resin's
>> session persistence and then trying to populate the Set of associated
>> Hibernate objects, but the Set object that originally contained the
>> associated Hibernate objects does not exist.  I am guessing that is the
>> problem because I see the following cause:
>>> [11-03-25 14:56:04.683] {http://*:8082-1}
>>> com.caucho.hessian.io.HessianFieldException:
>>> com.marinersupply.common.authentication.ApplicationUser.roles:
>>> java.util.Set cannot be assigned from null
>> I am using the java.util.HashSet to contain the associated Hibernate
>> objects.  If this is the problem, why isn't resin also serializing the
>> HashSet?
>>
>> Doesn't Resin's session serialization serialize objects associated with
>> objects that are in the HTTP session?
>>
>> Does resin's session persistence mechanism invoke the methods on the
>> objects stored in the session when it serializes or unserializes the
>> objects from the session store?
>>
>> The reason that I ask this problem is that I get the following 
>> Exception:
>>> Caused by: org.hibernate.LazyInitializationException: failed to
>>> lazily initialize a collection, no session or session was closed
>> Why is resin invoking Hibernate to perform a lazy load of associated
>> objects on my hibernate object?  I've seen cause the error above when it
>> tried to persist the hibernate object at the end of processing an HTTP
>> request.  We use a servlet filter to close the Hibernate session.  It
>> looks like the act of persisting the session is occurring after resin
>> has returned from this filter because the Hibernate session was closed.
>> My question again is "why is resin invoking the methods on the object
>> that in turn makes a request to hibernate to lazy load the associated
>> objects?"
>>
>> Is resin using Hibernate as a part of its default session persistence
>> implementation?
>>
>> We didn't see any of these errors when we were running Resin 3.0.28.
>> But, in Resin 3.0.28, we were using Resin's MySQL session persistence.
>> In resin 4.0.16, we are using Resin's default session persistence store.
>>
>> I would appreciate any ideas on what might be going so I can track down
>> the problem.
>>
>> Thanks,
>> Keith
>>> [11-03-25 14:56:04.680] {http://*:8082-1}
>>> com.caucho.hessian.io.HessianFieldException:
>>> com.marinersupply.common.authentication.ApplicationUser.roles:
>>> java.util.Set cannot be assigned from null
>>>at
>>> com.caucho.hessian.io.UnsafeDeserializer.logDeserializeError(UnsafeDeserializer.java:790)
>>>  
>>>
>>>at
>>> com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:421)
>>>  
>>>
>>>at
>>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:239)
>>>  
>>>
>>>at
>>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:150)
>>>  
>>>
>>>at
>>> com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2212)
>>>  
>>>
>>>at
>>> com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1719)
>>>at
>>> com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1703)
>>>at
>>> com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:417)
>>>  
>>>
>>>at
>>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.ja

Re: [Resin-interest] Resin 4: hibernate objects in HTTP session causing org.hibernate.LazyInitializationException

2011-03-28 Thread Mattias Jiderhamn
By default Resin 4 uses Hessian for serialization of session data. 
Hessian tries to traverse uninitialized Hibernate associations by 
reflection, causing LazyInitializationException when serializing.
For that reason, we are using Java serialization instead of Hessian for 
session data.

Here is how to configure:


...
java





Keith Fetterman wrote (2011-03-25 23:42):
> We have a custom Authenticator that extends resin's
> com.caucho.server.security.AbstractAuthenticator.  In our custom
> authenticator, I am storing a Hibernate object that contains a HashSet
> of other Hibernate objects in my HTTP session.  When I restart Resin
> (Resin 4.0.16), I am getting the following stack trace that is caused by
> a "org.hibernate.LazyInitializationException" when I access the first
> Web page after the server is started.
>
> It looks like resin is deserializing the Hibernate object from resin's
> session persistence and then trying to populate the Set of associated
> Hibernate objects, but the Set object that originally contained the
> associated Hibernate objects does not exist.  I am guessing that is the
> problem because I see the following cause:
>> [11-03-25 14:56:04.683] {http://*:8082-1}
>> com.caucho.hessian.io.HessianFieldException:
>> com.marinersupply.common.authentication.ApplicationUser.roles:
>> java.util.Set cannot be assigned from null
> I am using the java.util.HashSet to contain the associated Hibernate
> objects.  If this is the problem, why isn't resin also serializing the
> HashSet?
>
> Doesn't Resin's session serialization serialize objects associated with
> objects that are in the HTTP session?
>
> Does resin's session persistence mechanism invoke the methods on the
> objects stored in the session when it serializes or unserializes the
> objects from the session store?
>
> The reason that I ask this problem is that I get the following Exception:
>> Caused by: org.hibernate.LazyInitializationException: failed to
>> lazily initialize a collection, no session or session was closed
> Why is resin invoking Hibernate to perform a lazy load of associated
> objects on my hibernate object?  I've seen cause the error above when it
> tried to persist the hibernate object at the end of processing an HTTP
> request.  We use a servlet filter to close the Hibernate session.  It
> looks like the act of persisting the session is occurring after resin
> has returned from this filter because the Hibernate session was closed.
> My question again is "why is resin invoking the methods on the object
> that in turn makes a request to hibernate to lazy load the associated
> objects?"
>
> Is resin using Hibernate as a part of its default session persistence
> implementation?
>
> We didn't see any of these errors when we were running Resin 3.0.28.
> But, in Resin 3.0.28, we were using Resin's MySQL session persistence.
> In resin 4.0.16, we are using Resin's default session persistence store.
>
> I would appreciate any ideas on what might be going so I can track down
> the problem.
>
> Thanks,
> Keith
>> [11-03-25 14:56:04.680] {http://*:8082-1}
>> com.caucho.hessian.io.HessianFieldException:
>> com.marinersupply.common.authentication.ApplicationUser.roles:
>> java.util.Set cannot be assigned from null
>>at
>> com.caucho.hessian.io.UnsafeDeserializer.logDeserializeError(UnsafeDeserializer.java:790)
>>at
>> com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:421)
>>at
>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:239)
>>at
>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:150)
>>at
>> com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2212)
>>at
>> com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1719)
>>at
>> com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1703)
>>at
>> com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:417)
>>at
>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:239)
>>at
>> com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:150)
>>at
>> com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2212)
>>at
>> com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2133)
>>at
>> com.caucho.hess