GuideWire BC configuration with SQL Server database - sql-server

Currently working on PC-BC integration. I need to configure my studios with SQL Server database, For PC its working fine, but for BC I'm getting error. If anyone knows please help me to sort this out.
<database name="BillingCenterDatabase" dbtype="sqlserver" autoupgrade="true">
<dbcp-connection-pool jdbc-url="jdbc:sqlserver://localhost:1433;DatabaseName=BillingCenterDatabase;User=username;Password=pass#1121"/>
<upgrade defer-create-nonessential-indexes="false">
<versiontriggers dbmsperfinfothreshold="600" />
</upgrade>
</database>
my username is "username" and password is "pass#1121"
database name : BillingCenterDatabase
The error which I'm getting is
gw.pl.exception.GWLifecycleException: No appropriate database found in configuration: env = 'null'

try adding environment attribute in your database tag like shown below,
<database name="BillingCenterDatabase" dbtype="sqlserver" env="dev" autoupgrade="true">
<dbcp-connection-pool jdbc-url="jdbc:sqlserver://localhost:1433;DatabaseName=BillingCenterDatabase;User=username;Password=pass#1121"/>
<upgrade defer-create-nonessential-indexes="false">
<versiontriggers dbmsperfinfothreshold="600" />
</upgrade>

You should have to mention environment name in tomcat.conf in tomcat config file if you are deploying your application on tomcat.
JAVA_OPTS="-Dgw.server.mode=dev -Dgw.bc.env=st"
above line for st environment. you need to enter ut/st/st2 for different environment.

Related

Connect to MSSQL from Spring boot application using windows authentication

I am currently using the below properties to connect to a remotely Mssql server from Java spring boot application:
spring.datasource.url=jdbc:sqlserver://ip\\domain;databaseName=name
spring.datasource.username=abc
spring.datasource.password=def
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
The application runs from both windows and unix servers. I need now to start using the windows authentication instead of the db credentials. This is already configured and supported from MSSQL side. From Java spring boot this is not working. I tried to add to the url: integratedSecurity=true it said it cannot find a dll. I added sqljdbc_auth.dll to java jre bin folder and it didnt work.
I'm working on MS SQL Server 2016, Hibernate 5.3.7.Final and Spring bot 2.2.0. For me, adding this line to properties worked: (without jtds!)
spring.datasource.url=jdbc:servername;databasename=your_db_name;integratedSecurity=true
You may also need these properties:
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
And if you encounter a problem with "no sqljdbc_auth in java.library.path".
You may refer to this answer no sqljdbc_auth.
Try use jtds driver, and in apllication properties use:
app.datasource.youraplication.jdbcUrl=jdbc:jtds:sqlserver://yourBdHost/yourSchemaBd;domain=yourDomain
Download the drivers from:
https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-2017
Add the jar to your project Right Click on project - > Build Path -> Configure Build Path - > Libraries -> Add External JARs
Add "integratedSecurity=true" to your connection string and remove username and password

How to configure p6spy for mssql server with hibernate?

In our web application we are using spring, hibernate & sql server 2016 as db. We are using jndi to connect to the database. To record all the queries executed by hibernate I am trying to implement the p6spy.
Here are the changes I have made.
Changed the resource information from
<Resource name="jdbc/eportalcore" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;databaseName=eportal-core;"
username="eportaldbadmin"
password="P#ssw0rd"
maxTotal="100"
maxIdle="20"
minIdle="5"
maxWaitMillis="10000" />
to
<Resource name="jdbc/eportalcore" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.p6spy.engine.spy.P6SpyDriver"
url="jdbc:p6spy:sqlserver://localhost:1433/eportal-core"
username="eportaldbadmin"
password="P#ssw0rd"
maxTotal="100"
maxIdle="20"
minIdle="5"
maxWaitMillis="10000" />
and added the spy.properties file under lib folder of tomcat directory. Also I have placed the p6spy-3.0.0.jar too inside the lib folder.
But after this my application is not getting connected to the DB. What mistake I am doing here? If I remove this changes then it is working fine.
Any suggestions?
I had the same question and here is what I did to make it work. Note my Database connection properties are in a property file (shouldn't be an issue) and that I use tomcat as an Application Server. You can also add P6Spy as a Maven dependency in your project.
Before :
db.properties
db.driver=net.sourceforge.jtds.jdbc.Driver
db.url=jdbc:jtds:sqlserver://${db.server}/${db.name};useNTLMv2=true;domain=XX
After :
Download(latest version when writing this response) the project. Put the p6spy-3.7.0.jar and spy.properties in the tomcat/lib folder. Change the spy.properties and application properties as noted under. Restart application and you should find a spy.log where your logs are printed normally.
db.properties
db.driver=com.p6spy.engine.spy.P6SpyDriver
db.url=jdbc:p6spy:jtds:sqlserver://${db.server}/${db.name};useNTLMv2=true;domain=XX
spy.properties
driverlist=net.sourceforge.jtds.jdbc.Driver

Sonar 4.1.1 with LDAP 1.4 Configuration

I am trying to configure the Sonar with windows Active directory. I am getting the below error.
ERROR [rails] Error from external users provider: Unable to retrieve details for user xxx.xxx in
The below configurations are done in sonar.property file
# LDAP configuration
# General Configuration
sonar.security.realm=LDAP
ldap.authentication: simple
sonar.security.savePassword=true
sonar.authenticator.createUsers=true
ldap.url=ldap://xxxx.group.root.ad
# User Configuration
ldap.user.baseDn=OU=Users,OU=Customs,OU=Group,dc=group,dc=root,dc=ad
ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail
# Group Configuration
ldap.group.baseDn=OU=Customs,OU=Group,dc=group,dc=root,dc=ad
#ldap.group.request=(&(objectClass=posixGroup)(memberUid={uid}))
ldap.group.request=((objectClass=group)(member={dn}))
anybody have an idea to fix the issue in sonar.
Regards
Arun.
I had similar issue with LDAP 2.1 on SonarQube 5.6 (LTS)
tl'dr
This format of ldap.user.request worked for me -
ldap.user.request=(uid={login})
If you are still reading ...
Here are some things that helped me resolving the issue
sonar.log :
Turn the DEBUG ON and look for the actual ldap search query thats getting build and the ldap context.
2017.03.14 00:35:04 DEBUG web[o.s.p.l.LdapSearch] Search: LdapSearch{baseDn=dc=test,dc=com, scope=subtree, request=(&(objectClass=inetOrgPerson)(uid={0})), parameters=[harvey], attributes=[mail, cn]}
2017.03.14 00:35:04 DEBUG web[o.s.p.l.LdapContextFactory] Initializing LDAP context {java.naming.provider.url=ldap://ldap.test.com, java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, java.naming.security.principal=uid=user,ou=People,dc=test,dc=com, com.sun.jndi.ldap.connect.pool=true, java.naming.security.authentication=simple, java.naming.referral=follow}
ldapsearch :
Run lapsearch command with same parameters from the logs (step #1)
$ldapsearch -x -L -D"uid=user,ou=People,dc=test,dc=com" -w"pass" -b"ou=People,dc=test,dc=com" "(uid=harvey)" mail cn
sonar.properties -
here is my working LDAP configuration
#General Configuration
sonar.security.realm=LDAP
ldap.url=ldaps://ldap.test.com
ldap.bindDn=uid=user,ou=People,dc=test,dc=com
ldap.bindPassword=pass
#User Configuration
ldap.user.baseDn=ou=People,dc=test,dc=com
ldap.user.request=(uid={login})
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail
#Group Configuration
ldap.group.baseDn=ou=Group,dc=test,dc=com
ldap.group.request=(&(objectClass=posixGroup)(memberUid={uid}))
ldap.user.request & ldap.group.request
From the step #1 you could find out whats the correct format for query filter parameter in your case and values for bindDn (-D) and baseDn _-b)
Hope this helps =)
Thanks!
I've just encountered a similar error in Sonar 5.1.1. Here's how I solved it:
The Base DN is incorrect for use with an AD server. This worked for me:
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
Anonymous authentication to an AD server apparently doesn't work with Sonar's LDAP plugin (this assumption is supported by the documentation which specifies anonymous authentication against an AD server as "untested"). You'll need to specify a Bind DN (here meaning a user) for connecting with the AD server:
ldap.bindDn=<user>#<domain>
ldap.bindPassword=secret

Heroku database push operation

To load a database which runs now on the my computer, SQL Server 2012 and Windows, I have installed Git Bash, taps and Heroku.
Now, whenever I wrote the command
heroku db:push --app myapp
it gives the same error
Invalid database ur
I think I miss something, I have not declared which database should be pushed to the Heroku.
Can you help me with this problem ? how can I use heroku db:push, are there any other steps like creating something ? Why I get this error ? Maybe you will say that "have you read documentation or have you searched google?", Yes
EDIT: What I have know is
Local database
Server name Heroku database
Database name application name
username | or windows authentication postgres database
password | username and password
aws address
Should I put/load some file/gem into the Git ?
EDIT 2:
I have test this command but it gives other error.
heroku db:push postgres://localdbUSERNAME:localdbpassword#localdbDATABASENAME/localdbSERVERNAME --app myapp
Error
Failed to connect to database:
Sequel::AdapterNotFound -> LoadError: cannot load such file -- pg
Heroku db:push does not work with SQL Server, it works with MySQL and/or Postgres. You'll need to switch to running one of these database servers, run your migrations/seeds and then use heroku db:push to push your local database to Herokul

How to connect Liferay with Mysql Database

I am new in Liferay. I want to connect Liferay with MySQL database. I am using Liferay CE (Version? - came bundled with tomcat (6.0.29)). Please tell me the steps for this. Thank you
To build upon what has already been mentioned already, edit the file portal-ext.properties found in liferay-portal-xxx/tomcat-xxx/webapps/ROOT/WEB-INF/classes (if it doesn't exist already then create it).
Add these lines to it:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=<insert your mysql username>
jdbc.default.password=<insert your mysql password>
It also might be worth creating the lportal table in mysql.
mysql -u root -p <<< "create database lportal character set utf8;"
Download and extract the Liferay database scripts found here. Then run one, e.g.
mysql -u root -p < /path-to-the-script/create-mysql.sql
More information can be found in this Liferay Ubuntu Installation Guide (be weary as it's for an version but the database section is useful) and this Liferay Database Configuration Guide.
Paste the following line of code in portal-ext.properties:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=
Download Liferay CE
Install MySQL and create a database
Unzip liferay and create file if no exist portal.properties into liferay_home/tomcat-6.0.29/webapps/ROOT/WEB-INF/clases
Paste this:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/nameDatabase?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=name
jdbc.default.password=password
Run onm Eclipse, or Windows .bat/Linux .sh
i hope works for you
1)path--->home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes---->create an empty doc with name as portal-ext.properties
paste the below code:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
2)path--->/home/karthik/Desktop/LiferaySetup/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf/Catalina/localhost-->Enter the below code inside ROOT.xml
<Context path="" crossContext="true">
<!-- JAAS -->
<!--<Realm
className="org.apache.catalina.realm.JAASRealm"
appName="PortalRealm"
userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal"
roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole"
/>-->
<!--
Uncomment the following to disable persistent sessions across reboots.
-->
<!--<Manager pathname="" />-->
<!--
Uncomment the following to not use sessions. See the property
"session.disabled" in portal.properties.
-->
<!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />-->
<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8"
username="root"
password="root"
maxActive="20"
/>
</Context>
If you follow the above 2 statements you can create easily

Resources