Where is the jar that contains com.springsource.tcserver.serviceability.logging.TcServerLogManager? - tcserver

I have a TC server instance that works fine, however, a different instance created from the same template craps out with:
Could not load Logmanager "com.springsource.tcserver.serviceability.logging.TcServerLogManager"
java.lang.ClassNotFoundException: com.springsource.tcserver.serviceability.logging.TcServerLogManager
and I can't find where the jar that contains it on the instance that works.

I assume you are using tc Runtime 7.0.x? That class is added to the tomcat-juli.jar in the bin directory and the tomcat-juli.jar in the bin/extras directory.
-Jason

Related

How do I import a mySQL database table into Solr 6?

I am trying to import a simple mySQL table into Solr and keep failing.
Having ploughed through:
https://gist.github.com/maxivak/3e3ee1fca32f3949f052
https://wiki.apache.org/solr/DataImportHandler
How to import data from mysql to solr
and half a dozen other posts that are related to Solr4, I am in desperate need of some community help.
I need specific instructions for Solr 6, it's installed on RedHat to connect to a mySQL DB. Thanks a lot.
Please find the steps below..
Install Java Runtime Environment (JRE) version 1.8 for Solr 6.1
Set Java home "export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_101/"
Download solr 6.1 "solr-6.1.0.tgz" from http://www-eu.apache.org/dist/lucene/solr/6.1.0/
Extract tgz file using "tar zxf solr-6.1.0.tgz".
Open the port 8983 as to communicate with solr.
Go to the path ../solr-6.1.0/ and start the server with "bin/solr start"
Create a config folder named myConfig under configsets directory , move the conf folder into it. Add the data-config.xml into "/myConfig/conf".
Modified the schema.xml under the folder "/myConfig/conf" and add the data-config.xml.
add teh entry in solconfig.xml
data-config.xml
Fire the url to create the core.
http://localhost:8983/solr/admin/cores?action=CREATE&name=mycore&instanceDir=my_instance&configSet=myConfig
Add the jars "solr-dataimporthandler-6.1.0.jar", "solr-dataimporthandler-extras-6.1.0.jar" to path "/home/abhijit/Downloads/solr-6.1.0/server/lib".
Add the "solr-core-6.1.0.jar" jar to the path "/home/abhijit/Downloads/solr-6.1.0/server/lib".
Add the "solr-solrj-6.1.0.jar" jar to the path "/home/abhijit/Downloads/solr-6.1.0/server/lib".
If you do the above steps you will ge the error like :
"Error Instantiating requestHandler, org.apache.solr.handler.dataimport.DataImportHandler failed to instantiate org.apache.solr.request.SolrRequestHandler"
This problem occurred because dataimporthandler and requesthandler are loaded by two different class loaders. To solve it, ensure that solr loads its jars only from the same class loader.
Option to steps 5,6,7 create a folder lib inside the solr folder at path "/home/abhijit/Downloads/solr-6.1.0/server/solr"
and add the entry of the same to solrConfig.xml as "".
Comment the other lib entries from solrConfig.xml
the jars "solr-dataimporthandler-6.1.0.jar", "solr-dataimporthandler-extras-6.1.0.jar" to path "/home/abhijit/Downloads/solr-6.1.0/server/solr/lib".
Commented the updateRequestProcessorChain in solrConfig.xml.
Command for full import
http://localhost:8983/solr/mycore/dataimport?command=full-import&clean=true&commit=true
if you have any params to pass on then do something like this
http://localhost:8983/solr/mycore/dataimport?command=full-import&clean=true&commit=true&cabinetId=5654174

java.lang.NoSuchMethodError: com/jcraft/jsch/Session.setDaemonThread(Z)V

i'm using the JSch jar to implement SFTP communication.
downloaded the JSch and using the vfs2 jar.
when running the code on weblogic server - it runs perfectly.
when running it on websphere application server (same code) i'm getting the following exception:
[9/22/14 20:05:39:756 IDT] 00000023 SystemOut O |E |20:05:39 |22 |admin | |com/jcraft/jsch/Session.setDaemonThread(Z)V
java.lang.NoSuchMethodError: com/jcraft/jsch/Session.setDaemonThread(Z)V
at org.apache.commons.vfs2.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:225)
at org.apache.commons.vfs2.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:96)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:103)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:81)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:65)
at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:693)
at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:621)
There is no other jar of JSch with same class. the method exists.
what am i doing wrong? is there any setting that needs to be done in websphere?
it does load the Session class, it previously created it. just this method it does not see - in websphere 7.0.0.19
please advise
thanks
the class Session already existed in some other Astrix jar
because of that , and because it was prior in load configuration, it was loaded before the proper Session class
only when searching the entire C drive using WinRar - it can search in archive properly - i searched for Session.Class and found it
then only left to remove the Astrix jar - that was not in use any how...

class not found com.mysql.jdbc.Driver jdbc when trying to connect to a Mysql Database

I'm developing a web application in java where I'm trying to connect to a MySQL database using JDBC template ( with springs dao) but I always get:
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/DealingOfInsiders] threw exception [Request processing failed;
nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver '] with root cause
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[....]
I think the problem is coming from the file mysql-connector-java-5.1.25-bin.jar which contains the targeted class ...
So I tried many things to get this problem solve :
I've configured the build path of my project whith this jar but it didn't worked
I ve also put the file in the folder : WEB-INF/lib , didn't worked
I ve configured a classpath variable to this jar in eclipse ( preference ->java->buildpath->classpath variabe ) it didn't worked
I have put the jar file in the tomcat library but it didn't work as well
'com.mysql.jdbc.Driver '
^^ // remove this space
There appears to be a trailing space on the name?
'com.mysql.jdbc.Driver '
Apart from that, "com.mysql.jdbc.Driver" is correct.
The WEB-INF/lib folder is a good place for project-specific drivers & libraries; keeping the Tomcat shared folders up-to-date is not so easy.
Back in JDBC days you had to load the class with Class.forName( clazzName) to register it before you asked JDBC for a connection, but that's not the issue here.
I had this issue but with the Postgres driver and I'm using Eclipse. If you're using Tomcat 7, try adding the JAR file to the lib folder in your Tomcat directory. That worked for me. I didn't have to use Class.forName() or put the JAR in my classpath. I hope this helps you.

Tomcat JDBC MySQL ClassNotFoundException

I would like to use springMVC and JPA (using hibernate) on my tomcat 7 server (running locally on my Mac).
I was able to set up everything successfully with an embedded H2 database.
Now I switched to mysql and am getting the following error
java.lang.ClassNotFoundException: "com.mysql.jdbc.Driver"
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
This suggests tomcat is having trouble finding the mysql-connector for java.
There are a multitude of tutorials on how to add the connector to $CATALINA_HOME/lib.
After trying to use a maven dependency for my project, I followed the advice and copied the .jar file into the lib directory:
$ ls $CATALINA_HOME/lib/mysql*.jar
/Users/david/Applications/tomcat/lib/mysql-connector-java-5.1.20-bin.jar
I have read and execute permissions on the directory and file.
At the moment I can't figure out how to make tomcat aware of the jar. The folder is included in
$CATALINA_HOME/conf/catalina.properties
and I have restarted the server multiple times.
Thanks for you help.
Normally, the output of a CNFE is as follows:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
whereas your error message shows
java.lang.ClassNotFoundException: "com.mysql.jdbc.Driver"
I think you've still got quotes around the driver class name in your config.

How to register a JDBC driver using jruby-complete.jar?

I'm trying to write a script that is executed with the jruby-complete.jar like so:
java -cp derby.jar; -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver -jar jruby-complete.jar -S my_script.rb
I'm using JVM 1.6.0_11 and JRuby 1.4.
In my jruby script I attempt to connect to the database like this.
connection = Java::com.sql.DriverManager.getConnection("jdbc:derby:path_to_my_DB")
This throws a java.sql.SQLException: "No suitable driver found" exception.
I've tried manually loading the driver into the class loader using Class.forName which gives me the same error.
It looks like to me that the class loader being used by the DriverManager is not the same as the current thread's. I've tried setting the current thread's class loader using:
JThread = java.lang.Thread
...
class_loader = JavaLang::URLClassLoader.new(
[JavaLang::URL.new("jar:file:/derby.jar!/")].to_java(
JavaLang::URL),JRuby.runtime.jruby_class_loader)
JThread.currentThread().setContextClassLoader(class_loader )
But this doesn't help.
Any ideas?
OK I downloaded jruby-complete.jar and had a go....
This seems to work for me:
java -classpath c:\ruby\db-derby-10.5.3.0-bin\lib\derby.jar;jruby-complete-1.4.0.jar org.jruby.Main -S derby.rb
When using the -jar switch, the -classpath option is ignored (maybe the CLASSPATH shell var is too). But on the above line, we put both required jars on the class path and pass the class name to execute (i.e. org.jruby.Main). The script being passed in is as per my other answer.
Another option (which I have not tried) would be to alter the jruby-complete.jar manifest file to specify as classpath, as described here:
Adding Classes to the JAR File's Classpath
First, make sure your driver jar is not corrupted (this made me waste a couple of days one time).
Second, read this about JRuby/Java classloade: JRuby Wiki
Third (because I haven't played with "jruby-complete") try this simple script and then see if you can adapt as you need.
require 'java'
require 'C:\ruby\db-derby-10.5.3.0-bin\lib\derby.jar' # adjust for your machine
include_class "java.sql.DriverManager"
derby = org.apache.derby.jdbc.EmbeddedDriver.new
connection = DriverManager.getConnection("jdbc:derby:derbyDB;create=true")