Re: [Resin-interest] @WebServlet and Hessian

2014-03-10 Thread Alex Rojkov

 Well, I added @WebServlet to my Hessian servlet implementation, and making a 
 GET request results in the expected Hessian Requires POST response. But 
 when my client accesses it properly, the response is empty, and there's no 
 evidence that my actual implementation is being called.
 Is it possible to use @WebServlet on something that inherits from HttpServlet?
 

That should be possible. I just tested with the following:

package qa;

import java.io.*;
import javax.servlet.annotation.*;
import com.caucho.hessian.server.*;

@WebServlet(webservlet)
public class MyBean extends HessianServlet {
  public String hit(InputStream is)
throws IOException
  {
StringBuilder sb = new StringBuilder();
int ch;

sb.append([);
while ((ch = is.read()) = 0) {
  sb.append((char) ch);
}
sb.append(]);

return sb.toString();
  }
}

Have you tried with the finer the logging level?

Alex


 -- 
 Rick
 
 
 
 ___
 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] Registering my CanDI producer with InjectionManager?

2014-03-10 Thread Alex Rojkov
 I'm trying to create a factory to let me @Inject Loggers as shown here:
 
   
 http://docs.jboss.org/cdi/api/1.0/javax/enterprise/inject/spi/InjectionPoint.html
 
 But I get:
 
 [14-03-08 23:59:23.129] WARNING com.caucho.server.webapp.WebApp 
 setConfigException: javax.enterprise.inject.UnsatisfiedResolutionException: 
 Can't find a bean for 'class org.apache.log4j.Logger' because no beans 
 implementing that class have been registered with the injection manager 
 InjectManager[singleton:null#UsageMapServer].
  at 
 com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:2471)
  at 
 com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:2656)
  at 
 com.caucho.config.inject.InjectManager.getReferenceFactory(InjectManager.java:2614)
  at 
 com.caucho.config.inject.InjectManager.getReferenceFactory(InjectManager.java:2593)
 
 
 Here's my code (first class needs the injection, second class is the factory):

That should work, please check if there are any compile exceptions for the 
Producer. I verified the pattern with java.util.logging.*


 
   http://pastebin.com/nHiGZyzf
 
 One additional question: when this works, how many LoggerFactory instances 
 can I expect? Is it a singleton? Can I use its constructor or static init to 
 initialize Log4J?

With an @ApplicaitonScoped producer there should be one instance for a Proxy 
class and one for an actual Producer.

Thanks,
Alex

 
 Thanks!
 
 -- 
 Rick
 
 
 
 ___
 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