Re: [Resin-interest] Bean as HessianServices Breaks Injection
Cool, (more below) On Tue, Jan 19, 2010 at 8:29 AM, Alex wrote: > On 2010-01-16, at 6:47 PM, Scott Hernandez wrote: >> I noticed when I registered my class as a HessianService it was no >> longer able to inject it. Is this an expected behavior? > This seems broken, I've added a bug report to > http://bugs.caucho.com/view.php?id=3852 > > We are adding ResinBeanContext with the intended use from JUnit tests. > Basically it's a light container > that bootstraps Resin CDI Implementation allowing for bean creation in a way > that's done inside resin. Is this going to be the suggested way to unit test apps then? As you can probably tell from our source code the main reason we expose the objects as HessianServices is so that we can run unit tests against the container. There are still a few places where it might be useful to expose services for things other than unit testing, but for the most part that is why we need to use HessianServices. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Bean as HessianServices Breaks Injection
I noticed when I registered my class as a HessianService it was no longer able to inject it. Is this an expected behavior? I am working against 4.0.3. BTW. You can reproduce all the problems I'm find using our resin4.0.3 branch of subetha - http://subetha.googlecode.com/svn/branches/resin4.0.3/. There are quite a few more things that seems broken I will post about when I have more time. Take a look at http://subetha.googlecode.com/svn/branches/resin4.0.3/src/org/subethamail/core/admin/ListWizardBean.java for an example bean that no longer works once I add this to our config: -Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] the response time
It depends on what your services, performance, and bandwidth requirements are. Anyway, there are (a few) options. ldirectord - (low level) http://linux.die.net/man/8/ldirectord balance -- (low level) http://www.inlab.de/balance.html trafficmanager -- (yahoo lb turned open-source) http://incubator.apache.org/projects/trafficserver.html zxtm -- (free/commercial) http://www.zeus.com/products/traffic-manager/index.html You can do this at the network level (MAC/IP) or application level (http, etc.). There are tons of reverse-proxies with load-balancing too. There is nothing wrong with using Apache and Resin, but people do use apache for things that aren't in its core set of features and then wonder why there are problems... On Sat, Jan 16, 2010 at 2:24 AM, Wesley Wu wrote: > Hi Jon & Scott, > > I don't like apache either but resin 4.0.2 cluster web-tier seems > unstable for me. > > I've not tested the 4.0.3 cluster. > > My Apache config: > > ResinHost 192.168.1.4 6801 > ResinBackup 192.168.1.5 6801 > > Which load balancer will be more appropriate for this usage? > Thanks. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Messaging Config
I was looking at the lastest 4.0.3 docs and it seems to indicate that I should do this for my configuration: ... delivery >From the docs here: http://caucho.com/resin/admin/candi.xtp#Custom%20Services But there is no JmsListener class, and resin complains like this: 10-01-15 13:18:56.666] {main} WEB-INF/resin-web.xml:37: 'QName[resin:{urn:java:com.caucho.resin}JmsListener]' cannot be instantiated because it does not map to a known class. I wanted to replace the old style way with the new candi config. Here is the old (working) style. #{delivery} This stuff seems pretty confusing and the docs seem to be misleading and wrong. In addition there seems to be some missing pieces in making the connections, even if the docs were correct. What is the suggestion config here? Is there a more consise syntax that I should be using? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] MDB Config Using CanDI
Right, and maybe then we will have support for @Current @MyQueue BlockingQueue also. Yeah, the (remote) service/servlet stuff will be cleaner with that syntax. On Tue, May 19, 2009 at 9:13 AM, Scott Ferguson wrote: > > On May 18, 2009, at 10:51 PM, Scott Hernandez wrote: > >> I was going to start converting a bit of the config from the xml >> mapped names to the actual class names in our resin-web.xml . However >> the names have changed; Is there an example of how this works? >> >> >> > class="org.subethamail.core.queue.DeliveryListener"/> > > ejb-message-bean is a complicated case because the real bean is your > DeliveryListener. A similar kind of issue applies to remote service > configuration, and bam-service and even Servlets. > > I think the right solution is to configure the DeliveryListener with > annotations: > > > > > > Or for servlets: > > > > > > Where @MessageBean and @WebServlet are known annotations. The CanDI > spec's SPI has just changed radically in the last 3 weeks, making that > kind of configuration possible (it's still a few weeks before Resin > supports it, though.) > > So, until that's supported, you'll want to stick with bean>. > > -- Scott >> >> >> >> >> > class >> = >> "org >> .subethamail.core.queue.DeliveryListener">#{delivery}> destination> >> >> Thanks in advance, >> Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] MDB Config Using CanDI
I was going to start converting a bit of the config from the xml mapped names to the actual class names in our resin-web.xml . However the names have changed; Is there an example of how this works? #{delivery} Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Hessian Remote Refs
I have setup a hessian service (servlet) and when returning objects (stateless ejb for example) I see that a SingletonHandle instance if returned over the protocol. The client proxy then unpacks the object and tries to call the local (client) Injector to get the instance, instead of making the remote call to retrieve the instance from the server. How can I have the Hessian protocol return a ref to my actual bean, or a remote reference it won't try to resolve (create) at the client? Here is the type of code I'm using on the client: HessianProxyFactory fact = new HessianProxyFactory(); fact.setOverloadEnabled(true); fact.setUser("god"); fact.setPassword("loves us all"); MyService myService = (MyService)fact.create(MyService.class, "http://localhost:8080/mywebapp/api/myservice";); myService.doServerThing(); // does server thing OtherBean ob = myServer.getOtherBean(); //UnsatisfiedDependencyException ; this should be called on the server ob.changeServerState(); OtherAppScopeBean oasb = myServer.getOtherAppScopeBean(); String[] sArr = oasb.doSomething(); Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Entities in Resin 4.0 (CanDI)
Hi all, Do entities gets all the CanDI (like servlets, EJBs and so on)? I'm assuming Amber does this when creating new instances. Also, if we use Hibernate will the entities created also be injected? I assume not, and if not, is there a plan for supporting this? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] WebApp context-path
I'd like to set the context-path for my war (to be something other than the name of the war file). So that mywar.war deploys to http://localhost/someothername. It seems like setting the context-path of the defined in resin-web.xml should be the way(http://www.caucho.com/resin/doc/resin-web-xml-schema.xtp), but there is an error when I do this. I also thought that maybe setting the id would do it, since that is what the code uses, if no contect-path is set. Anyone got a suggestion? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] JavaMail Session Injection
I'd like to inject a Session into a few of my beans. I believe the correct way to do this is to use the @Resource(name="java:comp/env/mail") annotation, but I would like to be less verbose (if possible), and just use @Current, so I have done the following: @ApplicationScoped public class Producers { @Resource(name="java:comp/env/jdbc/subetha") DataSource ds; @Resource(name="java:comp/env/mail") Session ses; @Produces //@Name("subetha") Session createMailSession(){ return this.ses; } @Produces @Name("subetha") DataSource createSubethaDS(){ return this.ds; } } But this produces a stack overflow with reference to the sess field injection. It seems like it is actually getting this producer factory from the inject manager and trying to use its own "createMailSession" method (recursively) to do the injection.This seems very bad :( , or have i misunderstood how this is supposed to work? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Stack overflow on resin-web.xml load
Fair enough. Is there any way of debugging this, or detecting which injections are the cause of the problem(s)? It is fairly hard to get a debugger into the situation as these are such common operations in th injection system and I don't know which classes (injection cases) are the cause. On Wed, May 6, 2009 at 8:48 AM, Scott Ferguson wrote: > > On May 5, 2009, at 11:08 AM, Scott Hernandez wrote: > >> I'm a little stumped on this one. I'm guessing that there is some kind >> of circular dep. in the classes (EJBs), but where is the question... > > I've added a bug report at http://bugs.caucho.com/view.php?id=3480 > > The circular dependency problem can be a bit tricky internally, > particularly in combination with EL expressions. The CanDI spec does > have some support for circular dependencies, but there's a bit of > extra work that Resin needs to do to make it work. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] InjectManager not binding generified class?
The inject manager isn't adding this class to the registered beans. I have seen a few issues with Generic classes with matching classes but this ones seems pretty straight forward. Does anything anyone know why this isn't picked up and registered in the inject manager? @New public class InjectBeanHelper { @Current Manager mgr; public InjectBeanHelper(){} @SuppressWarnings("unchecked") public T getInstance(String clazz){ T o = null; Class tc = null; try { tc = (Class) Class.forName(clazz); o = (T)mgr.getInstanceByType(tc); }catch(ClassNotFoundException e){} if(o==null) o = (T)mgr.getInstanceByName(clazz); return o; } public T getInstance(Class clazz){ return this.mgr.getInstanceByType(clazz); } } I'm still working against trunk :) ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Stack overflow on resin-web.xml load
I'm a little stumped on this one. I'm guessing that there is some kind of circular dep. in the classes (EJBs), but where is the question... [09-05-05 10:58:42.741] {main} resin:import 'c:\src\caucho\resin\webapps\subetha\WEB-INF\resin-web.xml' log4j:WARN No appenders could be found for logger (org.subethamail.core.smtp.SMTPService). log4j:WARN Please initialize the log4j system properly. [09-05-05 10:58:46.286] {main} file:/c:/src/caucho/resin/conf/app-default.xml:240: com.caucho.config.core.ResinImport.init(): java.lang.StackOverflowError [09-05-05 10:58:46.286] {main} [09-05-05 10:58:46.286] {main} 238: [09-05-05 10:58:46.286] {main} 239: [09-05-05 10:58:46.286] {main} 240: [09-05-05 10:58:46.286] {main} 241: [09-05-05 10:58:46.286] {main} 242: [09-05-05 10:58:46.286] {main} [09-05-05 10:58:46.286] {main} at com.caucho.config.ConfigContext.error(ConfigContext.java:1309) [09-05-05 10:58:46.286] {main} at com.caucho.config.ConfigContext.configureChildNode(ConfigContext.java:496) [09-05-05 10:58:46.286] {main} at com.caucho.config.ConfigContext.configureAttribute(ConfigContext.java:364) [09-05-05 10:58:46.286] {main} at com.caucho.config.program.NodeBuilderChildProgram.inject(NodeBuilderChildProgram.java:71) [09-05-05 10:58:46.286] {main} at com.caucho.config.program.ContainerProgram.inject(ContainerProgram.java:80) [09-05-05 10:58:46.286] {main} at com.caucho.config.program.ConfigProgram.configure(ConfigProgram.java:70) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:381) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:55) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:676) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) [09-05-05 10:58:46.286] {main} at com.caucho.server.webapp.WebAppContainer.startImpl(WebAppContainer.java:707) [09-05-05 10:58:46.286] {main} at com.caucho.server.host.Host.startImpl(Host.java:496) [09-05-05 10:58:46.286] {main} at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:687) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:678) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) [09-05-05 10:58:46.286] {main} at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) [09-05-05 10:58:46.286] {main} at com.caucho.server.host.HostContainer.start(HostContainer.java:484) [09-05-05 10:58:46.286] {main} at com.caucho.server.cluster.Server.start(Server.java:1822) [09-05-05 10:58:46.286] {main} at com.caucho.server.resin.Resin.createServer(Resin.java:927) [09-05-05 10:58:46.286] {main} at com.caucho.server.resin.Resin.start(Resin.java:998) [09-05-05 10:58:46.286] {main} at com.caucho.server.resin.Resin.initMain(Resin.java:1462) ... Here is the resin-web.xml (http://subetha.googlecode.com/svn/branches/resin/web/WEB-INF/resin-web.xml) http://caucho.com/ns/resin"; xmlns:resin="urn:java:com.caucho.resin" xmlns:cfg="urn:java:com.caucho.config" xmlns:jms="urn:java:com.caucho.jms" xmlns:ejb="urn:java:com.caucho.ejb" xmlns:adm="urn:java:org.subethamail.core.admin" xmlns:util="urn:java:org.subethamail.core.util" xmlns:ss="urn:java:org.subethamail.web.security" xmlns:queue="urn:java:org.subethamail.core.queue" > delivery injection #{delivery} #{injection} true 0 select 1; jdbc:postgresql://localhost/subetha subetha subetha ... ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] ResinDeploy Ant Task Error
I'm working against trunk :) I added the following to the conf/resin.xml (copied from resin.xml.in) file. . (as described here: http://blog.caucho.com/?p=134) [09-05-05 09:39:42.595] {main} InjectManager[cluster:??] fireEvent InjectManager[cluster:??] [09-05-05 09:39:42.595] {main} InjectManager[cluster:??] fireEvent BeanStartupEvent[SimpleBean[RemoteAdminService, {...@javax.inject.current()}, @Production, @ApplicationScope]] [09-05-05 09:39:42.635] {main} RemoteAdminService$BeanProxy[] enabled at http://admin.resin/hmtp [09-05-05 09:39:42.736] {main} Host[default] initializing [09-05-05 09:39:42.736] {main} Host[default] root-directory=/c:/src/caucho/resin/ On Tue, May 5, 2009 at 8:50 AM, Emil Ong wrote: > Switching to 8080 is right - HMTP operates on the HTTP port. For the > error below, can you send your resin.xml? It looks like you didn't > configure the deploy service somehow. Depending on which snapshot > you got, it's also possible that CanDI didn't configure/start the > deploy service even if you configured it. In the newest versions, > those problems have been fixed. > > Emil > > On Tue, May 05, 2009 at 12:30:23AM -0700, Scott Hernandez wrote: >> So, I played around a bit and changed the port to 8080, instead of >> 6800 and now get a different error. >> >> BUILD FAILED >> com.caucho.bam.ServiceUnavailableException: >> ActorError[type=cancel,group=service-unavailable,text='dep...@resin.caucho' >> is an unknown actor for queryGet] >> at com.caucho.bam.ActorError.createException(ActorError.java:376) >> at >> com.caucho.bam.SimpleActorClient.queryGet(SimpleActorClient.java:156) >> at >> com.caucho.server.admin.DeployClient.queryGet(DeployClient.java:393) >> at >> com.caucho.server.admin.DeployClient.getCommitList(DeployClient.java:331) >> at >> com.caucho.server.admin.DeployClient.deployJar(DeployClient.java:286) >> at >> com.caucho.server.admin.DeployClient.deployJarContents(DeployClient.java:108) >> at com.caucho.ant.ResinDeploy.execute(ResinDeploy.java:147) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> >> Resin output: >> [09-05-05 00:23:04.152] {resin-ServerFromLinkStream-read-12} >> ServerFromLinkStream[null] queryGet GetPublicKeyQuery[] {id:1, >> to:null, from:null} >> [09-05-05 00:23:04.152] {resin-ServerFromLinkStream-read-12} >> ServerToLinkStream[null] queryResult GetPublicKeyQuery[RSA,X.509] {id: >> 1, to:null, from:null} >> [09-05-05 00:23:05.063] {resin-ServerFromLinkStream-read-12} >> ServerFromLinkStream[null] querySet AuthQuery[subetha,EncryptedObject] >> {id:2, to:null, from:null} >> [09-05-05 00:23:05.073] {resin-ServerFromLinkStream-read-12} >> HempDomainService[aaa.app-tier.admin.resin] >> onChildStart(sube...@aaa.app-tier.admin.resin/SEPpKI/) >> [09-05-05 00:23:05.073] {resin-ServerFromLinkStream-read-12} >> ServerToLinkStream[null] queryResult >> authresult[sube...@aaa.app-tier.admin.resin/SEPpKI/] {id: 2, >> to:null, from:null} >> [09-05-05 00:23:06.445] {resin-ServerFromLinkStream-read-12} >> serverfromlinkstream[hempconnectionimpl[sube...@aaa.app-tier.admin.resin/SEPpKI/]] >> queryGet DeployCommitListQuery[] {id:3, to:dep...@resin.caucho, >> from:sube...@aaa.app-tier.admin.resin/SEPpKI/} >> [09-05-05 00:23:06.445] {resin-ServerFromLinkStream-read-12} >> ServerToLinkStream[null] queryError >> ActorError[type=cancel,group=service-unavailable,text='dep...@resin.caucho' >> is an unknown actor for queryGet] DeployCommitListQuery[] {id: 3, >> to:sube...@aaa.app-tier.admin.resin/SEPpKI/, >> from:dep...@resin.caucho} >> >> Note: The admin user is subetha, not "admin" if the output above seems >> a bit off ... >> >> On Tue, May 5, 2009 at 12:14 AM, Scott Hernandez >> wrote: >> > So, I'm trying to get the ant task deployed using the new fangled >> > stuff; It seems to fail horribly :( >> > >> > Here is some of the (pertinent) output from the ant task: >> > >> > resin-deploy: >> > >> > BUILD FAILED >> > com.caucho.bam.RemoteConnectionFailedException: Failed to upgrade to HMTP >> > X >> > >> > >> > at com.caucho.bam.hmtp.HmtpClient.connectImpl(HmtpClient.java:230) >> > at com.caucho.bam.hmtp.HmtpClient.connect(HmtpClient.java:161) >> > at com.caucho.server.admin.DeployClient.(DeployClient.java:78) >> > at com.caucho.ant.ResinDeplo
Re: [Resin-interest] ResinDeploy Ant Task Error
So, I played around a bit and changed the port to 8080, instead of 6800 and now get a different error. BUILD FAILED com.caucho.bam.ServiceUnavailableException: ActorError[type=cancel,group=service-unavailable,text='dep...@resin.caucho' is an unknown actor for queryGet] at com.caucho.bam.ActorError.createException(ActorError.java:376) at com.caucho.bam.SimpleActorClient.queryGet(SimpleActorClient.java:156) at com.caucho.server.admin.DeployClient.queryGet(DeployClient.java:393) at com.caucho.server.admin.DeployClient.getCommitList(DeployClient.java:331) at com.caucho.server.admin.DeployClient.deployJar(DeployClient.java:286) at com.caucho.server.admin.DeployClient.deployJarContents(DeployClient.java:108) at com.caucho.ant.ResinDeploy.execute(ResinDeploy.java:147) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Resin output: [09-05-05 00:23:04.152] {resin-ServerFromLinkStream-read-12} ServerFromLinkStream[null] queryGet GetPublicKeyQuery[] {id:1, to:null, from:null} [09-05-05 00:23:04.152] {resin-ServerFromLinkStream-read-12} ServerToLinkStream[null] queryResult GetPublicKeyQuery[RSA,X.509] {id: 1, to:null, from:null} [09-05-05 00:23:05.063] {resin-ServerFromLinkStream-read-12} ServerFromLinkStream[null] querySet AuthQuery[subetha,EncryptedObject] {id:2, to:null, from:null} [09-05-05 00:23:05.073] {resin-ServerFromLinkStream-read-12} HempDomainService[aaa.app-tier.admin.resin] onChildStart(sube...@aaa.app-tier.admin.resin/SEPpKI/) [09-05-05 00:23:05.073] {resin-ServerFromLinkStream-read-12} ServerToLinkStream[null] queryResult authresult[sube...@aaa.app-tier.admin.resin/SEPpKI/] {id: 2, to:null, from:null} [09-05-05 00:23:06.445] {resin-ServerFromLinkStream-read-12} serverfromlinkstream[hempconnectionimpl[sube...@aaa.app-tier.admin.resin/SEPpKI/]] queryGet DeployCommitListQuery[] {id:3, to:dep...@resin.caucho, from:sube...@aaa.app-tier.admin.resin/SEPpKI/} [09-05-05 00:23:06.445] {resin-ServerFromLinkStream-read-12} ServerToLinkStream[null] queryError ActorError[type=cancel,group=service-unavailable,text='dep...@resin.caucho' is an unknown actor for queryGet] DeployCommitListQuery[] {id: 3, to:sube...@aaa.app-tier.admin.resin/SEPpKI/, from:dep...@resin.caucho} Note: The admin user is subetha, not "admin" if the output above seems a bit off ... On Tue, May 5, 2009 at 12:14 AM, Scott Hernandez wrote: > So, I'm trying to get the ant task deployed using the new fangled > stuff; It seems to fail horribly :( > > Here is some of the (pertinent) output from the ant task: > > resin-deploy: > > BUILD FAILED > com.caucho.bam.RemoteConnectionFailedException: Failed to upgrade to HMTP > X > > > at com.caucho.bam.hmtp.HmtpClient.connectImpl(HmtpClient.java:230) > at com.caucho.bam.hmtp.HmtpClient.connect(HmtpClient.java:161) > at com.caucho.server.admin.DeployClient.(DeployClient.java:78) > at com.caucho.ant.ResinDeploy.execute(ResinDeploy.java:145) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > Here is what I am doing in my build file: > > classname="com.caucho.ant.ResinDeploy"> > > > > > > > > > > > port="6800" user="admin" password="admin" /> > > > This is what is going on in the output of resin (not very interesting): > > [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} TcpConnection[id=3,] > starting connection > TcpConnection[id=hmux-127.0.0.1:6800-3,null,ACCEPT], total=5 > [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} Hmux[3] start request > [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} Hmux[3] channel-r 20302 > [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} Hmux[3] N 17731 > [09-05-05 00:03:52.456] {hmux-127.0.0.1:6800-3} Hmux[3] interrupted keepalive > [09-05-05 00:03:52.456] {hmux-127.0.0.1:6800-3} Hmux[3] close stream > [09-05-05 00:03:52.456] {hmux-127.0.0.1:6800-3} Hmux[3] X-w: exit socket > > Any help would be appreciated :) > > Thanks in advance, > Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] ResinDeploy Ant Task Error
So, I'm trying to get the ant task deployed using the new fangled stuff; It seems to fail horribly :( Here is some of the (pertinent) output from the ant task: resin-deploy: BUILD FAILED com.caucho.bam.RemoteConnectionFailedException: Failed to upgrade to HMTP X at com.caucho.bam.hmtp.HmtpClient.connectImpl(HmtpClient.java:230) at com.caucho.bam.hmtp.HmtpClient.connect(HmtpClient.java:161) at com.caucho.server.admin.DeployClient.(DeployClient.java:78) at com.caucho.ant.ResinDeploy.execute(ResinDeploy.java:145) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Here is what I am doing in my build file: This is what is going on in the output of resin (not very interesting): [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} TcpConnection[id=3,] starting connection TcpConnection[id=hmux-127.0.0.1:6800-3,null,ACCEPT], total=5 [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} Hmux[3] start request [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} Hmux[3] channel-r 20302 [09-05-05 00:02:46.941] {hmux-127.0.0.1:6800-3} Hmux[3] N 17731 [09-05-05 00:03:52.456] {hmux-127.0.0.1:6800-3} Hmux[3] interrupted keepalive [09-05-05 00:03:52.456] {hmux-127.0.0.1:6800-3} Hmux[3] close stream [09-05-05 00:03:52.456] {hmux-127.0.0.1:6800-3} Hmux[3] X-w: exit socket Any help would be appreciated :) Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Class-loader problem?
The behaviour has changed, but the problem still exists. It now just says that it can't find a registered bean. However, in walking through the code (at runtime), I can see there are valid beans in the (parent) manager. I'm guessing there is a classloader issue, and that the classes are not equal (even thought they are the same textual name). The bindings on my field (java.util.concurrent.BlockingQueue org.subethamail.core.queue.InjectListener.outboundQueue) are: [...@org.subethamail.core.queue.deliveryqueue()] And there are two Queue(s) in the (parent) manager that look like this: SimpleBean[MemoryQueue, {...@org.subethamail.core.queue.deliveryqueue()}, @Production, name=delivery, @ApplicationScope] SimpleBean[MemoryQueue, {...@org.subethamail.core.queue.injectqueue()}, @Production, name=injection, @ApplicationScope] It sure seems like it should be matching the first one. Any suggestions? On Mon, Apr 13, 2009 at 9:13 AM, Scott Ferguson wrote: > > On Apr 12, 2009, at 6:27 PM, Scott Hernandez wrote: > >> (working against 03/18/09 snapshot of resin) >> >> It seems like there is a class-loader problem in my definition for my >> Queue (and I expect any global bean with an annotation class from the >> webapp). >> >> The first time through everything seems to work just fine, but in >> subsequent updates (webapp reloads) this error comes up. If I l start >> resin up with the app deployed, or deploy the app with it not existing >> yet, then things load fine. But once I have touched the resin-web.xml >> (or made any change causing the webapp to stop-start) of the deployed >> webapp then this error comes up. >> >> WEB-INF/resin-web.xml:24: java.lang.IllegalArgumentException: >> interface resinscratchspace.annotations.UserUpdate is not visible from >> class loader > > This is a regression issue that should be fixed in the next snapshot. > The exception is from the java.util.reflect.Proxy class. > > -- Scott > >> >> >> 22: >> 23: userUpdates >> 24: >> 25: >> 26: >> >> The rssa namespace is set in the resin-xml file as a package in the >> classes directory of the webapp. >> >> Do these annotations need to be in the resin-dir/lib or someplace >> global? >> >> Thanks in advance, >> Scott >> >> >> ___ >> 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
[Resin-interest] (Cluster)SingleSignon bug?
Hi all, The default logon authenticators create an instance of ClusterSingleSignon for use but this causes a problem as every time something is put in cache it is null (the update count is zero on the update query at MnodeStore.java:539). This seems to invalidate "sessions" as every time you come back to get your Principal it is empty. I was able to explicitly change to using the MemorySingleSignon and that fixed the problem (no mnode cache/db/table write problems), but this might be a bug somewhere. Also, where would I configure which single signon instance is used in the configuration for my webapp? Let me know if you need any more info, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] ClusterSingleSignon typo
I found a typo in ClusterSingleSignon in the log instantiation (it uses another class to construct the log; see below). package com.caucho.security; ... public class ClusterSingleSignon implements SingleSignon { private final static Logger log = Logger.getLogger(MemorySingleSignon.class.getName()); Is there a place I should send these, other than the list? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Any chance to support an out ofbox JSR299implementation for GAE?
There is also Guice, and it works on GAE. Just saying... On Wed, Apr 22, 2009 at 10:12 PM, wesley wrote: > Thanks. > > My app is heavily depending on Resin CanDI. > > Hope we'll get an out-of-box Resin CanDI before Gavin King's JSR299 RI 1.0 > final release :) > > - Original Message - > From: "Emil Ong" > To: "General Discussion for the Resin application server" > > Sent: Thursday, April 23, 2009 12:37 PM > Subject: Re: [Resin-interest] Any chance to support an out ofbox > JSR299implementation for GAE? > > >> On Wed, Apr 22, 2009 at 04:31:43PM -0700, Scott Ferguson wrote: >>> Not in GAE because their security manager doesn't allow >>> Thread.setContextClassLoader. We're restricted to using the web-app's >> >> I just got word that they are planning to make >> Thread.setContextClassLoader() available soon, so that may be an option. >> >> Emil >> >>> classloader. I'm pretty sure we can create child classloaders (for >>> proxy/enhancement), but I haven't checked yet. >>> >>> -- Scott >>> >>> >>> > >>> > >>> > -Wesley >>> > >>> > >>> > - Original Message - >>> > From: Scott Ferguson >>> > To: General Discussion for the Resin application server >>> > Sent: Thursday, April 16, 2009 2:47 AM >>> > Subject: Re: [Resin-interest] Any chance to support an out of box >>> > JSR299implementation for GAE? >>> > >>> > >>> > >>> > >>> > On Apr 15, 2009, at 10:20 AM, wesley wrote: >>> > >>> > >>> > Hi there, >>> > >>> > I wonder if Resin could distribute a library to support an out of >>> > box >>> > JSR299 implementation for Google App Engine. >>> > We know Resin can't run on GAE now, but I think Resin's >>> > implementation >>> > of CanDI may be run on GAE. >>> > Is there any plan for this? >>> > >>> > >>> > Hmm. That's an interesting thought. Resin's CanDI is in resin- >>> > kernel.jar >>> > and doesn't depend on Resin itself, with the important exception of >>> > the >>> > Request and Session scopes. >>> > >>> > >>> > Some of the Interception features wouldn't be available because of the >>> > current Google limitations on file writing (and probably missing >>> > javac), >>> > because Resin generates Java code instead of writing bytecode >>> > directly. >>> > >>> > >>> > There would be a few changes needed because Resin CanDI does expect >>> > Resin >>> > classloaders, but I think that would be straightforward to change. >>> > >>> > >>> > -- Scott >>> > >>> > >>> > >>> > regards >>> > -Wesley >>> > ___ >>> > 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 >>> >>> >>> >>> ___ >>> resin-interest mailing list >>> resin-interest@caucho.com >>> http://maillist.caucho.com/mailman/listinfo/resin-interest >> >> >> Emil Ong >> Chief Evangelist >> Caucho Technology, Inc. >> Tel. (858) 456-0300 >> mailto:e...@caucho.com >> http://blog.caucho.com/ >> >> Caucho: Reliable Open Source >> --> Resin: application server >> --> Quercus: PHP in Java >> --> Java CanDI: contexts and dependency injection >> >> >> ___ >> 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] Eclipse Plugin
I'm confused. What does this have to do with the resin (app-server) plugin? Doesn't the WST/Eclipse framework for web projects take care of building (and deploying) everything? It seems like if you want to use ant/maven/xBuildTool you can do that outside eclipse, or use one of the existing plugins that work with eclipse, and WST. Oh, and I def. prefer ant, just to put my two cents in on that front. On Fri, Apr 17, 2009 at 9:06 AM, Jeff Schnitzer wrote: > Oh no... I hate this discussion. Let's just say that there are plenty > of people on both sides of the fence. I have a fair amount of > experience with Maven on big complicated projects and loathe it > intensely. > > This thread is worth reading, you can search for my name to see my > long-winded comment: > > http://tapestryjava.blogspot.com/2007/11/maven-wont-get-fooled-again.html > > I'd rather see an ant build. For all its flaws, it's still the better > Java build tool. I'd probably be willing to write and contribute a > buildfile if the Powers That Be are interested. > > Jeff > > On Fri, Apr 17, 2009 at 8:41 AM, Emil Ong wrote: >> On Fri, Apr 17, 2009 at 03:56:43PM +0100, Stargazer wrote: >>> Maven, maven maven >> >> Could you explain? >> >> Thanks, >> Emil >> >>> > Thanks, >>> > Emil >>> > >>> > On Mon, Apr 13, 2009 at 12:20:46PM -0500, Aaron Freeman wrote: >>> > >>> >> Emil, >>> >> >>> >> What does the plug-in provide to us that setting up as a general >>> >> application doesn't? I haven't tried the plug-in so I am not aware of >>> >> what it does? >>> >> >>> >> Thanks, >>> >> >>> >> Aaron >>> >> >>> >>> Hi Scott, >>> >>> >>> >>> The Eclipse update site isn't up just yet, but will be with the new >>> >>> release, due out this week or early next. >>> >>> >>> >>> Emil >>> >>> >>> >>> On Sun, Apr 12, 2009 at 09:42:24PM -0700, Scott Hernandez wrote: >>> >>> >>> >>> >>> >>>> I noticed there is an eclipse plugin in the svn tree >>> >>>> (artifacts/eclipse) that has seen some recent checkins. The build >>> >>>> instructions seem pretty straight forward and end with directions to >>> >>>> post the update-site at http://caucho.com/eclipse. When I point the >>> >>>> eclipse updates to that address there is nothing. Is this something I >>> >>>> can build from source? Will it be hosted there sometime soon? Is the >>> >>>> plugin in usable form? >>> >>>> >>> >>>> Oh, and what do people use for an IDE btw? >>> >>>> >>> >>>> Thanks in advance, >>> >>>> Scott >>> >>>> >>> >>>> >>> >>>> ___ >>> >>>> resin-interest mailing list >>> >>>> resin-interest@caucho.com >>> >>>> http://maillist.caucho.com/mailman/listinfo/resin-interest >>> >>>> >>> >>>> >>> >>> >>> >>> >>> >>> Emil Ong >>> >>> Chief Evangelist >>> >>> Caucho Technology, Inc. >>> >>> Tel. (858) 456-0300 >>> >>> mailto:e...@caucho.com >>> >>> http://blog.caucho.com/ >>> >>> >>> >>> Caucho: Reliable Open Source >>> >>> --> Resin: application server >>> >>> --> Quercus: PHP in Java >>> >>> --> Java CanDI: contexts and dependency injection >>> >>> >>> >>> >>> >>> ___ >>> >>> 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/ma
Re: [Resin-interest] Working from svn (Resin 4)
Okay, I will endeaver to work against the snapshots. Are the snapshots "regression" free then? On Mon, Apr 13, 2009 at 2:56 PM, Scott Ferguson wrote: > > On Apr 13, 2009, at 10:50 AM, Scott Hernandez wrote: > >> To Caucho Devs, >> >> In an effort to get some of my problems diagnosed from the old >> snapshot I was using(3/18) I delved into the svn trunk. It seems like >> the snapshots (although listed as 03/04/09 in the download page) are >> actually nightly snapshots. This leads me to believe that going >> straight to trunk might be the best idea. Well, maybe it wasn't. > > Generally, the svn trunk is not a good idea, because we often make > fairly large changes that take several days to clean the regressions. [snip] ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Namespace files (in META-INF)
Is there a way in the jsr299 way of things to include namespaces in your package to shorten the need for explicitly listing them in the web/web-resin/beans.xml files? For example, if I want to use X (10) ns prefixes in web-resin.xml do I have to include them explicitly? http://caucho.com/ns/resin"; xmlns:r="urn:java:com.caucho.resin" xmlns:rcfg="urn:java:com.caucho.config" xmlns:jms="urn:java:com.caucho.jms" xmlns:ejb="urn:java:com.caucho.ejb" xmlns:adm="urn:java:org.subethamail.core.admin" xmlns:util="urn:java:org.subethamail.core.util" xmlns:sec="urn:java:org.subethamail.web.security" xmlns:queue="urn:java:org.subethamail.core.queue" > ... Thanks, Scott On Mon, Apr 13, 2009 at 1:19 PM, Scott Ferguson wrote: > > On Apr 13, 2009, at 1:14 PM, Scott Hernandez wrote: > >> Hi all, >> >> I was looking through the source of resin and noticed the namespace >> files in META-INF/caucho. Is there a place to read up on the >> placement, and format of these files? > > These are essentially obsolete. Although Resin has been using an IoC/ > DI style for its configuration since 3.0, there wasn't a standard to > follow, so we needed to invent our own extension capabilities. > > Going forward, JSR-299 should be the way to go, and the META-INF/ > caucho should be treated as backward-compatibility configuration. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Namespace files (in META-INF)
Hi all, I was looking through the source of resin and noticed the namespace files in META-INF/caucho. Is there a place to read up on the placement, and format of these files? I would guess, without seeing it described other than in the resin module, that it goes something like this: The class loader looks for any *.namespace files and loads them. Then those defined namespaces can be used anywhere there is an xml def for JSR299 beans. Is this right? Thanks in advance Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Working from svn (Resin 4)
To Caucho Devs, In an effort to get some of my problems diagnosed from the old snapshot I was using(3/18) I delved into the svn trunk. It seems like the snapshots (although listed as 03/04/09 in the download page) are actually nightly snapshots. This leads me to believe that going straight to trunk might be the best idea. Well, maybe it wasn't. Is it a good idea to work from svn trunk? I know that depends on how close to the edge you want to be but what is your philosophy of the state of trunk on each checkin? Is it considered "working" at all times? Should I expect things to be broken most of the time until a blessed build comes out? I noticed that the "Named" annotations no longer works in my queue def. against trunk. I'm not sure if this is a design decision (and will be updated with changes to come; including docs), or a bug. I don't want to cause any more confusion, or problems but I'm excited about getting things working and I keep running into issue that may be within resin, or at least with my understanding. I want to work as close to the front-lines as I can while still being a little safe. I'm happy to make tests for all the things I need in my applications so that I can run automated tests and stop asking questions which might better be answered with source. Is there a test framework for resin that I can hook into? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Eclipse Plugin
Hi all, Looking at the source (and trying it out from my own build) it seems like it integrates into eclipse's wst tools. This means you can build a "dynamic web" application and "resin X.x" (3.x/4.0 hot deploy/in-place) runtime (in eclipse) that can be deployed/run/debug/profiles within eclipse. The resin runtime objects (using wst and the eclipse framework) mean that you don't need to setup "launch/debug/etc" configurations using general java app settings (like class/classpath/jvmargs) and can just use the ones defined for resin X.x. Oh, and I think this also means you can target one of these runtimes without having to manually setup the libs/deps. I'm not sure if there is much more in there; that is all I saw when playing with it. There were no project or class helpers that I saw, but that would be nice too. Being able to create resin "Resin Project","Resource", "Persistence (JPA)", "Entity", "Service", "Queue", and so on would be great. Also, having completion and validation help with the resin.xml/resin-web.xml/beans.xml files would be great. It nice to know when you have a configuration/code errors before you try to deploy. On Mon, Apr 13, 2009 at 10:20 AM, Aaron Freeman wrote: > Emil, > > What does the plug-in provide to us that setting up as a general > application doesn't? I haven't tried the plug-in so I am not aware of > what it does? > > Thanks, > > Aaron >> Hi Scott, >> >> The Eclipse update site isn't up just yet, but will be with the new >> release, due out this week or early next. >> >> Emil >> >> On Sun, Apr 12, 2009 at 09:42:24PM -0700, Scott Hernandez wrote: >> >>> I noticed there is an eclipse plugin in the svn tree >>> (artifacts/eclipse) that has seen some recent checkins. The build >>> instructions seem pretty straight forward and end with directions to >>> post the update-site at http://caucho.com/eclipse. When I point the >>> eclipse updates to that address there is nothing. Is this something I >>> can build from source? Will it be hosted there sometime soon? Is the >>> plugin in usable form? >>> >>> Oh, and what do people use for an IDE btw? >>> >>> Thanks in advance, >>> Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Eclipse Plugin
I noticed there is an eclipse plugin in the svn tree (artifacts/eclipse) that has seen some recent checkins. The build instructions seem pretty straight forward and end with directions to post the update-site at http://caucho.com/eclipse. When I point the eclipse updates to that address there is nothing. Is this something I can build from source? Will it be hosted there sometime soon? Is the plugin in usable form? Oh, and what do people use for an IDE btw? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Class-loader problem?
(working against 03/18/09 snapshot of resin) It seems like there is a class-loader problem in my definition for my Queue (and I expect any global bean with an annotation class from the webapp). The first time through everything seems to work just fine, but in subsequent updates (webapp reloads) this error comes up. If I l start resin up with the app deployed, or deploy the app with it not existing yet, then things load fine. But once I have touched the resin-web.xml (or made any change causing the webapp to stop-start) of the deployed webapp then this error comes up. WEB-INF/resin-web.xml:24: java.lang.IllegalArgumentException: interface resinscratchspace.annotations.UserUpdate is not visible from class loader 22: 23: userUpdates 24: 25: 26: The rssa namespace is set in the resin-xml file as a package in the classes directory of the webapp. Do these annotations need to be in the resin-dir/lib or someplace global? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4
Yeah, I tracked it down the the start method of EnvironmentClassLoader. When walking through the EnvironmentListener[] list the webbeans (and @ApplicationScope @Service) are init'd before the EJB system. The EntityManagerFactory exists in the AmberContainer but it is still in the _pendingFactory list (and not in the wbManager it seems) until the startPersistenceUnits method is called for AmberContainer. The list of listeners is in this order: InjectManager OsgiLoader InjectManager (osgi) DBPoolImpl EjbContainer AmberContainer WeakStopListener (@Stateless EJB instance) Basically the @Service @PostConstruct is called during the first InjectManager, and the Amber/Ejb Container isn't good till much later (at the end). Well, that is what it seems to be. I think I should be able to find a workaround since it seems that there are events that fire after all this that I can hook into. Not the most elegant way, but should work for now (I can take care of re-initialization in case it changes behavior). I don't know enough about the internals of resin to know if this a problem, or fixable, but if I can help let me know :) On Tue, Mar 31, 2009 at 3:25 PM, Scott Ferguson wrote: > On Mar 31, 2009, at 12:51 PM, Scott Hernandez wrote: > I've added a bug report for this at http://bugs.caucho.com/view.php?id=3429 > > I didn't quite understand the situation. The environment might not be > properly setup at the @PostConstruct time for some reason. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4
Let me try this again from the beginning... I want to have services (that start with the application, and runs the length of the application lifetime) so I define a POJO with a @Service and a method with a @PostConstruct. Everything is going well so far. I define a persistenceunit in persistence.xml and corresponding jdbc info in the (resin-)web.xml config. So my service looks like this: @Service public class InitDBService { @PersistenceContext protected EntityManager em; @PersistenceUnit protected EntityManagerFactory emf; @PostConstruct public void postConstruct() { log.log(Level.INFO, "emf=" + emf + " em=" + em); if (emptyDB()) insertDefaultData(); } } > emf=AmberEntityManagerFactory[amber] em=EntityManagerProxy[amber] So I load up my webapp and away it goes. If I use amber (the native JPA impl) everything looks fine and the entity manager, and factory is injected as expected, and the data is queried (and inserted if empty). Now, if I switch to a hibernate backed persistenceunit (hbm) I get some kind of exception no matter how I do it. > emf=null em=EntityManagerTransactionProxy[hbm,null] I have tried using @TransactionAttributes, the UserTransaction object, and various other attempts without any success on the hibernate persistenceunit. Now, later in my code, in a servlet, I have the same code and it runs fine against the @PersistenceContext using the hibernate persistenceunit. I hope this makes a bit more sense and maybe someone can point me in the right direction to get this working :) Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4
Let me try this again from the beginning... I want to have services (that start with the application, and runs the length of the application lifetime) so I define a POJO with a @Service and a method with a @PostConstruct. Everything is going well so far. I define a persistenceunit in persistence.xml and corresponding jdbc info in the (resin-)web.xml config. So my service looks like this: @Service public class InitDBService { @PersistenceContext protected EntityManager em; @PersistenceUnit protected EntityManagerFactory emf; @PostConstruct public void postConstruct() { log.log(Level.INFO, "emf=" + emf + " em=" + em); if (emptyDB()) insertDefaultData(); } } > emf=AmberEntityManagerFactory[amber] em=EntityManagerProxy[amber] So I load up my webapp and away it goes. If I use amber (the native JPA impl) everything looks fine and the entity manager, and factory is injected as expected, and the data is queried (and inserted if empty). Now, if I switch to a hibernate backed persistenceunit (hbm) I get some kind of exception no matter how I do it. > emf=null em=EntityManagerTransactionProxy[hbm,null] I have tried using @TransactionAttributes, the UserTransaction object, and various other attempts without any success on the hibernate persistenceunit. Now, later in my code, in a servlet, I have the same code and it runs fine against the @PersistenceContext using the hibernate persistenceunit. I hope this makes a bit more sense and maybe someone can point me in the right direction to get this working :) Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Amber (JPA) Table Indexes
Hibernate lets you add a @Index to entities/tables for this. http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#d0e2305 Since JPA is creating, and maintaining the schema it is nice to keep that config all in one place. I would say that for serious tuning you may need to do this at the database level, but for simple things like indexes, constraints, and data validation much of this should be provided at the persistence definition level, and in the application definition (and applied where possible to the database). On Mon, Mar 30, 2009 at 11:19 PM, Daniel López wrote: > Isn't that something one would do at the database level? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4
Well, I have configured a test app to use hibernate and I have a few problems (and a bit of success): I was able to get the same code working from a servlet, but when trying to get data I get an exception when running from a @Service (in the @PostConstruct method): [21:26:06.430] {main} java.lang.IllegalStateException: EntityManagerTransactionProxy[test,null]: @PersistenceContext EntityManager may not be used outside of a transaction [21:26:06.430] {main} at com.caucho.amber.manager.EntityManagerTransactionProxy.getCurrent(EntityManagerTransactionProxy.java:408) [21:26:06.430] {main} at com.caucho.amber.manager.EntityManagerTransactionProxy.createQuery(EntityManagerTransactionProxy.java:193) [21:26:06.430] {main} at test2.services.InitDBService.checkDBandInit(InitDBService.java:47) [21:26:06.430] {main} at test2.services.InitDBService.postConstruct(InitDBService.java:36) [21:26:06.430] {main} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [21:26:06.430] {main} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [21:26:06.430] {main} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [21:26:06.430] {main} at java.lang.reflect.Method.invoke(Method.java:597) [21:26:06.430] {main} at com.caucho.config.j2ee.PostConstructProgram.inject(PostConstructProgram.java:121) [21:26:06.430] {main} at com.caucho.config.inject.ComponentImpl.init(ComponentImpl.java:344) [21:26:06.430] {main} at com.caucho.config.inject.SimpleBean.create(SimpleBean.java:421) [21:26:06.430] {main} at com.caucho.config.scope.ScopeContext.get(ScopeContext.java:90) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.getInstanceRec(InjectManager.java:1331) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.getInstance(InjectManager.java:1288) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.getInstance(InjectManager.java:1345) [21:26:06.430] {main} at com.caucho.server.webbeans.ResinWebBeansProducer.serviceStartup(ResinWebBeansProducer.java:167) [21:26:06.430] {main} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [21:26:06.430] {main} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [21:26:06.430] {main} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [21:26:06.430] {main} at java.lang.reflect.Method.invoke(Method.java:597) [21:26:06.430] {main} at com.caucho.config.event.ObserverImpl.notify(ObserverImpl.java:191) [21:26:06.430] {main} at com.caucho.config.inject.ObserverMap.fireEvent(ObserverMap.java:82) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.fireEventImpl(InjectManager.java:1559) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.fireEventImpl(InjectManager.java:1540) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.fireEventImpl(InjectManager.java:1540) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.fireEventImpl(InjectManager.java:1540) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.fireEventImpl(InjectManager.java:1540) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.fireEvent(InjectManager.java:1534) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.registerBean(InjectManager.java:2066) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.registerBean(InjectManager.java:2044) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.registerBean(InjectManager.java:2047) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.startServices(InjectManager.java:2013) [21:26:06.430] {main} at com.caucho.config.inject.InjectManager.environmentStart(InjectManager.java:1993) [21:26:06.430] {main} at com.caucho.loader.EnvironmentClassLoader.start(EnvironmentClassLoader.java:703) [21:26:06.430] {main} at com.caucho.server.webapp.WebApp.start(WebApp.java:2021) [21:26:06.430] {main} at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:678) [21:26:06.430] {main} at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) [21:26:06.430] {main} at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) [21:26:06.430] {main} at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) [21:26:06.430] {main} at com.caucho.server.webapp.WebAppContainer.startImpl(WebAppContainer.java:681) [21:26:06.430] {main} at com.caucho.server.host.Host.startImpl(Host.java:496) [21:26:06.430] {main} at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:661) [21:26:06.430] {main} at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:678) [21:26:06.430] {main} at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) [21:26:06.430] {main}
[Resin-interest] Amber (JPA) Table Indexes
Is there a way to hint to Amber that a column should be indexed? For example we will be doing a lot of queries like this: "Select u from User where u.isActive == true ..." And it would be nice if the isActive column is indexed. Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] MBean Registration
Is there an annotation based way to register Management Beans? I know I can do this in XML, but is there an annotation, or interface that will work the same way? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4
No problem, I should have something to report in a few hours. Also, is there a way to annotate the persistence units (for EntityManager injection) like there was for the JMS stuff? Since the persistence stuff is in persistence.xml, will it too become a bean config driven system? for example, let us say that I want two persistence units. java:jdbc/test1 org.hibernate.ejb.HibernatePersistence java:/jdbc/test ... But I get this error (of course) since I can't distinguish between the two without annotating them (or maybe I could write a @Producer?). Can't find a component for 'javax.persistence.EntityManager' because no enabled beans match the bindings [...@javax.inject.current(), @com.caucho.config.Name(value=test)] . Enabled beans: SingletonBean[EntityManagerProxy, {...@name('test1'), @javax.inject.Current()}, @Production, name=test1] PersistenceContextComponent[EntityManager, {...@javax.inject.current()}, @Production, name=test] On Wed, Mar 25, 2009 at 2:08 PM, Scott Ferguson wrote: [snip] >> Are there any additional issues I should worry about? > > Well, we haven't gotten to the compatibility testing yet for Resin 4, > and the Config/DI rewrite might have messed up the Hibernate > integration. > > In other words, it should work, but if it doesn't we'll need to file a > bug report on Resin 4. [snip] ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Using Hibernate as EntityManager in Resin 4
It is always the moment after you send the email that you find the answer: http://wiki.caucho.com/Hibernate I will try that method. Are there any additional issues I should worry about? Sorry for the spam, Scott On Wed, Mar 25, 2009 at 1:47 PM, Scott Hernandez wrote: > I'd like to replace Amber with Hibernate. We are migrating an app from > JBoss (Hibernate EntityManager) and there are lots of Hibernate > annotations used for validation, and to hint for database > optimizations. In the first pass getting things going we would like to > just drop in (as best as we can) the current entities and be able to > let Hibernate manage them as before. Later we may cut back on > Hibernate, and use Amber (but so far it seems to lack some of the > features in Hibernate). > > Is there a way to replace Amber with Hibernate? > ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Using Hibernate as EntityManager in Resin 4
I'd like to replace Amber with Hibernate. We are migrating an app from JBoss (Hibernate EntityManager) and there are lots of Hibernate annotations used for validation, and to hint for database optimizations. In the first pass getting things going we would like to just drop in (as best as we can) the current entities and be able to let Hibernate manage them as before. Later we may cut back on Hibernate, and use Amber (but so far it seems to lack some of the features in Hibernate). Is there a way to replace Amber with Hibernate? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Log @Producer
I was going to implement a few helper @Producers and I seem to have made a mistake somewhere along the way: RandomClass.java: @New private Logger log; public class LogProducer { @Produces Logger createLogger(InjectionPoint injectionPoint) { return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); } } And I get this error: com.caucho.config.ConfigException: resinscratchspace.util.LogProducer.createLogger(): Type 'InjectionPoint' for method parameter #0 has no matching component. Anyone have any ideas what that might be? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Resin 4: JMS Queue Injection
Okay, got it. I will give it a try. Also, this means I can annotate beans with @Production/@Mock in the xml also, right? I have a feeling my xmlns declarations section (in resin-web.xml) is going to be very long. ;( Maybe I missed it but was there a section in jsr299 dealing with annotations of beans in xml, or is this resin specific? Thanks, Scott On Tue, Mar 24, 2009 at 9:50 AM, Scott Ferguson wrote: > > On Mar 23, 2009, at 12:46 PM, Scott Hernandez wrote: > >> >> And everything is fine, but if I add another Queue (in resin-web.xml) >> then I get a problem as I have more than one Queue and it is not >> unique for injection. Now, in the examples it shows using >> @Named("QueueName") but that annotation cannot be applied to a field >> as the example seems to indicate. >> >> @Named("userUpdates") >> private BlockingQueue userUpdateQueue; >> >> How do I differentiate between the queues in my injection annotations? > > The docs are a bit out of date, because the Java Injection spec has > changed a bit from the earlier draft. "@Named" is now _only_ for EL > naming, not for binding. > > In this case, you're supposed to create your own @BindingType > annotation, @UserUpdates. So you inject it like: > > @UserUpdates > private BlockingQueue userUpdateQueue; > > And you configure it like: > > > userUpdates > > > > (I'd put the xmlns:mypkg at the top in a real config file.) > > Creating the annotation is a little bit of extra work but has the > following advantages: > > 1. it's "type safe", i.e. the compiler (and Java Injection) can > verify the @UserUpdates is a valid @BindingType annotation, e.g. > saving you from typos. > 2. it's documented by JavaDoc, so you can explain the purpose of > the @UserUpdates > 3. it fits into IDEs, because IDEs have access to the annotation > and to the xmlns of your configuration > 4. it gives you a chance to think carefully about the organization > of your components, in this case to double check that "UserUpdates" is > a logical and self-documenting description of the queue you're using. > > The UserUpdates annotation is defined like: > > package com.me.mypkg; > > import static java.lang.annotation.ElementType.*; > import static java.lang.annotation.RetentionPolicy.*; > import java.lang.annotation.Retention; > import java.lang.annotation.Target; > > import javax.inject.BindingType; > > @BindingType > @Target({TYPE,FIELD,METHOD,PARAMETER}) > @Retention(RUNTIME) > public @interface UserUpdates { > } > > (Resin does have a com.caucho.config.Name for generic things like > databases, but that kind of general annotation is discouraged.) > > -- Scott >> >> >> Thanks in advance, >> Scott >> >> >> ___ >> 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
[Resin-interest] Resin 4: JMS Queue Injection
I'm developing a sample to test a few things and I have a simple question about injecting a Queue by name. I have a bit of xml in my resin-web.xml config like this: userUpdates #{userUpdates} And my code is this: @Current private BlockingQueue userUpdateQueue; And everything is fine, but if I add another Queue (in resin-web.xml) then I get a problem as I have more than one Queue and it is not unique for injection. Now, in the examples it shows using @Named("QueueName") but that annotation cannot be applied to a field as the example seems to indicate. @Named("userUpdates") private BlockingQueue userUpdateQueue; How do I differentiate between the queues in my injection annotations? Thanks in advance, Scott ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest