[Resin-interest] Using built-in database with JPA

2010-10-20 Thread Jozef Hartinger
Hello,

I am trying to get a simple application to work with eclipselink on the 
resin built-in database. I've setup eclipselink to use ResinPlatform.



I am getting the following error. resin.jar which contains the class is 
present in the lib folder (by default). Is there a way around?

Exception Description: Database platform class 
[org.eclipse.persistence.platform.server.resin.ResinPlatform] not found.
Internal Exception: java.lang.InstantiationException: 
org.eclipse.persistence.platform.server.resin.ResinPlatform
 at 
org.eclipse.persistence.exceptions.ValidationException.platformClassNotFound(ValidationException.java:1483)
 at 
org.eclipse.persistence.sessions.DatasourceLogin.setPlatformClassName(DatasourceLogin.java:515)
 at 
org.eclipse.persistence.sessions.DatasourceLogin.setPlatformClassName(DatasourceLogin.java:551)
 at 
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateLogins(EntityManagerSetupImpl.java:1156)
 at 
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateServerSession(EntityManagerSetupImpl.java:1417)
 at 
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:359)
 at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
 at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
 at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:202)
 at 
com.caucho.env.jpa.EntityManagerJtaProxy.getCurrent(EntityManagerJtaProxy.java:861)
 at 
com.caucho.env.jpa.EntityManagerJtaProxy.createNamedQuery(EntityManagerJtaProxy.java:646)
 at 
org.jboss.seam.resteasy.example.tasks.resource.CategoryCollectionResource.getCategories(CategoryCollectionResource.java:56)
 at 
org.jboss.seam.resteasy.example.tasks.resource.CategoryCollectionResource__StatelessProxy.getCategories(CategoryCollectionResource__StatelessProxy.java:77)
 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:597)
 at 
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
 at 
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:252)
 at 
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:217)
 at 
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:206)
 at 
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:503)
 at 
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:480)
 at 
org.jboss.resteasy.core.SynchronousDispatcher.invokePropagateNotFound(SynchronousDispatcher.java:139)
 at 
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:203)
 at 
org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:59)
 at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
 at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183)
 at 
com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:95)
 at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:287)
 at 
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:792)
 at 
com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:675)
 at 
com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:637)
 at 
com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:588)
 at 
com.caucho.network.listen.TcpSocketLink$AcceptTask.doTask(TcpSocketLink.java:1175)
 at 
com.caucho.network.listen.TcpSocketLink$ConnectionReadTask.runThread(TcpSocketLink.java:1108)
 at 
com.caucho.network.listen.TcpSocketLink$AcceptTask.run(TcpSocketLink.java:1142)
 at com.caucho.env.thread.ResinThread.runTasks(ResinThread.java:182)
 at com.caucho.env.thread.ResinThread.run(ResinThread.java:126)
Caused by: java.lang.InstantiationException: 
org.eclipse.persistence.platform.server.resin.ResinPlatform
 at java.lang.Class.newInstance0(Class.java:340)
 at java.lang.Class.newInstance(Class.java:308)
 at 
org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(PrivilegedAccessHelper.java:354)
 at 
org.eclipse.persistence.sessions.DatasourceLogin.setPlatformClassName(DatasourceLogin.java:510)
  

[Resin-interest] AppScope variable in Resin.XML

2010-10-20 Thread Aaron Freeman
  Is there a simple way to set an applicationScope variable from within 
the resin.xml?

I see how to set system properties, but I'd like something I can 
reference from a JSP like:

${applicationScope.var}

Or can I reference the system properties similarly?

Thanks,

Aaron





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


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Aaron Freeman
  Bah I stumbled on this, but it doesn't appear to do what I was hoping:


baz
value


When I tried to reference that in a test.jsp like this, it is empty:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>

-${applicationScope.baz}-


Any other way to do this?

Thanks,

Aaron



On 10/20/2010 12:09 PM, Aaron Freeman wrote:
>Is there a simple way to set an applicationScope variable from within
> the resin.xml?
>
> I see how to set system properties, but I'd like something I can
> reference from a JSP like:
>
> ${applicationScope.var}
>
> Or can I reference the system properties similarly?
>
> Thanks,
>
> Aaron
>
>
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>



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


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Scott Ferguson
Aaron Freeman wrote:
>   Bah I stumbled on this, but it doesn't appear to do what I was hoping:
>
> 
> baz
> value
> 
>
> When I tried to reference that in a test.jsp like this, it is empty:
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
> 
> -${applicationScope.baz}-
> 
>
> Any other way to do this?
>   
Hmm. I'd forgotten that context-param is application.getInitParam.

You can use ${initParam.baz} to get the context-param value.

I can't remember any way to set the application attributes directly from 
the config file, although we could enhance resin:set to allow for 
var="#{application.bar}".

-- Scott
> Thanks,
>
> Aaron
>
>
>
> On 10/20/2010 12:09 PM, Aaron Freeman wrote:
>   
>>Is there a simple way to set an applicationScope variable from within
>> the resin.xml?
>>
>> I see how to set system properties, but I'd like something I can
>> reference from a JSP like:
>>
>> ${applicationScope.var}
>>
>> Or can I reference the system properties similarly?
>>
>> Thanks,
>>
>> Aaron
>>
>>
>>
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>> 
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>   



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


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Aaron Freeman
  On 10/20/2010 12:39 PM, Scott Ferguson wrote:
> Aaron Freeman wrote:
>>Bah I stumbled on this, but it doesn't appear to do what I was hoping:
>>
>> 
>> baz
>> value
>> 
>>
>> When I tried to reference that in a test.jsp like this, it is empty:
>>
>> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>> 
>> -${applicationScope.baz}-
>> 
>>
>> Any other way to do this?
>>
> Hmm. I'd forgotten that context-param is application.getInitParam.
>
> You can use ${initParam.baz} to get the context-param value.
>
> I can't remember any way to set the application attributes directly from
> the config file, although we could enhance resin:set to allow for
> var="#{application.bar}".
>
> -- Scott

A coworker stumbled upon ${initParam.baz} -- the only unfortunate thing 
about that is, we are trying to do this:



And when we dump ${initParam.baz} it renders literally as 
"${varWePassedIn}" instead of the value of ${varWePassedIn}.

The resin:set solution sounds great.  Would this be more intuitive:



Where you reference a scope instead of have the #{application.bar} syntax?

Thanks,

Aaron



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


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Scott Ferguson
Aaron Freeman wrote:
>   On 10/20/2010 12:39 PM, Scott Ferguson wrote:
>   
>> Aaron Freeman wrote:
>> 
>>>Bah I stumbled on this, but it doesn't appear to do what I was hoping:
>>>
>>> 
>>> baz
>>> value
>>> 
>>>
>>> When I tried to reference that in a test.jsp like this, it is empty:
>>>
>>> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>>> 
>>> -${applicationScope.baz}-
>>> 
>>>
>>> Any other way to do this?
>>>
>>>   
>> Hmm. I'd forgotten that context-param is application.getInitParam.
>>
>> You can use ${initParam.baz} to get the context-param value.
>>
>> I can't remember any way to set the application attributes directly from
>> the config file, although we could enhance resin:set to allow for
>> var="#{application.bar}".
>>
>> -- Scott
>> 
>
> A coworker stumbled upon ${initParam.baz} -- the only unfortunate thing 
> about that is, we are trying to do this:
>
> 
>   

Can you try  before that context-param? That should 
enable the EL evaluation.
> And when we dump ${initParam.baz} it renders literally as 
> "${varWePassedIn}" instead of the value of ${varWePassedIn}.
>
> The resin:set solution sounds great.  Would this be more intuitive:
>
> 
>
> Where you reference a scope instead of have the #{application.bar} syntax?
>   
The problem is that resin:set doesn't actually know about web-apps 
because it's a generic high-level configuration tag.  The EL expression 
would work because resin:set can evaluate things in context, and the 
web-app context would know about the application scope.

-- Scott
> Thanks,
>
> Aaron
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>   



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


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Aaron Freeman
  On 10/20/2010 1:13 PM, Scott Ferguson wrote:
> Aaron Freeman wrote:
>>On 10/20/2010 12:39 PM, Scott Ferguson wrote:
>>
>>> Aaron Freeman wrote:
>>>
 Bah I stumbled on this, but it doesn't appear to do what I was hoping:

 
 baz
 value
 

 When I tried to reference that in a test.jsp like this, it is empty:

 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
 
 -${applicationScope.baz}-
 

 Any other way to do this?


>>> Hmm. I'd forgotten that context-param is application.getInitParam.
>>>
>>> You can use ${initParam.baz} to get the context-param value.
>>>
>>> I can't remember any way to set the application attributes directly from
>>> the config file, although we could enhance resin:set to allow for
>>> var="#{application.bar}".
>>>
>>> -- Scott
>>>
>> A coworker stumbled upon ${initParam.baz} -- the only unfortunate thing
>> about that is, we are trying to do this:
>>
>> 
>>
> Can you try  before that context-param? That should
> enable the EL evaluation.

That worked!  It's a good enough solution for us for now.  using 
${applicationScope} is better in the future though, if you do happen to 
extend the functionality of resin:set.

>> And when we dump ${initParam.baz} it renders literally as
>> "${varWePassedIn}" instead of the value of ${varWePassedIn}.
>>
>> The resin:set solution sounds great.  Would this be more intuitive:
>>
>> 
>>
>> Where you reference a scope instead of have the #{application.bar} syntax?
>>
> The problem is that resin:set doesn't actually know about web-apps
> because it's a generic high-level configuration tag.  The EL expression
> would work because resin:set can evaluate things in context, and the
> web-app context would know about the application scope.
Ah, that does make sense.

Thanks for getting us going,

Aaron


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


[Resin-interest] Limits of rewrite-dispatch in Resin 3.1.6?

2010-10-20 Thread Nick Pilch
I'm upgrading our codebase to Resin 3.1 and Resin seems to be having
problems with rewrite-dispatch entries. The stacktrace below would seem to
indicate some sort of circular reference, but these redirects work fine in
Resin 3.0. Additionally, the issue doesn't seem to come up with a particular
entry, but rather if I surpass a certain number of entries (in the xml file
I'm editing, having 506 entries is OK, but having 507 entries causes the
problem). Most of these entries are 301s, "". I haven't
been able to find any reference to such a limitation yet. Does this sound
familiar to anyone?

X:20101020124121.239:javax.servlet.ServletException:
java.lang.StackOverflowError
javax.servlet.ServletException: java.lang.StackOverflowError
at
com.caucho.server.dispatch.ExceptionFilterChain.(ExceptionFilterChain.java:57)
at com.caucho.server.webapp.WebApp.buildInvocation(WebApp.java:2114)
at
com.caucho.server.webapp.WebAppContainer.buildInvocation(WebAppContainer.java:716)
at com.caucho.server.host.Host.buildInvocation(Host.java:489)
at
com.caucho.server.host.HostContainer.buildInvocation(HostContainer.java:314)
at com.caucho.server.cluster.Server.buildInvocation(Server.java:1009)
at
com.caucho.server.dispatch.DispatchServer.buildInvocation(DispatchServer.java:209)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:262)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:721)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:643)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.StackOverflowError
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at com.caucho.server.rewrite.ForwardRule.dispatch(ForwardRule.java:77)
at
com.caucho.server.rewrite.AbstractRuleWithConditions.map(AbstractRuleWithConditions.java:217)
at
com.caucho.server.rewrite.AbstractRuleWithConditions.map(AbstractRuleWithConditions.java:195)
at
com.caucho.server.rewrite.AbstractRuleWithConditions.map(AbstractRuleWithConditions.java:195)
at
com.caucho.server.rewrite.AbstractRuleWithConditions.map(AbstractRuleWithConditions.java:195)
at
com.caucho.server.rewrite.AbstractRuleWithConditions.map(AbstractRuleWithConditions.java:195)
...
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest