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
{
/**
* The Argument Handler for DB queries.
*
* @var Vendor\Project\Utilities\ArgHandler;
* @EnterpriseBean(name="ArgHandler")
*/
protected $argHandler;
protected function run($args = array ( ), $dates = array ( ))
{
$this->argHandler->default_handle($dates);
}
}
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
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.
<?xml version="1.0"?>
<context xmlns="http://www.appserver.io/appserver" name="wssap" type="AppserverIo\Appserver\Application\Application">
<loggers>
<logger channelName="soap" name="Soap" type="\AppserverIo\Logger\Logger">
<handlers>
<handler type="\AppserverIo\Logger\Handlers\CustomFileHandler">
<formatter type="\AppserverIo\Logger\Formatters\StandardFormatter"/>
<params>
<param name="logFile" type="string">var/log/${webapp.name}-soap.log</param>
<param name="logLevel" type="string">info</param>
</params>
</handler>
</handlers>
</logger>
<logger channelName="servlet" name="servlet" type="\AppserverIo\Logger\Logger">
<handlers>
<handler type="\AppserverIo\Logger\Handlers\CustomFileHandler">
<formatter type="\AppserverIo\Logger\Formatters\StandardFormatter"/>
<params>
<param name="logFile" type="string">var/log/${webapp.name}-servlet.log</param>
<param name="logLevel" type="string">info</param>
</params>
</handler>
</handlers>
</logger>
</loggers>
</context>