Apache NiFi TLS failed to start - ssl

I have tried to install NiFi toolkit to enable TLS. I followed instructions given here.
I followed the steps,using localhost and host as sachith but when I try to start NiFi again, I get following error.
Bootstrap Config File: /home/sachith/nifi-1.9.2/conf/bootstrap.conf
16:59:23,949 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback-test.xml] 16:59:23,950 |-INFO in
ch.qos.logback.classic.LoggerContext[default] - Could NOT find
resource [logback.groovy] 16:59:23,950 |-INFO in
ch.qos.logback.classic.LoggerContext[default] - Found resource
[logback.xml] at
[file:/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/conf/logback.xml]
16:59:24,032 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - debug
attribute not set 16:59:24,046 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan
for changes in
[file:/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/conf/logback.xml]
16:59:24,046 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - Setting
ReconfigureOnChangeTask scanning period to 30 seconds 16:59:24,049
|-INFO in
ch.qos.logback.classic.joran.action.LoggerContextListenerAction -
Adding LoggerContextListener of type
[ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
16:59:24,062 |-INFO in
ch.qos.logback.classic.jul.LevelChangePropagator#48140564 -
Propagating DEBUG level on Logger[ROOT] onto the JUL framework
16:59:24,062 |-INFO in
ch.qos.logback.classic.joran.action.LoggerContextListenerAction -
Starting LoggerContextListener 16:59:24,062 |-INFO in
ch.qos.logback.core.joran.action.AppenderAction - About to instantiate
appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
16:59:24,067 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
Naming appender as [APP_FILE] 16:59:24,084 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy#93122545 - Archive
files will be limited to [100 MB] each. 16:59:24,127 |-INFO in
c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy#93122545 - No
compression will be used 16:59:24,128 |-INFO in
c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy#93122545 - Will use
the pattern
/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/logs/nifi-app_%d{yyyy-MM-dd_HH}.%i.log
for the active file 16:59:24,131 |-INFO in
ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP#7c30a502 - The date
pattern is 'yyyy-MM-dd_HH' from file name pattern
'/home/sachith/Documents/Projects/nifi-1.9.2-bin/nifi-1.9.2/logs/nifi-app_%d{yyyy-MM-dd_HH}.%i.log'.
nifi-app.log
2020-06-26 09:27:50,296 INFO [main] org.eclipse.jetty.server.Server Started #186210ms
2020-06-26 09:27:50,297 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.NiFiWebApiSecurityConfiguration': Unsatisfied dependency expressed through method 'setJwtAuthenticationProvider' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtAuthenticationProvider' defined in class path resource [nifi-web-security-context.xml]: Cannot resolve reference to bean 'authorizer' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorizer': FactoryBean threw exception on object creation; nested exception is org.apache.nifi.authorization.exception.AuthorizerCreationException: Unable to locate configured Access Policy Provider: file-access-policy-provider
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:666)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1269)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
Edit : After Andy's initial answer.
My authorizers.xml
<accessPolicyProvider>
<identifier>file-access-policy-provider</identifier>
<class>org.apache.nifi.authorization.FileAccessPolicyProvider</class>
<property name="User Group Provider">file-user-group-provider</property>
<property name="Authorizations File">./conf/authorizations.xml</property>
<property name="Initial Admin Identity">CN=sachith, OU=NiFi</property>
<property name="Legacy Authorized Users File"></property>
<property name="Node Identity 1"></property>
<property name="Node Group"></property>
</accessPolicyProvider>
<userGroupProvider>
<identifier>file-user-group-provider</identifier>
<class>org.apache.nifi.authorization.FileUserGroupProvider</class>
<property name="Users File">./conf/users.xml</property>
<property name="Legacy Authorized Users File"></property>
<property name="Initial User Identity 1">CN=sachith, OU=NiFi</property>
</userGroupProvider>

You haven't provided the complete log output, so there may be other issues here, but it looks like the problem is nested exception is org.apache.nifi.authorization.exception.AuthorizerCreationException: Unable to locate configured Access Policy Provider: file-access-policy-provider. Did you provide an authorizers.xml file which defines a FileAccessPolicyProvider?
Look specifically at Step 7 of the walkthrough guide you linked to.

Related

spring cloud config server cannot bind to gitlab

I am using Spring springCloudVersion, "2021.0.3" to setup a Config Server that uses my gitlab account for its files. I created a deploy token with premissions:
read_repository, read_registry, write_registry, read_package_registry, write_package_registry
and then I use those in the spring server application.properties:
spring.application.name=config-server
spring.application.version=0.1.0
server.port=8012
spring.cloud.config.server.git.uri=https://gitlab.com/[account]/[repo]
spring.cloud.config.server.git.skip-ssl-validation=true
spring.cloud.config.server.git.clone-on-start=true
spring.cloud.config.server.git.default-label=main
spring.cloud.config.server.git.basedir=https://gitlab.com/[account]/[repo]
spring.cloud.config.server.git.username=[my-token-username]
spring.cloud.config.server.git.password=[my-token-password]
I was getting errors on startup about not binding the base directory until I put the same uri there as in spring.cloud.config.server.git.uri (they are now identical but it feels wrong)
When I try to startup my ConfigServerApplication I get the following:
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/DefaultRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'defaultEnvironmentRepository' parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'multipleJGitEnvironmentProperties': Could not bind properties to 'MultipleJGitEnvironmentProperties' : prefix=spring.cloud.config.server.git, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.config.server.git.basedir' to java.io.File
2022-06-30 12:04:53.020 INFO 1594 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-06-30 12:04:53.026 INFO 1594 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-06-30 12:04:53.033 ERROR 1594 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.cloud.config.server.git.basedir' to java.io.File:
Property: spring.cloud.config.server.git.basedir
Value: https://gitlab.com/[account]/[repo]
Origin: class path resource [application.properties] - 9:40
Reason: failed to convert java.lang.String to java.io.File (caused by java.lang.IllegalStateException: Could not retrieve file for URL [https://gitlab.com/[account]/[repo]]: URL [https://gitlab.com/[account]/[repo]] cannot be resolved to absolute file path because it does not reside in the file system: https://gitlab.com/[account]/[repo]
I don't know what file it is trying to access - in that repo I have
README.md
application.properties
and I would think the properties files is what it is trying to access?
I have tried using both my account credentials and the deploy token with the same results. I did not try the deploy key because this will not be access locally, but via cloud.
Finally tracked it down - I had to add:
spring.profiles.active=native
and remove
spring.cloud.config.server.git.basedir

Java EE 7 EJB Authentication using WildFly - security annotations don't work

I am trying to establish a security domain using wildfly 18.0.1. These are the settings I use:
standalone.xml:
<security-domain name="my-security-domain" cache-type="default">
<authentication>
<login-module code="UsersRoles" flag="required">
<module-option name="usersProperties" value="users.properties"/>
<module-option name="rolesProperties" value="roles.properties"/>
</login-module>
</authentication>
</security-domain>
I created user with add-user.bat and created files: users.properties and roles.properties filled with created user data.
IntelliJ doesnt's seem to recognize security annotations and I can't import them:
#Stateless
#WebService(name = "HelloWorldType", portName = "HelloWorldPort", targetNamespace = "https://soap.soa.pl/lab1/ws")
#SecurityDomain("my-security-domain") // in standalone.xml
#DeclareRoles({"MyRole"})
#WebContext(contextRoot="lab1", urlPattern="/HelloWorld", authMethod="BASIC", transportGuarantee="NONE")
#SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL)
public class HelloWorld {
#WebMethod()
#RolesAllowed("MyRole")
public String sayHello(#WebParam(name = "message") String message) {
return "Here is the message: '" + message + "'";
}
}
Also, now I'm not able to start wildfly serwer:
18:49:25,854 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) starting
18:49:26,643 INFO [org.wildfly.security] (ServerService Thread Pool -- 25) ELY00001: WildFly Elytron version 1.10.4.Final
18:49:27,227 INFO [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
18:49:27,256 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 13) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
18:49:27,321 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "lab1-ear.ear")]) - failure description: "WFLYSRV0137: No deployment content with hash 5cddb572897ba715135a11fe8d8c7c56f30099b5 is available in the deployment content repository for deployment 'lab1-ear.ear'. This is a fatal boot error. To correct the problem, either restart with the --admin-only switch set and use the CLI to install the missing content or remove it from the configuration, or remove the deployment from the xml configuration file and restart."
18:49:27,326 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
18:49:27,337 INFO [org.jboss.as] (MSC service thread 1-7) WFLYSRV0050: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) stopped in 7ms
I have no idea why, especially the annotations, don't work.. please help.
You need to locate the jar file providing these annotation classes and add it to the Module Dependencies.
If your project is Gradle or Maven managed, add the dependency to build.gradle/pom.xml instead.

Nifi Cluster on docker is not starting up, Working only on one Node

I am trying to install Apache Nifi on docker cluster with two Agents, Single Node cluster is working while starting on Second Node I am getting below Error
My stack trace
2017-09-13 06:00:52,640 INFO [main] o.a.n.admin.AuditDataSourceFactoryBean Database not built for repository: jdbc:h2:./database_repository/nifi-flow-audit;AUTOCOMMIT=OFF;DB_CLOSE_ON_EXIT=FALSE;LOCK_MODE=3;LOCK_TIMEOUT=25000;WRITE_DELAY=0;AUTO_SERVER=FALSE. Building now...
2017-09-13 06:00:52,794 WARN [main] org.eclipse.jetty.webapp.WebAppContext Failed startup of context o.e.j.w.WebAppContext#28dd038f{/nifi-api,file:///opt/nifi/work/jetty/nifi-web-api-1.3.0.war/webapp/,UNAVAILABLE}{./work/nar/framework/nifi-framework-nar-1.3.0.nar-unpacked/META-INF/bundled-dependencies/nifi-web-api-1.3.0.war}
org.apache.nifi.web.NiFiCoreException: Unable to start Flow Controller.
at org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:88)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:876)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:839)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1442)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:290)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.server.Server.start(Server.java:452)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:419)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:705)
at org.apache.nifi.NiFi.<init>(NiFi.java:160)
at org.apache.nifi.NiFi.main(NiFi.java:267)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController' defined in class path resource [nifi-context.xml]: Cannot resolve reference to bean 'clusterCoordinator' while setting bean property 'clusterCoordinator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterCoordinator': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterCoordinationProtocolSenderListener' defined in class path resource [nifi-cluster-protocol-context.xml]: Cannot resolve reference to bean 'protocolListener' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'protocolListener' defined in class path resource [nifi-cluster-protocol-context.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [int]: Could not convert constructor argument value of type [null] to required type [int]: Failed to convert value of type [null] to required type [int]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [null] to required type [int]: PropertyEditor [org.springframework.beans.propertyeditors.CustomNumberEditor] returned inappropriate value of type [null]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
The error you are getting is showing that it cannot instantiate a spring bean 'protocolListener' defined in class path resource [nifi-cluster-protocol-context.xml].
That bean definition looks like this:
<!-- protocol listener -->
<bean id="protocolListener" class="org.apache.nifi.cluster.protocol.impl.SocketProtocolListener">
<constructor-arg index="0">
<bean factory-bean="nifiProperties" factory-method="getClusterNodeProtocolThreads"/>
</constructor-arg>
<constructor-arg index="1">
<bean factory-bean="nifiProperties" factory-method="getClusterNodeProtocolPort"/>
</constructor-arg>
<constructor-arg ref="protocolServerSocketConfiguration" index="2"/>
<constructor-arg ref="protocolContext" index="3"/>
</bean>
The error message also says the issue is with index 1 which is for getClusterNodeProtocolPort.
You most likely have not set nifi.cluster.node.protocol.port in nifi.properties for this node.

Hibernate Search JGroups configuration under JBoss 7

I'm part of a team writing a web app that uses Hibernate Search, and we've recently tried to start to implement the use of JGroups to keep Lucene indexes on different nodes in sync with each other.
However, I've been unable to get past the most basic first steps in getting this set up, and documentation seems quite sparse.
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="myFactory">
<property name="dataSource" ref="myDataSource"/>
<property name="persistenceXmlLocation" value="/WEB-INF/persistence.xml"/>
<property name="persistenceUnitName" value="persistenceUnit"/>
<property name="jpaVendorAdapter" ref="vendorAdapter"/>
<property name="jpaProperties">
<props>
<prop key="hibernate.search.worker.backend.jgroups.configurationFile">jgroups-config.xml</prop>
<prop key="hibernate.search.default.directory_provider">infinispan</prop>
<prop key="hibernate.search.default.indexBase">indexes</prop>
<prop key="hibernate.search.default.worker.backend">jgroups</prop>
<prop key="hibernate.search.services.jgroups.clusterName">MyCluster</prop>
<prop key="hibernate.search.error_handler">log</prop>
<prop key="hibernate.search.lucene_version">LUCENE_36</prop>
<prop key="hibernate.search.generate_statistics">true</prop>
<prop key="hibernate.search.jmx_enabled">true</prop>
</props>
</property>
The key property here is hibernate.search.worker.backend.jgroups.configurationFile which gives the name of the configuration file for jgroups, which we will eventually need. I've tried putting this file in WEB-INF and in with the props files in the JBoss modules directory structure (in which other files are located and successfully loaded), but it just is not getting picked up.
In the logs I can see:
16:34:57,609 INFO [org.hibernate.search.backend.impl.jgroups.JGroupsChannelProvider] (MSC service thread 1-1) HSEARCH000005: Starting JGroups Channel
16:34:57,609 INFO [org.hibernate.search.backend.impl.jgroups.JGroupsChannelProvider] (MSC service thread 1-1) HSEARCH000011: Unable to use any JGroups configuration mechanisms provided in properties { hibernate.search.default.worker.backend=jgroups, hibernate.search.default.directory_provider=infinispan, hibernate.search.worker.backend.jgroups.configurationFile=jgroups-config.xml}. Using default JGroups configuration file!
16:34:59,427 INFO [stdout] (MSC service thread 1-1)
16:34:59,427 INFO [stdout] (MSC service thread 1-1) -------------------------------------------------------------------
16:34:59,428 INFO [stdout] (MSC service thread 1-1) GMS: address=LDNLPT1271-PC-17149, cluster=CrisisHubCluster, physical address=172.26.10.169:58147
16:34:59,428 INFO [stdout] (MSC service thread 1-1) -------------------------------------------------------------------
16:35:02,448 INFO [org.hibernate.search.backend.impl.jgroups.JGroupsMasterMessageListener] (MSC service thread 1-1) HSEARCH000015: Received new cluster view: [LDNLPT1271-PC-17149|0] [LDNLPT1271-PC-17149]
16:35:02,450 INFO [org.hibernate.search.backend.impl.jgroups.JGroupsChannelProvider] (MSC service thread 1-1) HSEARCH000006: Connected to cluster [ MyCluster ]. The node address is LDNLPT1271-PC-17149
16:35:02,513 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (CacheStartThread,HibernateSearch-Infinispan-cluster,LuceneIndexesMetadata) ISPN000078: Starting JGroups Channel
16:35:02,514 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (CacheStartThread,HibernateSearch-Infinispan-cluster,LuceneIndexesMetadata) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
I've truncated the list of properties in Unable to use any JGroups configuration mechanisms provided in properties as it would take up several pages, but if you look at the line, you can see it lists the property at the same time that it says it can't find it.
So, it's not picking up the config file location, and it's using a default.
Has anyone here used jgroups with Hibernate Search? Did you manage to supply a custom jgroups configuration file? How did you do it?
Right. I had to download the Hibernate Search source and step through the server start up in order to find this. I was using Hibernate 4.2, and the documentation version I was referring to was mostly for 3.2.
In between the two versions, someone renamed the property from hibernate.search.worker.backend.jgroups.configurationFile to hibernate.search.services.jgroups.configurationFile.

Receiving "Name [jdbc/WorklightDS] is not bound in this Context. Unable to find [jdbc]" errors after manual Install

We are trying to install worklight 5.06 enterprise manually on our server with one DB (worklight), on Tomcat 7 on Rhel Linux. We ran the create-worklight-oracle.sql script, and have followed the instructions on http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fadmin%2Fc_installation.html
but are still running into some issues. Specifically it appears we're having an issue with our config files for tomcat to talk to the worklight DB:
SEVERE: com.worklight.server.bundle.project.messages:logger.projectStartFailed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL [jar:file:/usr/share/java/tomcat7/worklight-jee-library.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [jar:file:/usr/share/java/tomcat7/worklight-jee-library.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'rssBrokerDS' defined in URL [jar:file:/usr/share/java/tomcat7/worklight-jee-library.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [jar:file:/usr/share/java/tomcat7/worklight-jee-library.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/WorklightDS] is not bound in this Context. Unable to find [jdbc].
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
Probably something stupid wrong, I've done the following for the database config:
added following to our worklight.properties in the exploded worklight.war:
uncommented these lines:
wl.db.type=ORACLE
wl.db.url=jdbc:oracle:thin:#//DBSERVER:1521/SERVICE_NAME <-- changed from our internal names
wl.db.username=worklight
wl.db.password=worklight
Added the following to the context.xml for tomcat in the stanza;
<Resource name="jdbc/WorklightDS"
auth="Container"
type="javax.sql.DataSource"
username="worklight"
password="worklight"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:#//DBSERVER:1521/SERVICE_NAME"/>
Added the following to the web.xml at the end of the file (before the /web-app> end tag):
<resource-ref>
<res-ref-name>jdbc/WorklightDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Possible Solution:
Issue was with using the JNDI connection - using jdbc connection alone works fine.
For Worklight 506 on tomcat 7, here's a sample configuration for you:
Set JDBC Data Source in tomcat 7 server.xml (in < host> section)
<Context docBase="worklight" path="/worklight">
<Resource auth="Container"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="80"
maxIdle="4"
maxWait="5000"
name="jdbc/WorkLightDS"
password="worklight"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:#//DBSERVER:1521/SERVICE_NAME"
username="worklight"/>
</Context>
In worklight.propertis, set below two line:
wl.db.type=ORACLE
wl.db.jndi.name=java:comp/env/jdbc/WorkLightDS