首页 \ 问答 \ apache Solr-4.0.0无法使用Tomcat加载mysql驱动程序(apache Solr-4.0.0 Unable to load mysql Driver with Tomcat)

apache Solr-4.0.0无法使用Tomcat加载mysql驱动程序(apache Solr-4.0.0 Unable to load mysql Driver with Tomcat)

我正在尝试将apache Sonr(apache-solr-4.0.0)与Tomcat集成并获得以下错误。

15:12:40    SEVERE  DataImporter    Delta Import Failed
java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: 
Could not load driver:  com.mysql.jdbc.Driver Processing Document # 1
        at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:273)
... 11 more
Caused by: org.apache.solr.common.SolrException: Error loading class ' com.mysql.jdbc.Driver'
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:436)
        at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:889)
        ... 12 more
Caused by: java.lang.ClassNotFoundException:  com.mysql.jdbc.Driver
        at java.net.URLClassLoader$1.run(Unknown Source)

我尝试下面添加mysql-connector-java-5.1.22-bin.jar的选项,但都没有用

  1. 作为战争的一部分添加(solr.war / WEB-INF / lib)
  2. 作为Web服务器(Tomcat / lib)的一部分添加
  3. 在example / solr下创建了一个新目录lib,并放置了mysql连接器jar(mysql-connector-java-5.1.22-bin.jar),并从solr.xml中引用了lib路径。

任何帮助都非常值得赞赏。 谢谢


I am trying to integrate apache Sonr(apache-solr-4.0.0) with Tomcat and getting below error.

15:12:40    SEVERE  DataImporter    Delta Import Failed
java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: 
Could not load driver:  com.mysql.jdbc.Driver Processing Document # 1
        at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:273)
... 11 more
Caused by: org.apache.solr.common.SolrException: Error loading class ' com.mysql.jdbc.Driver'
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:436)
        at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:889)
        ... 12 more
Caused by: java.lang.ClassNotFoundException:  com.mysql.jdbc.Driver
        at java.net.URLClassLoader$1.run(Unknown Source)

I tried below option’s of adding mysql-connector-java-5.1.22-bin.jar, but none worked

  1. added as part of war (solr.war/WEB-INF/lib )
  2. added as part of web server (Tomcat/lib)
  3. Created a new directory lib under example/solr and placed the mysql connector jar (mysql-connector-java-5.1.22-bin.jar) and refered the lib path from solr.xml.

Any help highly appreciable. Thanks


原文:https://stackoverflow.com/questions/14438455
更新时间:2022-04-29 13:04

最满意答案

/ static端点具有查询字符串参数start和pageSize,您可以使用它们来遍历列表


The /static endpoint has querystring parameters start and pageSize that you can use to page through the list

相关问答

更多
  • BobHorn, 我这样做,在我们的生产站点:-) 1)停止IIS站点。 2)替换二进制文件3)启动IIS站点。 如果这是一个很大的改变,我也会做一个备份。 但是,这是非常多的。 BobHorn, The way I do it, on our production sites :-) 1) Stop the IIS site. 2) Replace the binaries 3) Start the IIS site. If it is a big change, I also do a backup. ...
  • 您可以在导出期间使用RavenDB。 在当前版本的RavenDB中,导出将继续在数据快照上运行。 但是,在完成导出期间添加的文档时,将再次查询数据库。 但是,在构建888中,您将获得导出开始时数据库中的文档,而不是导出期间添加的文档。 You can use RavenDB during the export. In current versions of RavenDB, the export will continue to run on a snapshot of the data. But will ...
  • / static端点具有查询字符串参数start和pageSize,您可以使用它们来遍历列表 The /static endpoint has querystring parameters start and pageSize that you can use to page through the list
  • 原始的api是否仍然受支持 是。 是否可以获得一个可以使用它的api密钥 再过几个星期,是的。 请访问Maps V1文档,获取有关获取Maps V1 API密钥的说明和表单 。 此优惠将于2013年3月3日到期。 或者新密钥只适用于v2 api? 它们是完全独立的键。 Maps V1键不适用于Maps V2,反之亦然。 Is the original api still supported Yes. is it possible to get an api key which will work with ...
  • 1.0.0主要版本(请参阅发行说明 )用topojson.feature替换了topojson.object函数,以获得更好的GeoJSON兼容性。 在以前的TopoJSON版本中,topojson.object返回了一个几何对象(可能是几何集合),与TopoJSON 拓扑中几何对象的表示方式一致。 但是,与GeoJSON几何图形不同,TopoJSON几何图形更像特征,并且可能具有id和属性; 同样,空几何被表示为空类型。 从版本1.0.0开始, topojson.feature替换topojson.obj ...
  • 解决了! 我只需要将属性ContentUrl = String.Empty添加到附件中,现在它就像正常一样工作。 Solved it! I just needed to add the property ContentUrl = String.Empty to the attachment and now it works like normal.
  • 在应用启动期间,我的应用似乎是在应用程序根目录中创建数据目录。 我发现我有一个旧的RavenDB Embedded引用,这个引用在项目中使用的时间更长,而该项目正在创建不需要的数据目录。 一旦我删除了该引用并推送,一切都开始正常工作。 It appears that during app startup, my app was creating a data directory in the application root. I discovered that I had an old reference ...
  • 我不知道是否有一个好的离子答案,无论如何我的解决方法将是自定义类条件http://codepen.io/islam4hak/pen/JNOepN对离子模态使用条件类名称 并为控制器 $scope.GoingAway = 0; $scope.CustomHide = function(e){ $scope.GoingAway = 1; ...
  • 我想这是一个偏好的问题 - 但我不认为URL是非常好的密钥。 其他人不同意。 请参阅支持论坛上的此讨论 。 我会认真考虑为什么你需要它作为一个键,如果你可以索引网址。 例如: public class Site { public string Id { get; set; } // such as "sites/1" public string Name { get; set; } public string Url { get; set; } } var q = session. ...
  • 如果您想要数据投影,可以使用变形金刚 。 public class John2Transformer : AbstractTransformerCreationTask { public John2Transformer () { TransformResults = johns => from john in johns from cat in john.Cats ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)