Lead node fails with /tmp/spark-jobserver/filedao/data/jars.data (Permission denied) - snappydata

SnappyData v.0-5
I am logged into Ubuntu as a non-root user, 'foo'.
SnappyData directory/install is owned by 'foo' user and 'foo' group.
I am starting ALL nodes (locator,lead,server) with a script here:
SNAPPY_HOME/sbin/snappy-start-all.sh
Locator starts.
Server starts.
Lead dies with this error.
16/07/21 23:12:26.883 UTC serverConnector INFO JobFileDAO:
rootDir is /tmp/spark-jobserver/filedao/data 16/07/21 23:12:26.888 UTC
serverConnector ERROR JobServer$: Unable to start Spark
JobServer: java.lang.reflect.InvocationTargetException 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:423)
at spark.jobserver.JobServer$.start(JobServer.scala:69) at
io.snappydata.impl.LeadImpl.startAddOnServices(LeadImpl.scala:283) at
io.snappydata.impl.LeadImpl$.invokeLeadStartAddonService(LeadImpl.scala:360)
at
io.snappydata.ToolsCallbackImpl$.invokeLeadStartAddonService(ToolsCallbackImpl.scala:28)
at
org.apache.spark.sql.SnappyContext$.invokeServices(SnappyContext.scala:1362)
at
org.apache.spark.sql.SnappyContext$.initGlobalSnappyContext(SnappyContext.scala:1340)
at org.apache.spark.sql.SnappyContext.(SnappyContext.scala:104)
at org.apache.spark.sql.SnappyContext.(SnappyContext.scala:95)
at
org.apache.spark.sql.SnappyContext$.newSnappyContext(SnappyContext.scala:1221)
at
org.apache.spark.sql.SnappyContext$.apply(SnappyContext.scala:1249)
at
org.apache.spark.scheduler.SnappyTaskSchedulerImpl.postStartHook(SnappyTaskSchedulerImpl.scala:25)
at org.apache.spark.SparkContext.(SparkContext.scala:601) at
io.snappydata.impl.LeadImpl.start(LeadImpl.scala:129) at
io.snappydata.impl.ServerImpl.start(ServerImpl.scala:32) at
io.snappydata.tools.LeaderLauncher.startServerVM(LeaderLauncher.scala:91)
at
com.pivotal.gemfirexd.tools.internal.GfxdServerLauncher.connect(GfxdServerLauncher.java:174)
at
com.gemstone.gemfire.internal.cache.CacheServerLauncher$AsyncServerLauncher.run(CacheServerLauncher.java:1003)
at java.lang.Thread.run(Thread.java:745) Caused by:
java.io.FileNotFoundException:
/tmp/spark-jobserver/filedao/data/jars.data (Permission denied) at
java.io.FileOutputStream.open0(Native Method) at
java.io.FileOutputStream.open(FileOutputStream.java:270) at
java.io.FileOutputStream.(FileOutputStream.java:213) at
spark.jobserver.io.JobFileDAO.init(JobFileDAO.scala:90) at
spark.jobserver.io.JobFileDAO.(JobFileDAO.scala:30) ... 22 more
16/07/21 23:12:26.891 UTC Distributed system shutdown hook
INFO snappystore: VM is exiting - shutting down distributed system
Do I need to be a different user to start the Lead node? Use 'sudo'? Configure a property to tell Spark to use a directory 'foo' has permission to? Create this directory myself ahead of time?

It seems that the current owner of /tmp/spark-jobserver is some other user. Check the permissions on that directory and delete it.
If multiple users will be running leads on the same machine, you can configure the job-server directories to be elsewhere like mentioned here. The relevant properties can be found in application.conf source. This is probably more trouble than worth, so for now it will be easier to just ensure a single user starts the lead nodes on a machine.
We shall be fixing the default to be inside work/ directory in next release (SNAP-69).

Related

MySQL generating keyring via UDF leads to SQLException

This is a question I also raised in DBA Stackexchange. I will post here verbatim:
I am trying to encrypt my tables using a keyring plugin that MySQL suggested. In my /etc/my.cnf file, I have set the early-plugin flag as well as the location of the key ring file. It looks something like this:
[mysqld]
early-plugin-load=keyring_file.so
keyring_file_data=/usr/local/mysql/mysql-keyring/keyring
As root user, I have also installed keyring_udf.so and created some UDFs like so:
INSTALL PLUGIN keyring_udf SONAME 'keyring_udf.so';
CREATE FUNCTION keyring_key_generate RETURNS INTEGER SONAME 'keyring_udf.so';
CREATE FUNCTION keyring_key_fetch RETURNS STRING SONAME 'keyring_udf.so';
CREATE FUNCTION keyring_key_length_fetch RETURNS INTEGER SONAME 'keyring_udf.so';
CREATE FUNCTION keyring_key_type_fetch RETURNS STRING SONAME 'keyring_udf.so';
CREATE FUNCTION keyring_key_store RETURNS INTEGER SONAME 'keyring_udf.so';
CREATE FUNCTION keyring_key_remove RETURNS INTEGER SONAME 'keyring_udf.so';
From here, I attempt to define a key like so:
SELECT keyring_key_generate('MyKey', 'AES', 32);
This leads to the following message from the console:
[2018-06-15 15:11:38] Streaming result set com.mysql.jdbc.RowDataDynamic#15d7e44 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
[2018-06-15 15:11:38] java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic#15d7e44 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:868)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:864)
at com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:3211)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2443)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
at com.mysql.jdbc.ConnectionImpl.setSessionMaxRows(ConnectionImpl.java:5432)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1365)
at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:704)
at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:656)
at com.mysql.jdbc.StatementImpl.getWarnings(StatementImpl.java:2145)
at com.intellij.database.remote.jdbc.impl.RemoteStatementImpl.getWarnings(RemoteStatementImpl.java:86)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
at com.sun.proxy.$Proxy121.getWarnings(Unknown Source)
at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:169)
at com.intellij.execution.rmi.RemoteUtil.access$300(RemoteUtil.java:36)
at com.intellij.execution.rmi.RemoteUtil$RemoteInvocationHandler.invoke(RemoteUtil.java:274)
at com.sun.proxy.$Proxy122.getWarnings(Unknown Source)
at com.intellij.database.console.JdbcEngine.b(JdbcEngine.java:444)
at com.intellij.database.console.JdbcEngine.a(JdbcEngine.java:397)
at com.intellij.database.console.JdbcEngine.b(JdbcEngine.java:224)
at com.intellij.database.console.AbstractEngine.a(AbstractEngine.java:171)
at com.intellij.database.console.AbstractEngine.a(AbstractEngine.java:148)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[2018-06-15 15:11:38] [HY000][3188] Function 'keyring_key_generate' failed because underlying keyring service returned an error. Please check if a keyring plugin is installed and that provided arguments are valid for the keyring you are using.
I have also tried resetting mysql server: systemctl restart mysqld.
The environment is a CentOS server.
After churning for hours trying to get this to work, I have decided to raise the white flag and ask for help from you guys. Thanks for reading/help!
EDIT:
I tried doing the same commands under Windows. Still the same issue with the keyring_udf.dll file. I'm wondering if this is a bug within the plugin? Or is there a crucial MySQL setting I may be missing.
I had the same error and additionally something like the following in my errorlog:
[ERROR] Plugin keyring_file reported: 'File '/usr/local/mysql/mysql-keyring/keyring' not found (Errcode: 13 - Permission denied)'
In my case (i am running ubuntu) it was apparmor that restrict the directory access for mysql (regardless of dir or file permissions) and therefore mysql was not able to read the keyring directory or file.
Maybe CentOS is also using apparmor or has something like that.
Apparmor config file for mysql and Ubuntu already enables access to /var/lib/mysql-keyring/. So you should be able to use this dir directly.
My working config:
[mysqld]
early-plugin-load=keyring_file.so
keyring_file_data=/var/lib/mysql-keyring/keyring
Otherwise you can change or add directories in apparmor in /etc/apparmor.d/usr.sbin.mysqld.
Hope this helps.

How to start drill in distributed mode in window operating system

I am using apache drill in window 10 having latest version (1.9).
I want to start my drill in distributed mode.
I have configure zookeeper zoo.cfg file:-
tickTime=2000
initLimit=10
syncLimit=5
dataDir=F:/zookeepertest/data
clientPort=2181
server.1=192.589.XX.01:2888:3888
server.1=192.565.XX.02:2888:3888
And Drill folder inside drill-override.conf
drill.exec: {
cluster-id: "test",
zk.connect: "192.589.XX.01:2181,192.565.XX.02:2181"
}
And my zookeeper is running..
Now When i trying to start my drill using this command:-
sqlline.bat -u "jdbc:drill:zk=192.589.XX.01:2181"
Its thoughing following error:-
Error: Failure in connecting to Drill: org.apache.drill.exec.rpc.RpcException: Failure setting up ZK for client. (state=,code=0)
java.sql.SQLException: Failure in connecting to Drill: org.apache.drill.exec.rpc.RpcException: Failure setting up ZK for client.
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:161)
at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:70)
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:143)
at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)
at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)
at sqlline.Commands.connect(Commands.java:1083)
at sqlline.Commands.connect(Commands.java:1015)
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 sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
at sqlline.SqlLine.dispatch(SqlLine.java:742)
at sqlline.SqlLine.initArgs(SqlLine.java:528)
at sqlline.SqlLine.begin(SqlLine.java:596)
at sqlline.SqlLine.start(SqlLine.java:375)
at sqlline.SqlLine.main(SqlLine.java:268)
Caused by: org.apache.drill.exec.rpc.RpcException: Failure setting up ZK for client.
at org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:245)
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:154)
... 18 more
Caused by: java.io.IOException: Failure to connect to the zookeeper cluster service within the allotted time of 10000 milliseconds.
at org.apache.drill.exec.coord.zk.ZKClusterCoordinator.start(ZKClusterCoordinator.java:123)
at org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:243)
... 19 more
Can anyone tell how to start drill in distributed mode in window.??
From Drill documentation
To start drill in distributed mode, use drillbit.sh not sqlline i.e.
drillbit.sh start
Since drillbit.sh is a shell script (not a windows batch job) you'll need a 3rd party shell scripting tool such as Cygwin or since you're using Windows 10, you can also enable Bash on Ubuntu.

My account on Cosmos global instance seems to be running out of space - maybe need to increase quota

Trying to run a simple hdfs query failed with:
[ms#cosmosmaster-gi ~]$ hadoop fs -ls /user/ms/def_serv/def_servpath
Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:
/tmp/hsperfdata_ms/21066
Try using the -Djava.io.tmpdir= option to select an alternate temp location.
Exception in thread "main" java.lang.NoClassDefFoundError: ___/tmp/hsperfdata_ms/21078
Caused by: java.lang.ClassNotFoundException: ___.tmp.hsperfdata_ms.21078
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: ___/tmp/hsperfdata_ms/21078. Program will exit.
Any idea how to fix that or increase quota?
Thanks!
ms
Your quota has not been exceeded (see command below), but this was a problem with the cluster. It should be fixed now.
$ hadoop fs -dus /user/ms
hdfs://cosmosmaster-gi/user/ms 90731

Openshift: permission denied while installing New Relic Jar file

I am trying to install new-relic jar to my Openshift application (wildfly cartridge), but it fails with permission denied. Here is the log
\> java -jar newrelic.jar install
Jan 29, 2015 15:01:14 -0500 [64858 1] com.newrelic INFO: Agent is using Logback
***** ( ( o)) New Relic Java Agent Installer
***** Installing version 3.13.0 ...
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf.20150129_150114 (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
at java.io.FileWriter.<init>(FileWriter.java:63)
at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
at com.newrelic.agent.util.EditableFile.backup(EditableFile.java:251)
at com.newrelic.agent.install.SelfInstaller.backup(SelfInstaller.java:125)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:51)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:35)
at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
at com.newrelic.agent.Agent.main(Agent.java:261)
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:483)
at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
at java.io.FileWriter.<init>(FileWriter.java:63)
at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
at com.newrelic.agent.util.EditableFile.write(EditableFile.java:263)
at com.newrelic.agent.util.EditableFile.append(EditableFile.java:240)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:55)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:35)
at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
at com.newrelic.agent.Agent.main(Agent.java:261)
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:483)
at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Added agent switch to start script /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf.20150129_150114 (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
at java.io.FileWriter.<init>(FileWriter.java:63)
at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
at com.newrelic.agent.util.EditableFile.backup(EditableFile.java:251)
at com.newrelic.agent.install.SelfInstaller.backup(SelfInstaller.java:125)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:51)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:37)
at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
at com.newrelic.agent.Agent.main(Agent.java:261)
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:483)
at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Problem writing file to disk
java.io.FileNotFoundException: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
at java.io.FileWriter.<init>(FileWriter.java:63)
at com.newrelic.agent.util.EditableFile.write(EditableFile.java:273)
at com.newrelic.agent.util.EditableFile.write(EditableFile.java:263)
at com.newrelic.agent.util.EditableFile.append(EditableFile.java:240)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEdit(JBoss7SelfInstaller.java:55)
at com.newrelic.agent.install.JBoss7SelfInstaller.backupAndEditStartScript(JBoss7SelfInstaller.java:37)
at com.newrelic.agent.AgentCommandLineParser.installCommand(AgentCommandLineParser.java:138)
at com.newrelic.agent.AgentCommandLineParser.parseCommand(AgentCommandLineParser.java:81)
at com.newrelic.agent.Agent.main(Agent.java:261)
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:483)
at com.newrelic.bootstrap.BootstrapAgent.main(BootstrapAgent.java:84)
Added agent switch to start script /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/bin/standalone.conf
No need to create New Relic configuration file because:
.:. A config file already exists: /var/lib/openshift/544c2c3be0b8cdf8da000253/wildfly/newrelic/newrelic.yml
***** Install successful
***** Next steps:
You're almost done! To see performance data for your app:
.:. Restart your app server
.:. Exercise your app
.:. Log into http://rpm.newrelic.com
Within two minutes, your app should show up, ready to monitor and troubleshoot.
If app data doesn't appear, check newrelic/logs/newrelic_agent.log for errors.
How can I install it? Where can I get permission?
Looks like NewRelic is attempting to create a backup of the WildFly configuration file which it finds at ~/wildfly/bin/standalone.conf. Unfortunately it fails due because the ~/wildfly/bin is locked by the WildFly cartridge as you can see by its permissions and entry in the cartridge's managed_files.yml:
\> ls -ld wildfly/bin/
drwxr-xr-x. 6 root 544c2c3be0b8cdf8da000253 4096 Dec 23 20:01 wildfly/bin/
\> cat wildfly/metadata/managed_files.yml
---
[...]
locked_files:
- bin/
- bin/*
[...]
I see three options, in order of complexity.
See if newrelic.jar accepts an flag to not perform a backup of the config file.
Since it looks like newrelic.jar is trying to automatically modify standalone.conf for you, try running this step on a local environment with WildFly where you do have permissions. Then check in the new standalone.conf to OpenShift git.
Fork the WildFly cart repo and remove the bin/ and bin/* entries from the locked_files key in managed_files.yml. But make sure to create these manually within the cart's bin/setup script, as locking would normally do that for you. See Locking cartridges for more info.

c3p0 - hibernate - mysql

hibernate 3.6.8 final
c3p0 jar that came with hibernate 3.6.8 package -> c3p0-0.9.1.jar
1
15
40
0
5
2
The app seems to be working fine, however I get massive log calls with the following stacktrace:
org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2411)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor38.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:152)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1074)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1061)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1796)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)
Any information on how to remove that INFO log would be very much helpful thanks!
UPDATE: Is this a critical error? Or can should I just ignore it?
After a search on the web regarding this issue, I found some similar issues reported by several people. All of them point to a common problem: Threads. Basically, if you start new threads in your application (either in your code or by using a third party tool like Quartz, you have to make sure that all of the threads are stopped appropriately when the application is undeployed from the server. Here are some quotes from the searches:
Mikolaj Rydzewski wrote:
It looks like after webapp's instance has been undeployed, background quartz thread wants to do something and then exception occurs.
Another (and better explanation) on jspwiki.org:
It is possible that this is caused by Tomcat unsuccessfully reloading the web application. The app is unloaded, but all threads don't get shut down properly. As a result, when the threads try to run, they get clobbered by the fact that Tomcat has shut down its classloader, and an error is logged.
So, in order to solve this issue you have to make sure all threads started by your application will be stopped at application undeployment (or redeployment, it's the same). You can do this by registering a ServletContextListener to your application server and stopping your threads inside contextDestroyed(ServletContextEvent) method.
If you are using log4j, change your logging settings to something like this (the word ERROR replace INFO) :
log4j.rootLogger=ERROR, file, stdout
log4j.logger.org.hibernate=ERROR
They are located in the the log4j.properties file in yr project.
OK I switched to boneCP, c3p0 does not really seem to work for java6!!!