by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tim Wagner
    @wagnert
    Hm, depends on the error level you defined in your META-INF/context.xml file. If you've set <param name="logLevel" type="string">info</param> ->info() should be enough
    jefkin
    @jefkin
    I'm going to upgrade to error to make sure that the response flow is parsimonious
    [2019-05-15 17:19:47] - host.com (error): Vendor\Project\BaseServlet::doGetDOPPELGAENGEROriginal []
    [2019-05-15 17:19:47] - host.com (error): Vendor\Project\BaseServlet::responderDOPPELGAENGEROriginal []
    [2019-05-15 17:19:47] - host.com (info): Vendor\Project\AbstractProcessor::postConstructDOPPELGAENGEROriginal has successfully been invoked by @PostConstruct annotation []
    [2019-05-15 17:19:47] - host.com (error): JWB Ping::initialize() []
    but the run method is not invoked or at least not logged.
    jefkin
    @jefkin
    I've checked the system error log, and the php error log and the app error logs, no errors but also no connection beyond the init.
    jefkin
    @jefkin
    I'm really at a loss at this point, I'm saving my work at this point on a stub branch and moving back to the simple one servlet version I had originally
    Tim Wagner
    @wagnert
    Hm, can you give me access to the repo?
    jefkin
    @jefkin
    well, I'll have to check with the boss probably some NDA's might be needed, etc. but I'm in get'er'done mode so I'm thinking it's probably best to shelve this for now.
    Tim Wagner
    @wagnert
    I'm sure that this is only a small thing to fix, but it's quite hard to fix it here ... :(
    maybe it'll be enough if you can ZIP the WEB-INF folder with the servlets ...
    jefkin
    @jefkin
    I can do that and revise the sensitive stuff, is there an email I can send it to?
    Tim Wagner
    @wagnert
    yes, sent it to tw@appserver.io :-)
    jefkin
    @jefkin
    I'm now pretty sure the issue isn't on the WEB-INF side, because I'm fully rolled back to single servlet class, and when I invoke on the dependency injected Service, i see the init called, but I do not see my specified function called, even when hard-coded like: $this->ping->run($this->args, $this->dates); ... it seems, regardless of how I call it, the service object's init () runs, but not the service action e.g. run() ... I did notice that the example apps have servlet side and service side in different namespaces, reworked my code that way, and still get the init to fire but not the direct function I'm calling
    Tim Wagner
    @wagnert
    @jefkin I've sent you some emails, i think there may be an issue with the classname Ping, so please try rename it to PingService for example ..
    jefkin
    @jefkin
    I'll give that a try, though I tried Ping2 which didn't seem to resolve the issue, but I'll let you know
    Tim Wagner
    @wagnert
    Ok, otherwise have a look at the mails i sent you :-)
    jefkin
    @jefkin

    So I want to use dependency injection in the servlet for a class that lives in the common directory of my app, I tried doing:
    /**

     *  The HTML Writer for logs.
     *
     *  @var Vendor\Project\Utilities\HtmlWriter;
     *  @EnterpriseBean(name="HtmlWriter") 
     */
    protected   $htmlWriter;

    which compiles ok, but on execution of the servelet we get a fatal error in the application error log that says:

    [2019-05-16 19:22:18] - host.com (error): PHP Exception: exception 'Exception' with message 'Requested value php:global/combined-appserver/sapwebremote/HtmlWriter has not been bound to naming directory php:' in /opt/appserver/src/AppserverIo/Appserver/Naming/NamingDirectory.php:213
    so is there a way on the WEB-INF side to name a dependancy injection similar to how we do with epb.xml on the service side?
    Tim Wagner
    @wagnert
    Hi, depends on the appserver version you use?
    jefkin
    @jefkin
    hmm like I said the other day, currently we're on 1.1.4 I think, same as the webpage announces as stable :(
    Tim Wagner
    @wagnert
    Huuh, https://github.com/appserver-io/appserver/releases ... we're actually at version 1.1.20. Thing is, that we're actually have Docker releases only, so we strongly recommend to switch to the latest version ...
    That's why i asked you yesterday in my email which version you are on ... we've refactorings an many bugfixes :-(
    jefkin
    @jefkin
    yeah saddly my sys admin team is not hugely flexible with this, I'll make a request for them to update.
    Tim Wagner
    @wagnert
    We actually have customers who also needs a new Debian version, so i'll create a new Debian Runtime + Container in the next weeks, so probably you can use the Docker for local development purposes only and wait for deploying on your server until we've released a new Debian package, what do you think?
    jefkin
    @jefkin
    I know what docker is, but I've never used it before, and my sys admin team maybe could install a docker setup we can use, over the short term, but I'm not holding my breath for it :-/ ... I'll bring it up tomorrow at the status meeting.
    Tim Wagner
    @wagnert
    Sound’s good. If have any further questions, contact me please 🙂
    jefkin
    @jefkin
    So here's a question maybe out of left field (from my team), I did a little digging but wasn't able to answer is there a way to restart only a single app in the appserver.io pantheon, without affecting others? or is it all for one and one for all -type of thing?
    Tim Wagner
    @wagnert
    Hi, apps are running within a single thread, so in general it would be possible to implement a function to restart a single application only, but didn't have it yes :-( So you've to restart the whole application server to reload the application :-(
    jefkin
    @jefkin
    That may become important to us in the future. And I think I may have sniffed out the problem we were having with communication between the Servlet and Service,
    Tim Wagner
    @wagnert
    It'll be very nice to have that feature but its quite a bit complicated to implement it :-( Ok, so what's the reason?
    jefkin
    @jefkin
    It's very much still in the idea stage, but there are several things we're doing to support our work that are done with standalone servers/services, that could probably all be migrated to live under the appserver.io, however, several of these are dependent on one another, and single service updates without impacting the others would be a pretty easy sell, whereas "oh and we have to restart all of our services at the same time" is not so easy.
    Tim Wagner
    @wagnert
    Hm, i understand that, but you've plans to let all those standalone services run as applications in one appserver.io instance? Maybe it'll be a good idea to start each in a separate appserver.io instance ...
    jefkin
    @jefkin
    Ah, well that would be fine too, however, the impression I got from the sys admin team was "one appserver.io to rule them all" ... :-/ not sure, but that may be a failure in understanding how to set up parallel appserver.io instances, would be nice if I could point them to the docs or a blog that showed how to get that done :)
    to extend that thought; service appserver restart is pretty monolithic :)
    Tim Wagner
    @wagnert
    There are several options, but depending on your requirements this can be the better one. We call it appserver-runner and it only starts one application. I'll extend the documentation the next days, so you'll get an better understanding what i'm talking about :-)
    jefkin
    @jefkin
    nice :) and thanks
    jefkin
    @jefkin
    and regarding the issue we were having, we have unambiguously identified the problem the run() function we were calling from the servlet side, ... on the service side was defined with a signature of public function run(&$args = array ( ), &$dates = array ( )) ... the '&' references killed it, removed them and got dial tone again. So we'll have to do a bit of data stuffing to pass the updated info we needed in $args and $date, into our return result. Lesson learned is you can't use reference arguments across the two sides of the equation :D
    jefkin
    @jefkin

    So now a completely different type of error, I have a stateless enterprise bean class, that my service needs access to. The stateless class is defined in the common location (./common/Vendor/Project/Utilities/ArgHandler.php) of my app, and I'm declaring it like

    use Vendor\Project\Utilities\ArgHandler;

    class PingService extends AbstractProcessor
    {

    ... clipped out

     /**
      *  The Argument Handler for DB queries.
      *
      * @var Vendor\Project\Utilities\ArgHandler;
      * @EnterpriseBean(name="ArgHandler")
      */
     protected   $argHandler;

    ... clipped out

    protected function run($args   =   array ( ),  $dates  =   array ( ))
    {

    ... clipped out

        $this->argHandler->default_handle($dates);

    ... clipped out

    }

    ... clipped out

    }

    This is throwing an error with a backtrace to this point that reports:
    [2019-05-17 19:30:40] - host.com (error): PHP Exception: exception 'Exception' with message 'Requested value php:global/combined-appserver/project/ArgHandler has not been bound to naming directory php:' in /opt/appserver/src/AppserverIo/Appserver/Naming/NamingDirectory.php:213
    Stack trace:

    #0 /opt/appserver/src/AppserverIo/Appserver/Application/Application.php(804): AppserverIo\Appserver\Naming\NamingDirectory->search('php:global/comb...', Array)

    #1 /opt/appserver/src/AppserverIo/Appserver/PersistenceContainer/BeanManager.php(497): AppserverIo\Appserver\Application\Application->search('ArgHandler', Array)

    #2 /opt/appserver/vendor/appserver-io/rmi/src/AppserverIo/RemoteMethodInvocation/LocalContextConnection.php(123): AppserverIo\Appserver\PersistenceContainer\BeanManager->invoke(Object(AppserverIo\RemoteMethodInvocation\RemoteMethodCall), Object(AppserverIo\Collections\ArrayList))

    #3 /opt/appserver/vendor/appserver-io/rmi/src/AppserverIo/RemoteMethodInvocation/ContextSession.php(189): AppserverIo\RemoteMethodInvocation\LocalContextConnection->send(Object(AppserverIo\RemoteMethodInvocation\RemoteMethodCall))

    #4 /opt/appserver/vendor/appserver-io/rmi/src/AppserverIo/RemoteMethodInvocation/RemoteProxy.php(134): AppserverIo\RemoteMethodInvocation\ContextSession->send(Object(AppserverIo\RemoteMethodInvocation\RemoteMethodCall))

    #5 /opt/appserver/vendor/appserver-io/rmi/src/AppserverIo/RemoteMethodInvocation/RemoteProxy.php(121): AppserverIo\RemoteMethodInvocation\RemoteProxy->invoke(Object(AppserverIo\RemoteMethodInvocation\RemoteMethodCall), Object(AppserverIo\RemoteMethodInvocation\ContextSession))

    #6 /opt/appserver/var/tmp/localhost/project/cache/Vendor_Project_Services_PingService.php(990): AppserverIo\RemoteMethodInvocation\RemoteProxy->
    call('default_handle', Array)

    #7 /opt/appserver/var/tmp/localhost/project/cache/Vendor_Project_Services_PingService.php(990): AppserverIo\RemoteMethodInvocation\RemoteProxy->default_handle(Array)

    #8 /opt/appserver/var/tmp/localhost/project/cache/Vendor_Project_Services_PingService.php(2065): Vendor\Project\Services\PingService->runDOPPELGAENGEROriginal(Array, Array)

    ...
    I have a few ideas about this, but the first thing I'm going to try is moving it out of the common directory and into META-INF

    jefkin
    @jefkin
    that seemed to solve the hassle, I imagine I have to do something to tell appserver.io to look in the common subdirectory instead of META-INF.
    Tim Wagner
    @wagnert
    Hi, i‘ll have a look at it tomorrow 🙂
    jefkin
    @jefkin
    If I have an application 'project' then it's easy to make all servlets respond to queries at 127.0.0.1:9080/project/something/other/stuff; I can easily change the port if needed, but what if I want servlets in project to respond to 127.0.0.1:9080/something/other/stuff; e.g. without the 'project' string appearing in the route, is that doable?
    jefkin
    @jefkin
    my point is I want another parallel servlet in project to respond to 127.0.0.1:9080/that-thing/other/stuff, and a third, etc up to 17 of these guys, built for another platform that respond to disparate urls on the old platform, that lack a unique 'project' element in the url. I mean I guess we could have 17 projects on the appserver.io, but that seems inefficient.
    jefkin
    @jefkin
    I suppose we could do some url rewriting to make that work?
    jefkin
    @jefkin
    also, while I'm on it, if I have 127.0.0.1:9080/project/something/other/stuff as a query, to make it work in appserver.io right now I'm adding '.do' on the end manually, so my Servlet has a route annotation like: @Route(name="StuffService", urlPattern={"/something/other/stuff.do"}) -- If I change it to @Route(name="StuffService", urlPattern={"/something/other/stuff"}) appserver.io fails to find the servlet, I read a doc that said something like "we use '.do' to signal a servlet" ... can we just pop an arbitrary pattern into the works some how and have it land on the servlet? I'm leary to try and mess with the redirects directly, without a firmer understanding of what I'm meddling with.
    jefkin
    @jefkin

    I did try adding a WEB-INF/web.xml with :

    <servlet-mapping>
        <servlet-name>helloWorld</servlet-name>
        <url-pattern>/happyday</url-pattern>
    </servlet-mapping>

    but that didn't work. I think the rewrite might be my only option, but I can't seem to find a good example to go by.

    Tim Wagner
    @wagnert
    @jefkin Sorry for my late answer, but i was really busy on weekend :-( Yes, Enterprise Beans have to be located in the META-INF directory in general, but this can be overwritten in configuration (META-INF/context.xml) if needed. Regard the URL rewriting have a look at our documentation. By default, we use the .do suffix to let the webserver identify if the request has to be handled by the webserver or the servlet engine. This can be configured in the <APPSERVER-ROOR>/etc/appserver/appserver.xml file. It should be no problem to add an additional suffix if needed. Beside this, you can define wildcards in the pattern, to do this use the * character. I'm not completely understand what you want to achieve, but the URL rewriting feature in combination with the wildcard pattern and the file suffix i think nearly everything should be possible.
    jefkin
    @jefkin
    I think despite all my text here that I was confusing the matter, I sent an email with the actual problem and what I think might be a solution.
    Tim Wagner
    @wagnert
    Rewriting is the special topic of @wick-ed, so i'll discuss that tomorrow morning with him, hope that is o. k.?
    jefkin
    @jefkin
    sure thing, thanks