Invalid data source error (oracle) in Pentaho 8.0 - pentaho

I'm trying to make a multi-tenancy application. I've followed this tutorial, and also this one. So, what I have in context.xml is:
<Resource
name="jdbc/DB-xxx"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20"
maxIdle="5"
maxWaitMillis="10000"
username="xxx"
password="pass"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:#//xxxurl:1521:ORCL"
/>
<Resource
name="jdbc/DB-aaa"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20"
maxIdle="5"
maxWaitMillis="10000"
username="aaa"
password="pass"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:#//aaaurl:1521:ORCL"
/>
I also have the JNDI pointing to those above in defaut.properties and jdbc.properties.
When I try to connect to the JNDI using the Pentaho Report Design, I receive these erros:
Error connecting to database [DB] :org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
javax.naming.NamingException: Invalid data source:'DB'
Invalid data source:'DB'
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
javax.naming.NamingException: Invalid data source:'DB'
Invalid data source:'DB'
I have the ojdbc6 in all libs, so I think that this is not the problem. Does someone have any idea?
Thanks!

Ok, I've found the solution. I was changing the code in the wrong directory. The right one is C:\Users\user\.pentaho\simple-jndi. I've put, in the default file, the database infos and it worked. Now I'm able to connect to the database.

Related

WebLogic Error: Parsing failure in config.xml; The provider Provider already exists

When starting WebLogic server v12c, I am receiving the following error:
<Dec 2, 2020 8:17:27 AM CST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: A MultiException has 5 exceptions. They are:
1. weblogic.management.provider.internal.RuntimeAccessImpl$ParseException: [Management:141266]Parsing failure in config.xml: java.lang.IllegalArgumentException: The provider Provider already exists.
2. java.lang.IllegalStateException: Unable to perform operation: create on weblogic.management.provider.internal.RuntimeAccessImpl
3. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.management.provider.internal.RuntimeAccessService
4. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.t3.srvr.FinalThreadLocalService errors were found
5. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.t3.srvr.FinalThreadLocalService
The WebLogic server is being started via MyEclipse. I've added the server via Window -> Preferences -> Servers -> Runtime Environments -> WebLogic, then adding Oracle WebLogic Server 12c.
My config.xml file is set to this:
<?xml version='1.0' encoding='UTF-8'?>
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd">
<name>[app_name]</name>
<domain-version>12.1.1.0</domain-version>
<security-configuration>
<name>[app_name]</name>
<realm>
<sec:authentication-provider xsi:type="wls:default-authenticatorType"></sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:default-identity-asserterType">
<sec:active-type>AuthenticatedUser</sec:active-type>
</sec:authentication-provider>
<sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"></sec:role-mapper>
<sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"></sec:authorizer>
<sec:adjudicator xsi:type="wls:default-adjudicatorType"></sec:adjudicator>
<sec:credential-mapper xsi:type="wls:default-credential-mapperType"></sec:credential-mapper>
<sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"></sec:cert-path-provider>
<sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
<sec:name>myrealm</sec:name>
</realm>
<default-realm>myrealm</default-realm>
<credential-encrypted>[encrypted_password]</credential-encrypted>
<node-manager-username>[username]</node-manager-username>
<node-manager-password-encrypted>[encrypted_password]</node-manager-password-encrypted>
</security-configuration>
<server>
<name>AdminServer</name>
<listen-address>7001</listen-address>
<server-start>
<class-path>C:/[invalid_path];</class-path>
<password-encrypted>[encrypted_password]</password-encrypted>
</server-start>
</server>
<embedded-ldap>
<name>[app_name]</name>
<credential-encrypted>[encrypted_password]</credential-encrypted>
</embedded-ldap>
<configuration-version>12.1.1.0</configuration-version>
<app-deployment>
<name>[app_name_dir]</name>
<target>AdminServer</target>
<module-type>ear</module-type>
<source-path>autodeploy\[app_name]</source-path>
<security-dd-model>DDOnly</security-dd-model>
<staging-mode>nostage</staging-mode>
</app-deployment>
<web-app-container>
<x-powered-by-header-level>SHORT</x-powered-by-header-level>
<show-archived-real-path-enabled>true</show-archived-real-path-enabled>
</web-app-container>
<jms-system-resource>
<name>[app_name] Module</name>
<target>AdminServer</target>
<descriptor-file-name>jms/[app_name]_lockbox_module-4304-jms.xml</descriptor-file-name>
</jms-system-resource>
<admin-server-name>AdminServer</admin-server-name>
<jdbc-system-resource>
<name>[app_name_ds]</name>
<target>AdminServer</target>
<descriptor-file-name>jdbc/[app_name_ds]-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
<jdbc-system-resource>
<name>[app_name_mds]</name>
<target>AdminServer</target>
<descriptor-file-name>jdbc/[app_name_mds]-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
</domain>
The for is actually not a valid directory, but I'm not sure what should be assigned to it.
I was able to resolve this by setting my DMW_HOME VM argument to my Middleware home directory.
For example:
-DMV_HOME="<your middleware home directory>"
In MyEclipse, this was in the Lauch Configuration of the WebLogic server runtime environment.
I attempted to set MW_HOME environment variable, but this did not work.

JNDI lookup error for name: java:comp/env/jdbc/DynaPropDB

Am getting below error while starting the liberty server:
[ERROR ]
com.it.properties.PropertyResourceException for user [UnKnown] self logged on Jan 23, 2019 12:43:12 PM.
Exception instance reference code [13EE91EC-BCA0-49C1-7ABC-5F537ABC5F53].
I have DynaPropAdminWeb Access for the application
Correctly placed lookup-name and binding-name in web.xml file and ibm-web-bnd.xml file
It would be helpful if you provide the relevant web.xml, ibm-web-bnd.xml, and server.xml config snippets for the resource reference and data source. Absent that, taking your word that the deployment descriptor and binding file are correct, then the problem will be in the server config, either in incorrectly specifying the dataSource/jdbcDriver/library or with feature enablement. A common mistake in Liberty is forgetting to enable the jndi-1.0 feature (which is needed for JNDI lookups) alongside the jdbc-4.x feature. In case that is the problem, here is an example,
<server>
<featureManager>
<feature>jdbc-4.2</feature>
<feature>jndi-1.0</feature>
<feature>servlet-4.0</feature>
</featureManager>
<dataSource jndiName="jdbc/DynaPropDB">
<jdbcDriver libraryRef="jdbcLib"/>
<properties serverName="localhost" portNumber="1234" databaseName="exampleDB"/>
</dataSource>
<library id="jdbcLib">
<file name="C:/drivers/jdbc/myJdbcDriver.jar"/>
</library>
</server>
Also, here is a link to a knowledge center page with configuration examples for various commonly-used databases.

Tomcat 7 locks the jackrabbit repository

Hi I am trying to reach my repository via JNDI.
I recieve the following message when i try to connect:
"The repository home C:\apache-tomcat-7.0.53-windows-x64\apache-tomcat-7.0.53\bin\myrepo > appears to be in use since the file named .lock is already locked by the current process."
This code is runing on a web application, deployed on the same Tomcat.
InitialContext context = new InitialContext();
Context environment = (Context) context.lookup("java:comp/env");
Repository repository = (Repository) environment.lookup("jcr/repository");
Tomcat is locking "myrepo" when it starts and wont release it until I shuts it down.
Why is this happening?
Im running apache-tomcat-7.0.53-windows-x64 on Windows 7, using jackrabbit-webapp-2.6.5.war.
Edit May 10:
I have now tried to edit server.xml ann context.xml for my tomcat.
server.xml:
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource configFilePath="C:\apache-tomcat-7.0.53-windows-x64\apache-tomcat-7.0.53\bin\myrepo\repository.xml"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
name="jcr/globalRepository" repHomeDir="C:\apache-tomcat-7.0.53-windows-x64\apache-tomcat-7.0.53\bin\myrepo"
type="javax.jcr.Repository"
auth="Container" />
</GlobalNamingResources>
context.xml
<ResourceLink name="jcr/repository"
global="jcr/globalRepository"
type="javax.jcr.Repository"/>
The error is still the same.
There are a .lock file inside the repository folder. delete that file.

WSO2 - MSSQL causes error for commits

When configuring WSO2 API Manager version 1.5.0 to use SQL Server as my database the instructions at:
http://docs.wso2.org/display/AM150/Setting+up+with+MS+SQL
For step 1 for Setup Configuration File, they tell you to update the master-datasources.xml file to match their example.
After updating and starting the API Manager, I got the following error in the logs:
ERROR {org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO} - Failed to rollback getting user ratings {org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO}
java.sql.SQLException: commit() should not be called while in auto-commit mode.
We tried a couple of things. First we disabled auto-commit on our SQL Server (2008r2).
That did not help and the error continued. After researching jdbc connections at: http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html
I discovered that a setting for:
<defaultAutoCommit>false</defaultAutoCommit>
was needed for each database definition in master-datasources.xml
For example:
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<defaultAutoCommit>false</defaultAutoCommit>
<url>jdbc:jtds:sqlserver://server:port/db_name</url>
<username>user</username>
<password>pwd</password>
<driverClassName>net.sourceforge.jtds.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
The documentation from WSO2 does not reference this setting that I have found. It 'might' set it correctly when using the ../carbon admin site for your product.

weblogic, deployments are not reading properties from WEB-INF/classes, configured using Spring

I have a similar problem to: Using external properties files in weblogic and note that the accepted answer there is mainly working for me.
However, I have a follow-up (sorry, cannot work out how to just add comments to re-open the original question)
Does anyone know what the actual cause of this is and the "correct" (if there is such a thing) solution, or do people take copying files to the domain as a common practise in weblogic (10.3.3)
What I am using is:
Spring config has this:
<bean id="messages" class="java.util.ResourceBundle" factory-method="getBundle">
<constructor-arg index="0" value="config/messages"/>
</bean>
the messages bean is then referenced in other beans
The error is
<code>
<11-Apr-2011 11:47:23 o'clock BST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1302518829904' for task '4'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1514)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
Truncated. see log file for complete stacktrace
Caused By: java.util.MissingResourceException: Can't find bundle for base name config/messages, locale en_GB
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:715)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Truncated. see log file for complete stacktrace
</code>
I have tried removing the config/ at the start (and copying the messages.properties to WEB-INF and also WEB-INF/classes, to no avail. Should also point out that all of messages, messages _en_GB and messages _en_US exist
Your path reference doesn't have a 'classpath' in it. Have you tried putting the config directory in the root of the war?