Dbfit: Login failed for user 'dev\abc'. Client connectionId:a12f7cab - dbfit

I am trying to connect sqlserver from dbfit, and getting below error:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user
'DEV\abc'. ClientConnectionId:a12f7cab-7261-4fa7-8064-ea355f03f883 at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
at
com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:254)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:84)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2908)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)
at
com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
at java.sql.DriverManager.getConnection(DriverManager.java:664) at
java.sql.DriverManager.getConnection(DriverManager.java:208) at
dbfit.api.AbstractDbEnvironment.connect(AbstractDbEnvironment.java:51)
at
dbfit.environment.SqlServerEnvironment.connect(SqlServerEnvironment.java:53)
at
dbfit.api.AbstractDbEnvironment.connect(AbstractDbEnvironment.java:78)
at
dbfit.fixture.DatabaseEnvironment.connect(DatabaseEnvironment.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497) at
fitlibrary.closure.MethodClosure.invoke(MethodClosure.java:35) at
fitlibrary.closure.MethodClosure.invokeTyped(MethodClosure.java:28)
at
fitlibrary.closure.CalledMethodTarget.invokeTyped(CalledMethodTarget.java:77)
at
fitlibrary.closure.CalledMethodTarget.invokeTyped(CalledMethodTarget.java:95)
at
fitlibrary.closure.CalledMethodTarget.invokeAndWrap(CalledMethodTarget.java:358)
at
fitlibrary.traverse.workflow.caller.ActionCaller.run(ActionCaller.java:37)
at
fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretRow(DoTraverseInterpreter.java:176)
at
fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretAfterFirstRow(DoTraverseInterpreter.java:66)
at
fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretInFlow(DoTraverseInterpreter.java:151)
at fitlibrary.DoFixture.interpretAfterFirstRow(DoFixture.java:47) at
fitlibrary.FitLibraryFixture.doTable(FitLibraryFixture.java:83) at
dbfit.fixture.DatabaseEnvironment.doTable(DatabaseEnvironment.java:22)
at fit.Fixture.interpretFollowingTables(Fixture.java:121) at
fit.Fixture.interpretTables(Fixture.java:107) at
fit.Fixture.doTables(Fixture.java:81) at
fit.FitServer.process(FitServer.java:81) at
fit.FitServer.run(FitServer.java:56) at
fit.FitServer.main(FitServer.java:41)
Is anyone facing similar issue?
Appreciate your help.
Thanks

I missed below step:
(http://dbfit.github.io/dbfit/docs/database-specific-information.html#microsoft-sql-server)
Microsoft SQL Server
Deploying the JDBC Driver
Download MS SQL Server JDBC driver from their site (It is not open source and cannot be distributed with DbFit.)
Deploy sqljdbc4.jar in DbFit’s lib folder - the same folder as dbfit-XXX.jar.
Deploy auth\x86\sqljdbc_auth.dll in %programfiles(x86)%\Java\jre7\bin folder to allow integrated windows authentication
Then use connetion as
!|DatabaseEnvironment|sqlserver|
|Connect|jdbc:sqlserver://myhost;integratedSecurity=true|
and it worked.

Related

How to connect IntelliJ IDEA with a free Jira instance?

My team has a Jira project on Atlassian servers. How can I connect that project with IntelliJ IDEA IDE?
When creating a connection from IntelliJ to Atlassian, I need the server name and username with credentials.
What is in this case the value of the Server URL?
Here is my error log:
com.atlassian.theplugin.commons.remoteapi.RemoteApiException: my_username:[password XX chars]#https://instance.atlassian.net
Login failed
at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.wrapWithRemoteApiException(JiraRestSessionImpl.java:800)
at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.login(JiraRestSessionImpl.java:180)
at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.testConnection(JiraRestSessionImpl.java:762)
at com.atlassian.connector.commons.jira.JiraRESTFacade2Impl.testServerConnection(JiraRESTFacade2Impl.java:329)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.connector.commons.jira.JIRAServerFacade2Impl$1.invoke(JIRAServerFacade2Impl.java:91)
at com.sun.proxy.$Proxy40.testServerConnection(Unknown Source)
at com.atlassian.connector.commons.jira.JIRAServerFacade2Impl.testServerConnection(JIRAServerFacade2Impl.java:268)
at com.atlassian.theplugin.commons.jira.IntelliJJiraServerFacade.testServerConnection(IntelliJJiraServerFacade.java:473)
at com.atlassian.theplugin.idea.config.serverconfig.ProductConnector.connect(ProductConnector.java:35)
at com.atlassian.theplugin.ConnectionWrapper.run(ConnectionWrapper.java:63)
Caused by: com.atlassian.jira.rest.client.RestClientException: Login failed
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:82)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.postAndParse(AbstractJerseyRestClient.java:140)
at com.atlassian.jira.rest.client.internal.jersey.JerseySessionRestClient.login(JerseySessionRestClient.java:54)
at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.wrapWithRemoteApiException(JiraRestSessionImpl.java:797)
... 13 more
Caused by: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 401
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:607)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:507)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$4.call(AbstractJerseyRestClient.java:144)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68)
... 16 more
For everyone looking how to connect JIRA without the Atlassian Connector, there is already a simple build-in solution in IntelliJ IDEA:
Normally you don't have to edit the "Search".
And it's also available via the top menu "Tools" -> "Tasks & Contexts" -> "Configure Servers..."
You can get the url by login into your Jira account via a browser; the Server URL is the the first section of the URL before the '/'.
Example:
https://example.atlassian.net/secure/Dashboard.jspa
Server URL = https://example.atlassian.net
Update:
Also note that Atlassian has stopped support for IDE Connectors since 20 April 2015, developer.atlassian.com/blog/2015/06/… ,so I would consider rather connecting your IntelliJ to Jira thorugh other means, such as GitHub via WebHooks
Server url is something like: https://aleksandar.atlassian.net

Facing issue while connecting to hsql server if I create hsql server through java code

I want to create hsql server through java code.I dont want to use server.properties to specify my properties. Instead I am trying to specify properties through HSQLProperties.
Below is my code for creating server.
HsqlProperties p = new HsqlProperties();
p.setProperty("server.database.0","file:/sampledb/ipl5;user=user;password=password");
p.setProperty("server.dbname.0","ipl5");
Server server = new Server();
server.setProperties(p);
but when I try to connect to the started server through client call ,
conn = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/ipl5","user","password");
I get following stacktrace:
java.sql.SQLException: General error: database alias does not exist
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.test.hsql.HSQLSample.main(HSQLSample.java:41)
When I specify properties in server.properties file and then connect using jdbc call , I am successful. But I am not getting reason , why I am getting error when I specify all properties while creating server itself in java code.
Can anyone help me?

Getting "java.lang.NoClassDefFoundError: weblogic/application/ApplicationStateListener" while deploying application into Weblogic server

Getting NoClassDefFoundError after adding listener "ADFApplicationStateListener" in weblogic-appliations.xml.
Earlier weblogic-applications.xml has listener "ADFApplicationLifecycleListener". I am able to deploy the application with this listener.
But as per the mandates specified in the section "Custom ADF application Deployment requirements" of JDeveloper documentation in the below link, I have configured with the "ADFApplicationStateListener" listener.
http://www.oracle.com/technetwork/developer-tools/jdev/documentation/121200-rn-1917713.html
How can I resolve this error ?
Thanks,
Gopal.
Caused by: java.lang.NoClassDefFoundError: weblogic/application/ApplicationStateListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.FilteringClassLoader.findClass(FilteringClassLoader.java:101)
at weblogic.utils.classloaders.FilteringClassLoader.loadClass(FilteringClassLoader.java:86)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:140)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:104)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
ApplicationStateListener is introduced in Weblogic server as part of following bug fix :-
Here the bug is there is no callback for cleanup the ADF resources while stopping the application in weblogic server.
Actually postStop() method of ApplicationLifecycleListener will do this while removal or undeployment of the application.
But when an application requires only restart, i.e stop the application and start it again (no need to undeploy & deploy) then there is no callback for ADF MDS related resources cleanup.
So, ApplicationStateListener is introduced to have a callback for resource cleanup while stopping the application.
My Weblogic server(version 10.3.6.0) is not applied with the patch (patch 56MM) which has the above bug fix.
So, if want to continue with ApplicationStateListener I have to apply the patch, otherwise I have to continue with the ApplicationLifecycleListener.

Pentaho BI-Server JDBC Exception

I'm setting up the pentaho bi-server and I get the following exception when I run start-pentaho.sh:
11:45:29,280 ERROR [SchemaUpdate] could not get database metadata
java.sql.SQLException: socket creation error
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:27)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:127)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
I think that I must have missed adding my database username/password and hostname into a configuration file. However, I don't know which of the several pentaho configuration files that I missed updating. From the stacktrace, does anyone have any suggestions about which pentaho file I need to update with my correct db credentials? Thanks.
Update - the three configuration files that I already updated were:
pentaho-solutions/system/hibernate/mysql5.hibernate.cfg.xml
pentaho-solutions/system/hibernate/hibernate-settings.xml
pentaho-solutions/system/applicationContext-spring-security-jdbc.xml
Sounds like you needed to update the file pentaho-solutions/system/applicationContext-spring-security-hibernate.propertie‌​s!
Do you have jdbc libarry in to tomcat/lib ?
I do not know this can help you but I try http://anonymousbi.wordpress.com/2012/10/28/pentaho-bi-server-4-5-0-definitive-mysql-installation-guide/

NullPointerException while raise an embedded ldap server using spring

I'm trying to raise the Spring Embedded Ldap Server using:
But I'm keep on getting this exception:
2010-06-10 14:33:35,559 ERROR main ApacheDSContainer start - Server startup failed
java.lang.NullPointerException
at org.apache.directory.server.core.schema.DefaultSchemaService.initialize(DefaultSchemaService.java:382)
at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1425)
at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:907)
at org.springframework.security.ldap.server.ApacheDSContainer.start(ApacheDSContainer.java:160)
at org.springframework.security.ldap.server.ApacheDSContainer.afterPropertiesSet(ApacheDSContainer.java:113)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4212)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
I'm using spring 3.0.2 and added the following jars for the ldap:
spring-security-ldap-3.0.2.RELEASE.jar
spring-ldap-1.3.0.RELEASE-all.jar
apacheds-all-1.5.6.jar
shared-ldap-0.9.15.jar
slf4j-api-1.5.6.jar
slf4j-simple-1.5.6.jar
Help please....
#Zorkus: I'm not sure exactly what kind of problem you came across with Apache Directory, and what is the root cause of that, but if all you need is a working embedded java LDAP server for integration testing with Spring Security then you might want to consider some alternatives.
I've recently started to investigate for alternatives, because I couldn't achieve with Apache Directory what I wanted despite a lot of time and effort invested. (I basically wanted to replicate the schema and the user database of an Active Directory instance into an embedded server.)
What I found is that the UnboundID LDAP SDK is a nice replacement. Integrating with it requires a bit more effort than a one-liner in your spring context (like <security:ldap-server/>), but not much more. Starting up an LDAP server requires just a few lines of code:
InMemoryDirectoryServerConfig config =
new InMemoryDirectoryServerConfig("dc=example, dc=com");
// schema config only necessary if the standard
// schema provided by the library doesn't suit your needs
config.setSchema(Schema.getSchema("your-custom-schema.schema"));
// listener config only necessary if you want to make sure that the
// server listens on port 33389, otherwise a free random port will
// be picked at runtime - which might be even better for tests btw.
config.setListenerConfigs(
new InMemoryListenerConfig("myListener", null, 33389, null, null, null));
InMemoryDirectoryServer ds = new InMemoryDirectoryServer(config);
ds.startListening();
// import your test data from ldif files
ds.importFromLDIF(true,"content.ldif");
The only dependency you will need for this to work is:
<dependency>
<groupId>com.unboundid</groupId>
<artifactId>unboundid-ldapsdk</artifactId>
<version>2.3.1</version>
</dependency>
It would be pretty easy to wrap the above code in a class that you can instantiate and configure from your Spring context.
For documentation and code examples on the UnboundID LDAP SDK see: https://www.unboundid.com/products/ldap-sdk/docs/
(I'm not affiliated with UnboundID in any way.)
Check whether the authorization state used by the LDAP client has access to the schema.