unable to start hsql database - hsqldb

I'm trying to start the hsqldb using this command:
java -classpath ..\war\WEB-INF\lib\hsqldb.jar org.hsqldb.Server -database test
This is taken from http://static.springsource.org/docs/Spring-MVC-step-by-step/part5.html - section "5.1. Create database startup script"
This is the error I get:
C:\Projects3\springapp\db>java -classpath ..\war\WEB-INF\lib\hsqldb.jar org.hsql
db.Server -database
[Server#e0e1c6]: [Thread[main,5,main]]: checkRunning(false) entered
[Server#e0e1c6]: [Thread[main,5,main]]: checkRunning(false) exited
[Server#e0e1c6]: [Thread[main,5,main]]: Failed to set properties
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at java.lang.String.substring(String.java:1904)
at org.hsqldb.server.ServerProperties.validateMultiProperty(Unknown Sour
ce)
at org.hsqldb.server.ServerProperties.validate(Unknown Source)
at org.hsqldb.server.Server.setProperties(Unknown Source)
at org.hsqldb.server.Server.main(Unknown Source)
Is this not the correct way to start a hsql database?

Try this:
java -classpath ..\war\WEB-INF\lib\hsqldb.jar org.hsqldb.Server --database.0 test

Related

Liquibase: update throwing sl4j.Logger class not found exception

I am trying to run liquibase update in Windows by providing the details such as classpath, dialect,url,user, password and I am getting an sl4j.Logger class not found exception.
The command looks like this
java -jar liquibase.jar update --classpath=mypath ...
The sl4j jar is present in the lib package of my liquibase.
What should I do to solve the error.
The error log is as follows:-
Exception in thread "main" java.lang.NoClassDefFoundError:
org/slf4j/LoggerFactory at
liquibase.logging.core.Slf4JLoggerFactory.getLog(Slf4JLoggerFactory.java:9)
at liquibase.logging.LogService.getLog(LogService.java:39)
at liquibase.integration.commandline.Main.<clinit>(Main.java:61)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
When I try to run through bat file with the command
liquibase update --changeLogFile=C:\Desktop\migrate\update-test\changelog\databasechangelog.xml --driver=org.hibernate.dialect.PostgreSQLDialect --classpath=C:\Desktop\migrate\update-test\postgresql --url=jdbc:postgresql://myserver:5432/ --username=postgres --password=postgres --logLevel=debug
, I am getting unexpected params error
unexpected command parameters: [--changeLogFile=C:Desktop\migrate\update-test\changelog\databasechangelog.xml, --driver=org.hibernate.dialect.PostgreSQLDialect, --classpath=C:\migrate\update-test\postgresql, --url=jdbc:postgresql://myserver.COM:5432/, --username=postgres, --password=postgres]
What have I done wrong here?
In the future, it is helpful if you include the full error in your question.
That said, you might be seeing the same thing as in this question: unable to use liquibase standalone shell script

Error during SonarQube Scanner execution - Illegal argument exception

I installed SonarQube 6.1 with MSBuild.SonarQube.Runner-2.2.0.24 to analyse a C# solution. When I run an analysis, I get the following error:
WARN: SCM provider autodetection failed. No SCM provider claims to
support this project. Please use sonar.scm.provider to define SCM of
your project.
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: Start pointer [line=90,
lineOffset=89] should be before end pointer [line=90, lineOffset=89]
at
org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at
org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers(DefaultInputFile.java:254)
at
org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:238)
at
org.sonarsource.dotnet.shared.plugins.AbstractSensor$SarifParserCallbackImplementation.onIssue(AbstractSensor.java:144)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.handleAnalysisTargetElement(SarifParser01And04.java:109)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.handleIssue(SarifParser01And04.java:73)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.handleIssues(SarifParser01And04.java:55)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.parse(SarifParser01And04.java:43)
at
org.sonar.plugins.csharp.CSharpSensor.importRoslynReport(CSharpSensor.java:183)
at
org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:118)
at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:85)
at
org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at
org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
at
org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
at
org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at
org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at
org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)
at
org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)
at
org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:240)
at
org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47) at
org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at
org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118) at
org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source) at
org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at
org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110) at
org.sonarsource.scanner.cli.Main.execute(Main.java:74) at
org.sonarsource.scanner.cli.Main.main(Main.java:61) ERROR: ERROR:
Re-run SonarQube Scanner using the -X switch to enable full debug
logging. The SonarQube Scanner did not complete successfully
08:42:09.074 Post-processing failed. Exit code: 1
When I start the SonarQube Scanner with the -X like it was recommended in the error message, I get this:
2016-11-14T14:33:27.2720044Z ##[error]15:33:27.238 Unrecognized command line argument: -X
2016-11-14T14:33:27.2720044Z ##[error]15:33:27.261 Expecting at least the following command line argument:
2016-11-14T14:33:27.2730045Z ##[error]- SonarQube project key
2016-11-14T14:33:27.2730045Z ##[error]When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
2016-11-14T14:33:27.2740046Z ##[error]- SonarQube project name
2016-11-14T14:33:27.2740046Z ##[error]- SonarQube project version
2016-11-14T14:33:27.2750047Z ##[error]The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
2016-11-14T14:33:27.2750047Z ##[error]15:33:27.261 Pre-processing failed. Exit code: 1
I start the scanner with:
SonarQube.Scanner.MSBuild.exe begin /k:ProjectKey /n:ProjectName /v:4.0.70
The end command is
SonarQube.Scanner.MSBuild.exe end
Start is definively called before end.
What could be wrong?
I've stumbled in the same trouble and it could be caused by a not UTF-8 or a BOM enabled UTF-8 encoding, see here for reference:
Analysis of Visual Studio Solutions containing some C# source files using a non UTF-8 encoding fails
As a possible WA waiting for a fix, try to force source encoding to UTF-8 and, if not enough, to explicitly convert your sources to BOM-less UTF-8 encoding.
I have same problem and I found some issue in the code source.
public class Myclass : BaseClass
{
public Myclass(OtherClass inputs) : base() => Initialize(); //OK
public Myclass(OtherClass inputs) : base() => Initialize(inputs); //NOK
//Sonar cannot analyze this method because of arguments insides Initiliaze //method with inline method only when I use : base(...) => Func(With Arguments);
//Solution is
public Myclass(OtherClass inputs) : base()
{
Initialize(inputs);}
}
}

ClassNotFoundException when trying to run pan.bat with cmd

I want to create a Windows script that runs a Kettle transformation (.ktr).
First, I tried to run my script but it does nothing.
After that, I decided to try it by cmd, but it still is not working. It outputs a ClassNotFoundException:
Exception in thread "main" java.lang.ClassNotFoundException: org.pentaho.di.pan.Pan/file:C:\data-integration\UpdateDBUrgencies.ktr
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:87)
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
The cmd line I run is:
pan.bat /file:"C:\data-integration\UpdateDBUrgencies.ktr" /level:Basic
All I want is to have an script that executes UpdateDBUrgencies.ktr, so it can be run everyday using cron of Windows. How do I have to do it? Where is the problem in my command line?
Thanks for your help.
As a personal experience with .BAT for running .KJB's on windows, i had several issues when using /file or /level, try changing your commandline for:
Pan.bat -file:C:/data-integration/UpdateDBUrgencies.ktr "-level:Basic"
I have begun using this format of command line for all my batches and it's been working without erros, i'm using version 5.3 though, i don't know if there are major differences in command line paramaters and such on newer versions.

Jenkins build failed on OSX

I am trying to build my project using Jenkins to deploy the artifacts to the nexus. I have a Jenkins setup on my macOSX.
below is the error, I am getting:
Parsing POMs
[maventest] $
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
-Xmx512m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 -cp /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.3.jar:/usr/share/maven/boot/plexus-classworlds-2.4.jar
org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven
/Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-2.26.jar
/Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.3.jar
59985
<===[JENKINS REMOTING CAPACITY]===>channel started
channel stopped
ERROR: Failed to parse POMs java.io.IOException: Remote call on
Channel to Maven
[/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java,
-Xmx512m, -XX:MaxPermSize=128m, -Dfile.encoding=UTF-8, -cp, /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.3.jar:/usr/share/maven/boot/plexus-classworlds-2.4.jar,
org.jvnet.hudson.maven3.agent.Maven3Main, /usr/share/maven,
/Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-2.26.jar,
/Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.3.jar,
59985] failed at hudson.remoting.Channel.call(Channel.java:727) at
hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156) at
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:770)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
at hudson.model.Run.execute(Run.java:1593) at
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491) at
hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247) Caused by:
java.lang.InternalError: Can't connect to window server - not enough
permissions. at java.lang.ClassLoader$NativeLibrary.load(Native
Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724) at
java.lang.Runtime.loadLibrary0(Runtime.java:823) at
java.lang.System.loadLibrary(System.java:1045) at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method) at
java.awt.Toolkit.loadLibraries(Toolkit.java:1605) at
java.awt.Toolkit.(Toolkit.java:1627) at
java.awt.Color.(Color.java:263) at
hudson.util.ColorPalette.(ColorPalette.java:39) at
hudson.model.BallColor.(BallColor.java:56) at
hudson.model.Result.(Result.java:51) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:171) at
com.sun.proxy.$Proxy8.(Unknown Source) at
sun.reflect.GeneratedSerializationConstructorAccessor41.newInstance(Unknown
Source) at
java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
java.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:929) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1759)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at java.util.HashMap.readObject(HashMap.java:1030) 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
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:979)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at hudson.remoting.UserRequest.deserialize(UserRequest.java:182) at
hudson.remoting.UserRequest.perform(UserRequest.java:98) at
hudson.remoting.UserRequest.perform(UserRequest.java:48) at
hudson.remoting.Request$2.run(Request.java:326) at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680) Finished: FAILURE
I already tried the below solution but it didn't work:
http://jenkins-ci.361315.n4.nabble.com/JIRA-Created-HUDSON-5584-java-io-IOException-Remote-call-on-Channel-to-Maven-td1475049.html
Configurations I have:
MAVEN_OPTS:-Xmx1024m
-XX:MaxPermSize=128m
-Dfile.encoding=UTF-8
-Djava.awt.headless=true
output of ps -ef | grep java: /usr/bin/java -Djava.awt.headless=true -jar /Applications/Jenkins/jenkins.war
build command:clean deploy -DaltDeploymentRepository=central::default::http://<user>:<pwd>#<host>:<port>/nexus/content/groups/public/
The solution I used was to apply Java 7. What you want to do is add 1.7 to Jenkins. Following these steps I was able to successfully build my project:
Go to the Oracle Java page and downloaded the 1.7_51 jdk for Mac.
Opened the dmg and ran the executable.
On the Mac, this installs the JDK to /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/
In Jenkins, go to 'Manage Jenkins' > 'Configure System'
Under the JDK heading, click the button that says JDK Installations
Under Name type 'JDK 1.7.0_51'
For JAVA_HOME type '/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/'
Select Save
Go to your project and select Configure
You should now have a JDK drop down near the top of the page.
Select the JDK you just configured under 'Manage Jenkins'
Run the build
After doing this, my build successfully ran without the 'Can't connect to window server - not enough permissions error.'
This line looks curious:
hudson.model.Executor.run(Executor.java:247) Caused by: java.lang.InternalError:
Can't connect to window server - not enough permissions. at java.lang.ClassLoader
$NativeLibrary.load(Native Method)
I would start with a simpler project, and then add complexity from that point, for the reason of just testing to make sure your basic assumptions are correct.
You might need to set the JVM property : -Djava.awt.headless=true . By doing that you will disable the (most likely unnecessary) gui libraries that are trying to load.

HSQLDB DbBackup dbPath

I'm trying to create a Offline Backup of my HSQLDB (using HSQLDB 2.2.6.jar) as explained in the HSQLDB User Guide: http://hsqldb.org/doc/2.0/guide/management-chapt.html#N1400A
java -cp path/to/hsqldb.jar org.hsqldb.lib.tar.DbBackup --save \
tar/path.tar db/base/path
But I can't find out where the db/base/path is supposed to point. This is the remark in the User Guide:
db/base/path is the file path to the catalog file base name (in same fashion as in server.database.* settings and JDBC URLs with catalog type file:.
And that's the Error Message I get:
Exception in thread "main" java.io.FileNotFoundException: File not found:
path\to\hsqldb.jar.properties
at org.hsqldb.lib.tar.DbBackup.write(Unknown Source)
at org.hsqldb.lib.tar.DbBackup.main(Unknown Source)
The paths in the Guide must be replaced with the paths that you use. For example if you want to save the backup to the directory named /backupdir/ and your database files are named mydatabase and they are located in in /dbdir/, then the command is:
java -cp hsqldb.jar org.hsqldb.lib.tar.DbBackup --save /backupdir/mydatabase.tar /dbdir/mydatabase