Hi Endre, thanks for your quick reply.
About your first recommendation, I do not have to work with any legacy 
code. So, If I am not supossed to use an appserver, what am I supossed to 
do?
Abour your second recommendation. I create the actor system and also the 
actors inside a servlet, but I do it only one time, like this:

        ServletContext application = 
request.getSession().getServletContext();

        ActorSystem actorSystem = null;

        if (application.getAttribute("auctionSystem") == null)
        {
            //Create the actor system
            actorSystem = ActorSystem.create("auctionSystem");
            application.setAttribute("auctionSystem", actorSystem);
        } else
        {
            actorSystem = (ActorSystem) 
application.getAttribute("auctionSystem");
        }

So, it will be created only once, doesn't it?

About your third recommendation. Why am I not supossed to use akka inside a 
servlet. I use the servlet only to get an actor reference and then to send 
a message to the actor I want, is it a wrong approach? and what do you mean 
by standalone application with akka?

Cheers,




On Wednesday, June 18, 2014 9:39:38 PM UTC+10, Akka Team wrote:
>
> Hi Felipe,
>
>
>>    - Akka 2.3.2 (How can I deploy it on glassfish?) 
>>    
>>
> Akka does not support deploying to application servers, although it is 
> possible to make it work. Unless you have to work with legacy code I would 
> completely avoid going through an appserver completely.
>  
>
>>
>> [2014-06-18T06:30:50.261+0000] [glassfish 4.0] [INFO] [] [] [tid: 
>> _ThreadID=224 _ThreadName=Thread-3] [timeMillis: 1403073050261] 
>> [levelValue: 800] [[
>>   [ERROR] [06/18/2014 06:30:50.245] [http-listener-1(4)] [Remoting] 
>> Remoting error: [Startup failed] 
>> akka.remote.RemoteTransportException: Startup failed
>> at 
>> akka.remote.Remoting.akka$remote$Remoting$$notifyError(Remoting.scala:128)
>>  at akka.remote.Remoting.start(Remoting.scala:193)
>> at 
>> akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:184)
>>  at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:617)
>> at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:615)
>>  at akka.actor.ActorSystemImpl._start(ActorSystem.scala:615)
>> at akka.actor.ActorSystemImpl.start(ActorSystem.scala:632)
>>  at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
>> at akka.actor.ActorSystem$.apply(ActorSystem.scala:108)
>>  at akka.actor.ActorSystem$.create(ActorSystem.scala:56)
>> at akka.actor.ActorSystem.create(ActorSystem.scala)
>> at 
>> Control.servletForwarderUserRegFirstStep.doPost(servletForwarderUserRegFirstStep.java:39)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>>
>
> Looking at the snippet above it seems that you try to create the 
> ActorSystem from a servlet, especially from it service method. That will 
> try to create a new ActorSystem every time a request is serviced, so it 
> will fail to bind to the same address.
>
> So first of all, you should only create one ActorSystem in your 
> application and use that all the time instead of creating a new one every 
> time. Second, you should not use Akka from servlets, you can just build 
> standalone applications with Akka.
>
> -Endre 
>
>  -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
>  

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to