Problems installing appdynamics - linux

I have installed Appdynamics lite on my server and it worked fine when I used to run my tomcat instance with root user. But from the time I have created a new user "Tomcat" and start executing my apache tomcat with this user, I am not able to run appdynamics. I have copied the javaagent at this location with all rights(read,write,execute) to tomcat "/home/tomcat/profiler/AppServerLite". It throws an exception as follows :
Install Directory resolved to[/home/tomcat/profiler/AppServerLite]
java.lang.RuntimeException: Invalid Agent Installation Directory [/home/tomcat/profiler/AppServerLite]
at com.singularity.ee.agent.appagent.AgentEntryPoint.addThirdPartyURLs(AgentEntryPoint.java:190)
at com.singularity.ee.agent.appagent.AgentEntryPoint.premain(AgentEntryPoint.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:343)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:358)
Install Directory resolved to[/home/tomcat/profiler/AppServerLite]
java.lang.RuntimeException: Invalid Agent Installation Directory [/home/tomcat/profiler/AppServerLite]
at com.singularity.ee.agent.appagent.AgentEntryPoint.addThirdPartyURLs(AgentEntryPoint.java:190)
at com.singularity.ee.agent.appagent.AgentEntryPoint.premain(AgentEntryPoint.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:343)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:358)
18 Apr, 2013 1:57:03 PM org.apache.catalina.core.AprLifecycleListener init

You should copy all files to run the agent, not just javaagent.jar.
This is a thread about it. http://appsphere.appdynamics.com/t5/Lite-for-Java/Keep-getting-a-quot-Invalid-Agent-Installation-Directory-quot-on/td-p/1151

A great place to ask this question would be on the AppDynamics discussion forums so that AppDynamics support can answer you directly... http://appsphere.appdynamics.com/t5/Discussions/ct-p/Discussions
I'm guessing there is a permissions issue somewhere.

Related

Error when connecting mylyn Gitlab connector to Eclipse

I'm trying to configure the Mylyn Gitlab Connector for Eclipse Oxygen v4.7.1a but when I try to add a new task it throws me an exception and it does not let me continue with the creation of the new task.
Enter correctly my data and the url address of the gitlab repository and even probe with several url and with all of them throw me the same exception.
Exception Stack Trace:
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:398)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:980)
at org.eclipse.mylyn.tasks.ui.wizards.NewTaskWizard.performFinish(NewTaskWizard.java:113)
at org.eclipse.mylyn.internal.tasks.ui.wizards.SelectRepositoryPage.performFinish(SelectRepositoryPage.java:295)
at org.eclipse.mylyn.internal.tasks.ui.wizards.MultiRepositoryAwareWizard.performFinish(MultiRepositoryAwareWizard.java:53)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:778)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:417)
at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:81)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5268)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1348)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4522)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4107)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
at org.eclipse.jface.window.Window.open(Window.java:794)
at org.eclipse.mylyn.tasks.ui.TasksUiUtil.openNewTaskEditor(TasksUiUtil.java:237)
at org.eclipse.mylyn.tasks.ui.TasksUiUtil.openNewTaskEditor(TasksUiUtil.java:253)
at org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction.run(NewTaskAction.java:95)
at org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction.run(NewTaskAction.java:102)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:247)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5268)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1348)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4522)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4107)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.Error: de.weingardt.mylyn.gitlab.core.exceptions.GitlabException: Invalid path in host
at de.weingardt.mylyn.gitlab.core.GitlabTaskDataHandler.getAttributeMapper(GitlabTaskDataHandler.java:67)
at org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal.createTaskData(TasksUiInternal.java:872)
at org.eclipse.mylyn.tasks.ui.wizards.NewTaskWizard$1.run(NewTaskWizard.java:103)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: de.weingardt.mylyn.gitlab.core.exceptions.GitlabException: Invalid path in host
at de.weingardt.mylyn.gitlab.core.exceptions.GitlabExceptionHandler.handle(GitlabExceptionHandler.java:20)
at de.weingardt.mylyn.gitlab.core.ConnectionManager.validate(ConnectionManager.java:139)
at de.weingardt.mylyn.gitlab.core.ConnectionManager.get(ConnectionManager.java:159)
at de.weingardt.mylyn.gitlab.core.ConnectionManager.get(ConnectionManager.java:45)
at de.weingardt.mylyn.gitlab.core.GitlabTaskDataHandler.getAttributeMapper(GitlabTaskDataHandler.java:65)
... 3 more
Any suggestions on how to solve this problem?
Right click on Mylyn repository and select Repository -> Properties
Expand Additional Settings and check "Use private token"
works well for me.
Eclipse Oxygen.2 Release (4.7.2)

Running maven in virtual box seems be causing issues with its libraries

I am running maven 3.3.9 in virtual box with JDK8
and when I run the 'mvn' command from the terminal I get the following error:
constituent[25]: file:/usr/share/maven/lib/guice.jar
constituent[26]: file:/usr/share/maven/lib/eclipse-aether-impl.jar
constituent[27]: file:/usr/share/maven/lib/guava.jar
constituent[28]: file:/usr/share/maven/lib/commons-lang3.jar
constituent[29]: file:/usr/share/maven/lib/wagon-http-shaded.jar
constituent[30]: file:/usr/share/maven/lib/javax.inject.jar
constituent[31]: file:/usr/share/maven/lib/maven-compat-3.x.jar
constituent[32]: file:/usr/share/maven/lib/commons-io.jar
constituent[33]: file:/usr/share/maven/lib/plexus-interpolation.jar
constituent[34]: file:/usr/share/maven/lib/commons-lang.jar
constituent[35]: file:/usr/share/maven/lib/plexus-utils.jar
constituent[36]: file:/usr/share/maven/lib/plexus-cipher.jar
constituent[37]: file:/usr/share/maven/lib/wagon-provider-api.jar
constituent[38]: file:/usr/share/maven/lib/wagon-http-shared.jar
constituent[39]: file:/usr/share/maven/lib/eclipse-aether-transport-wagon.jar
constituent[40]: file:/usr/share/maven/lib/sisu-plexus.jar
constituent[41]: file:/usr/share/maven/conf/logging/
---------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: javax/inject/Provider
at org.apache.maven.cli.MavenCli.container(MavenCli.java:545)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:281)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: javax.inject.Provider
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 11 more
I read a few forums and they all suggest upgrading the JDK but I am already on the latest version. :-(
can someone please guide me with this issue.
The same version on windows machine works fine with same JDK

Having trouble starting Jenkins: "java.io.FileNotFoundException: /usr/share/java/jenkins/war/META-INF/MANIFEST.MF (No such file or directory)"

I just downloaded the Jenkins WAR, version 1.651.1. I’m trying to set it up on my Amazon Linux box. I’m running Java 1.7. I moved the WAR into its own directory, /usr/share/java/jenkins, and then set JENKINS_HOME to be that directory. Then I ran the command listed here — https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins. Looked so simple on the web site. But I got the below error:
[davea#mydevbox ~]$ java -jar /usr/share/java/jenkins/jenkins.war
Running from: /usr/share/java/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Apr 19, 2016 9:29:34 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /usr/share/java/jenkins/war/META-INF/MANIFEST.MF (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:145)
at winstone.Launcher.main(Launcher.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:307)
at Main.main(Main.java:98)
What else do I need to do to get Jenkins started?
Edit: Output in response to the suggestion given ...
[davea#mydevbox ~]$ sudo useradd jenkins
[davea#mydevbox ~]$ sudo chown -R jenkins:jenkins /usr/share/java/jenkins/jenkins.war
[davea#mydevbox ~]$
[davea#mydevbox ~]$ sudo su - jenkins
[jenkins#mydevbox ~]$ java -jar /usr/share/java/jenkins/jenkins.war
Running from: /usr/share/java/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Apr 21, 2016 4:46:08 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /usr/java/jboss/standalone/deployments/jenkins.war/war/META-INF/MANIFEST.MF (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:145)
at winstone.Launcher.main(Launcher.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:307)
at Main.main(Main.java:98)
I think it is a permission related issue.
I guess the user and group owner isset to a different user than what jenkins was trying to run as. Try to set it correctly with:
$sudo chown -R <jenkins_user><jenkins_group> /usr/share/java/jenkins/
“java.io.FileNotFoundException: /usr/share/java/jenkins/war/META-INF/MANIFEST.MF (No such file or directory)”
Guys be chill.
Just run below command.
mkdir /var/cache/jenkins;chown jenkins:jenkins /var/cache/jenkins;
and the start the app.
I had exactly the same issue. Unable to change the user, I changed the hosted port by appending --httpPort=9090 to my java run command.
$ java -jar /usr/share/java/jenkins/jenkins.war --httpPort=9090
My two cents: not only must be jenkins user be the owner of $JENKINS_HOME, it looks like it also has to be the owner of jenkins.war (not just have access to it). Found out the hard way while configuring sytemd unit file for Jenkins.
Probably the userid that you are using is not the owner of JENKINS_HOME.
This has happened to me on Vagrant, when trying to use the jenkins user on a JENKINS_HOME owned by vagrant. jenkins did have write permissions to on JENKINS_HOME, but it is not enough: it has to be the owner.
I learned this because when I tried sudo -u jenkins touch file-in-jenkins-home I got touch: setting times (...): Operation not permitted. And then I found https://unix.stackexchange.com/questions/64848/cannot-touch-m-a-writable-file
In my case, I had this problem because a user named "jenkins" was already created on my Mac.
After:
uninstalling the broken Jenkins with '/Library/Application
Support/Jenkins/Uninstall.command',
removing the "jenkins" user,
and re-installing from https://jenkins.io/download
--> everything worked smoothly.
I was facing the same issue after i accidently deleted the cache from /var/cache/jenkins. I resolved it by manually creating the jenkins folder in /var/cache/ with the same permission which is there in /var/lib/jenkins and it worked.
I have an old jenkins version 1.641, and downloaded the war file of 2.240.1, when run
java -jar jenkins.war
I got similar errors:
java.io.FileNotFoundException:
c:\jenkins.jenkins\war\META-INF\MANIFEST.MF (Access is denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:278)
at winstone.HostConfiguration.(HostConfiguration.java:81)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.(HostGroup.java:45)
at winstone.Launcher.(Launcher.java:172)
at winstone.Launcher.main(Launcher.java:362)
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 Main._main(Main.java:375)
at Main.main(Main.java:151) 2020-02-07 22:06:19.010+0000 [id=1] SEVERE winstone.Logger#logInternal: Container startup
failed java.io.FileNotFoundException:
c:\jenkins.jenkins\war\META-INF\MANIFEST.MF (Access is denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:278)
at winstone.HostConfiguration.(HostConfiguration.java:81)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.(HostGroup.java:45)
at winstone.Launcher.(Launcher.java:172)
at winstone.Launcher.main(Launcher.java:362)
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 Main._main(Main.java:375)
at Main.main(Main.java:151)
it is found that the folder c:\jenkins\.jenkins\war did not exist.
After manually created the folder, the new Jenkins works.

jhipster RDS connection issue

I'm trying to deploy to AWS an application developed with JHipster, but I get an error when trying to do so. It looks like I'm unable to connect to the database.
I created a simple JSP page that connects directly to the database via jdbc and it works fine, so it seems I'm doing something wrong when configuring the application.
This is my current application.yml:
spring:
profiles:
active: prod
datasource:
dataSourceClassName: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
url: jdbc:mysql://rds_url:3306/db?user=user&password=password
databaseName: db
serverName: rds_url
username: user
password: password
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
And this is what I see in the logs:
Caused by: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization
at com.zaxxer.hikari.pool.BaseHikariPool.initializeConnections(BaseHikariPool.java:542)
at com.zaxxer.hikari.pool.BaseHikariPool.<init>(BaseHikariPool.java:171)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:60)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:48)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
at com.test.config.DatabaseConfiguration.dataSource(DatabaseConfiguration.java:83)
at com.test.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$b2394f0e.CGLIB$dataSource$1(<generated>)
at com.test.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$b2394f0e$$FastClassBySpringCGLIB$$e28d8821.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at com.test.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$b2394f0e.dataSource(<generated>)
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 org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 137 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1038)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:338)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2237)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2270)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2069)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:422)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:134)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:105)
at com.zaxxer.hikari.pool.BaseHikariPool.addConnection(BaseHikariPool.java:438)
at com.zaxxer.hikari.pool.BaseHikariPool.initializeConnections(BaseHikariPool.java:540)
... 152 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:213)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:297)
... 169 more
Here's a link to more detailed logs.
Any help will be deeply appreciated.
Thanks,
Jodevan.
Alright. I made it work.
In order to test if there was some problem in the yml configuration file, I decided hard-coding the database properties directly in the DatabaseConfiguration.java file and it simply worked!
When the home page was rendered, my surprise: development mode!
I have no idea how this happened, since the package was supposed to be generated with the production profile activated. This is how the package was being generated as described here:
mvn -Pprod package
But I forgot that I also need to set this environment property in Tomcat.
By the way, since this is an Tomcat environment property, it's needed to restart your EBS environment.
Last but not least, make sure your RDS has a security group that allows connection from the EC2 where your EBS is configured.

cassandra snapshot : Unable to create hard link from errno 1

i'm using cassandra 1.2.8 in ubuntu 12.4.
i used snapshot command already and backing up process was ok!
but now when i use this command i get error like below:
Exception in thread "main" FSWriteError in /var/lib/cassandra/data/english/word_doc /snapshots/1393155090911/english-word_doc-ic-10-Index.db
at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:80)
at org.apache.cassandra.io.sstable.SSTableReader.createLinks(SSTableReader.java:1063)
at org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:1566)
at org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:1611)
at org.apache.cassandra.db.Table.snapshot(Table.java:194)
at org.apache.cassandra.service.StorageService.takeSnapshot(StorageService.java:2205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:74)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:277)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:226)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:253)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:856)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:805)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1476)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:98)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1317)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1409)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:839)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: Unable to create hard link from /var/lib/cassandra/data/english/word_doc/english-word_doc-ic-10-Index.db to /var/lib/cassandra/data/english/word_doc/snapshots/1393155090911/english-word_doc-ic-10-Index.db (errno 1)
at org.apache.cassandra.utils.CLibrary.createHardLink(CLibrary.java:174)
at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:76)
... 40 more
note: my current data base is a back up version that i restore in my cassandra!
thanks for your help :)
edit: i have two keyspace,A and B. B is a back up version that i restore and store more data on it, but A is not. i can create back up from A with out any problem,but for B i get above error!
this seems to be an ubuntu 12.04 security issue on hard-links.
use this command to disable that:
sudo sysctl -w kernel.yama.protected_nonaccess_hardlinks=0
and after restore, reset it to its original value:
sudo sysctl -w kernel.yama.protected_nonaccess_hardlinks=1
After struggling with this issue again I found that I had a few root-owned files inside /var/lib/cassandra/data/.../etcetera, which triggered the hard link access restriction.
Recursively chowning all directories and files inside /var/lib/cassandra/data solved the problem.

Resources