Solr 4.1 Core Initialization Failure [duplicate] - java

This question already has answers here:
Solr RequestHandler init failure
(2 answers)
Closed 7 years ago.
I have updated my version of Solr from 3.5 to 4.1
I have removed the old war file from my apache tomcat (7) webapps, and deployed the new war file that has been provided in the apache-solr package.
I got the following error upon trying to access solr from the web browser!
I have one core only(dbTrial)
Solr opens but this error appears.
SolrCore Initialization Failures
dbTrial: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: RequestHandler init failure
There are no SolrCores running.
Using the Solr Admin UI currently requires at least one SolrCore.
Unable to load environment info from null/admin/system?wt=json.
This interface requires that you activate the admin request handlers in all SolrCores by adding the following configuration to your solrconfig.xml:
Can you help me out? I have tried adding the request handler as specified, but it didn't work.
It seems that the new versions of solr need a new format for solrconfig file. can you assist please! thank you!
the log is the following:
????? ?????? 21, 2014 9:19:05 ? org.apache.solr.common.SolrException log
SEVERE: null:org.apache.solr.common.SolrException: RequestHandler init failure
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:168)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:657)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:566)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:850)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:534)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:356)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:308)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:107)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.DisMaxRequestHandler'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:436)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:469)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:540)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:154)
... 25 more
Caused by: java.lang.ClassNotFoundException: solr.DisMaxRequestHandler
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:420)
... 28 more

Check the Solr log for a better error of what the issue is when Solr is starting up - you'll probably have a better error message there than the one you can see in the Admin interface (which is the error triggered when the interface attempts to access the Solr core). The reason why the core or requestHandler isn't loading will be in the log file, and not in the message produced by the UI. Remember that logging also changed at 4.3, if you've updated to 4.10 (I see that you wrote 4.1, but if you're planning on going the whole way (or meant 4.10) - the logging might have to be configured as well).
You'll also want to consider the "going from 3 to 4" document, that details the changed to the configuration files (as solrconfig.xml changed a bit).
Update
The log shows that it's complaining about loading "solr.DisMaxRequestHandler". This has been deprecated for quite some time and has been removed - just use the standard request handler from the example solrconfig.xml instead.
<requestHandler name="standard" class="solr.SearchHandler" default="true">
<lst name="defaults">
<str name="echoParams">explicit</str>
</lst>
</requestHandler>

Related

WELD-000143: Container lifecycle event method invoked outside of extension observer method invocation. on websphere liberty server

I am trying to migrate an application that was running on the Websphere onto 8.5.5 server onto Websphere liberty server. After the WAR is deployed on the liberty, I am getting the following exception. The application is a REST service built on jersey and I have included the Jersey jars in the POM.
000001d7 com.sun.jersey.spi.spring.container.servlet.SpringServlet
E Exception occurred when intialization
org.jboss.weld.exceptions.IllegalStateException: WELD-000143: Container lifecycle event method invoked outside of extension observer method invocation.
at org.jboss.weld.bootstrap.events.ContainerEvent.checkWithinObserverNotification(ContainerEvent.java:61)
at org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget.getAnnotatedType(AbstractProcessInjectionTarget.java:56)
at com.sun.jersey.server.impl.jcdi.JCDIComponentProviderFactory.init(JCDIComponentProviderFactory.java:103)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:654)
at com.sun.jersey.spi.spring.container.servlet.SpringServlet.initiate(SpringServlet.java:99)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:278)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:566)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:211)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:333)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:497)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:297)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:598)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:329)
at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:312)
at org.jboss.weld.probe.InvocationMonitor$Action.perform(InvocationMonitor.java:173)
at org.jboss.weld.probe.ProbeFilter$FilterAction.doFilter(ProbeFilter.java:338)
at org.jboss.weld.probe.ProbeFilter.embedInfoSnippet(ProbeFilter.java:188)
at org.jboss.weld.probe.ProbeFilter.doFilter(ProbeFilter.java:176)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:995)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1009)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:412)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:371)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:464)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:329)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:300)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:165)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:74)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[2/6/19 11:43:14:282 EST] 000001d7 com.ibm.ws.webcontainer.servlet E SRVE0271E: Uncaught init() exception created by servlet [BlueConnectRestServices] in application [EnterpriseBenefitsAndAccumsWrapperServiceV2WAR]: org.jboss.weld.exceptions.IllegalStateException: WELD-000143: Container lifecycle event method invoked outside of extension observer method invocation.
at org.jboss.weld.bootstrap.events.ContainerEvent.checkWithinObserverNotification(ContainerEvent.java:61)
at org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget.getAnnotatedType(AbstractProcessInjectionTarget.java:56)
at com.sun.jersey.server.impl.jcdi.JCDIComponentProviderFactory.init(JCDIComponentProviderFactory.java:103)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:654)
at com.sun.jersey.spi.spring.container.servlet.SpringServlet.initiate(SpringServlet.java:99)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:278)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:566)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:211)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:333)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:497)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:297)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:598)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:329)
at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:312)
at org.jboss.weld.probe.InvocationMonitor$Action.perform(InvocationMonitor.java:173)
at org.jboss.weld.probe.ProbeFilter$FilterAction.doFilter(ProbeFilter.java:338)
at org.jboss.weld.probe.ProbeFilter.embedInfoSnippet(ProbeFilter.java:188)
at org.jboss.weld.probe.ProbeFilter.doFilter(ProbeFilter.java:176)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:995)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1009)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:412)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:371)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:464)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:329)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:300)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:165)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:74)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[2/6/19 11:43:14:283 EST] 000001d7 com.ibm.ws.webcontainer.webapp E SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5006)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1009)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:412)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:371)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:464)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:329)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:300)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:165)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:74)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.servlet.ServletException: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at org.jboss.weld.probe.ProbeFilter$FilterAction.doFilter(ProbeFilter.java:340)
at org.jboss.weld.probe.ProbeFilter.embedInfoSnippet(ProbeFilter.java:188)
at org.jboss.weld.probe.ProbeFilter.doFilter(ProbeFilter.java:176)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:995)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962)
... 19 more
Caused by: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:366)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:598)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:329)
at org.jboss.weld.probe.ProbeFilter$FilterAction.proceed(ProbeFilter.java:312)
at org.jboss.weld.probe.InvocationMonitor$Action.perform(InvocationMonitor.java:173)
at org.jboss.weld.probe.ProbeFilter$FilterAction.doFilter(ProbeFilter.java:338)
... 26 more
Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-000143: Container lifecycle event method invoked outside of extension observer method invocation.
at org.jboss.weld.bootstrap.events.ContainerEvent.checkWithinObserverNotification(ContainerEvent.java:61)
at org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget.getAnnotatedType(AbstractProcessInjectionTarget.java:56)
at com.sun.jersey.server.impl.jcdi.JCDIComponentProviderFactory.init(JCDIComponentProviderFactory.java:103)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:654)
at com.sun.jersey.spi.spring.container.servlet.SpringServlet.initiate(SpringServlet.java:99)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:278)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:566)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:211)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:333)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:497)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:297)
... 34 more
Please look into the error and advice me on how to resolve this exception. Thanks in advance for all your help.
My application uses Jersey and I was adding webprofile 7.0 as on of the features to the liberty server. Webprofile 7.0 by default enables Jaxrs feature on liberty and it was having conflicts. So, disabling the webprofile 7.0 feature did the trick for me and my application ran without any exceptions.

Configuring hibernate 4.2.1 in a maven project

I'm configuring Hibernate 4.2.1 in a maven project and I'm using MS SQL JDBC to connect to a SQL Server Database. When I run my class Test I get the following error:
WARN : org.hibernate.internal.util.xml.DTDEntityResolver - HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Exception in thread "main" org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver com.microsoft.sqlserver.jdbc.SQLServerDriver could not be loaded
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:111)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:78)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2293)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2289)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1758)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1798)
at com.lbv.test.Test.main(Test.java:12)
Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [com.microsoft.sqlserver.jdbc.SQLServerDriver]
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:149)
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:106)
... 14 more
Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.microsoft.sqlserver.jdbc.SQLServerDriver
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:296)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:146)
... 15 more
I need your help friends.
You need to remove <scope>test</scope> from your dependency declaration. You aren't only using the driver for your tests, but also for your actual runtime use.
Specifying <scope>test</scope> will instruct Maven to only load the dependency when running your tests. You should also ask yourself if you really want to use a preview version, and not a officially released version (ie: 6.2.2.jre8).

Could not fetch model of type 'HierarchicalEclipseProject'

I am running Eclipse 4.5.1 and trying to import example code. I am using Gradle Integration for Eclipse 3.7.2 plugin.
When clicking on "Build Model" I get the error Could not fetch model of type 'HierarchicalEclipseProject'.
Here is the log:
java.lang.reflect.InvocationTargetException
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:112)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.eclipse.core.runtime.CoreException: repository not found: C:\Mario\Development\Hystrix\Hystrix-master
at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:40)
at org.springsource.ide.eclipse.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:51)
at org.springsource.ide.eclipse.gradle.core.modelmanager.BuildResult.get(BuildResult.java:85)
at org.springsource.ide.eclipse.gradle.core.modelmanager.GradleProjectModelManager.getModelInternal(GradleProjectModelManager.java:145)
at org.springsource.ide.eclipse.gradle.core.modelmanager.GradleProjectModelManager.getModel(GradleProjectModelManager.java:100)
at org.springsource.ide.eclipse.gradle.core.modelmanager.GradleModelManager.getModel(GradleModelManager.java:77)
at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:669)
at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.java:499)
at org.springsource.ide.eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.java:104)
... 1 more
Caused by: org.gradle.tooling.BuildException: Could not fetch model of type 'HierarchicalEclipseProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.7-bin.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:57)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

Solr custom RequestHandler ClassNotFoundException

I was following this tutorial - http://www.slideshare.net/searchbox-com/develop-a-solr-request-handler-plugin and built the required jar file in Netbeans then put it into the lib path and added the request handler to solrconfig.xml:
<requestHandler name="/newendpoint" class="com.searchbox.DemoPlugin">
<lst name="words">
<str name="word">body</str>
<str name="word">fish</str>
<str name="word">dog</str>
</lst>
</requestHandler>
I see the jar being loaded:
INFO - 2015-02-06 12:32:21.903; org.apache.solr.core.SolrResourceLoader; Adding 'file:/data/solr/lib/DemoPlugin-1.0.jar' to classloader
But then I get an error when I try to restart solr:
ERROR - 2015-02-06 12:39:02.942; org.apache.solr.core.CoreContainer; Error creating core [test]: RequestHandler init failure
org.apache.solr.common.SolrException: RequestHandler init failure
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:873)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:646)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:491)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:255)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: RequestHandler init failure
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:172)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:792)
... 8 more
Caused by: org.apache.solr.common.SolrException: Error loading class 'com.searchbox.DemoPlugin'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:490)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:421)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:543)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:616)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:158)
... 9 more
Caused by: java.lang.ClassNotFoundException: com.searchbox.DemoPlugin
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:474)
... 13 more
I confess I'm no java expert so am wondering if I've missed something obvious, or mechanics have changed since the tutorial was created, expanding the DemoPlugin jar it has the required com/searchbox/DemoPlugin.class file in, so I'm at a bit of a loss.
Any pointers appreciated.
Si
I have tried this tutorial and I can confirm that it works as explained.
For you I can only assume the jar is not loaded where it should (even if the log sais the classloader gets it).
I have put the jar in {solr.home}/{core.name}/lib.
A little more info on how to deploy new plugins into solar is here.
Try to use a solr.xml file and configure there exactly where the plugin should be loaded from.

Windows Service - Apache commons daemon class not found

I have a Jar file that needs to be installed as a windows service. I'm using Apache commons daemon procrun.
Though the service appears in the Services tab in task manager its not running. Its in stopped state and attempting to start it seems not working.
*In commons daemons logs I noticed that it cannot load the main class which is the "AgentApp".
I installed 32bit jre too.
Mentioned here under the log file contents.
imageprocagent stderr:
2015-01-07 15:47:47 Commons Daemon procrun stderr initialized
java.lang.NoClassDefFoundError: org/apache/commons/daemon/Daemon
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.daemon.Daemon
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
... 12 more
Exception in thread "main"
crawford-daemon:
[2015-01-07 15:47:47] [info] Commons Daemon procrun (1.0.10.0 32-bit) started
[2015-01-07 15:47:47] [info] Running 'ImageProcAgent' Service...
[2015-01-07 15:47:47] [info] Starting service...
[2015-01-07 15:47:49] [error] FindClass com/fx358/fx9/agent/AgentApp failed
[2015-01-07 15:47:49] [error] Failed to start Java
[2015-01-07 15:47:49] [error] ServiceStart returned 4
[2015-01-07 15:47:49] [info] Run service finished.
[2015-01-07 15:47:49] [info] Commons Daemon procrun finished
`[2015-01-07 15:47:49] [error] FindClass com/fx358/fx9/agent/AgentApp failed
Here is the script I'm using to install the agent:
SET DISPLAYNAME="ImageProcAgent"
SET DESCRIPTION="FX9 image processing Agent"
SET LOGPATH="C:\FX9\logs\ImageProcAgent"
SET STARTPATH=
SET JVMLOCATION="C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll"
SET CUSTCLASSPATH="C:\FX9\release\ImageProcAgent\GenericAgent_jar\GenericAgent.jar;C:\FX9\release\ImageProcAgent\GenericAgent_jar\ImageProcAgent.jar;."
ECHO ON
ImageProcAgent.exe //IS//ImageProcAgent --DisplayName=%DISPLAYNAME% --Description=%DESCRIPTION% --Startup=auto --LogPath=%LOGPATH% --LogLevel=INFO --LogPrefix=crawford-daemon --StdOutput=auto --StdError=auto --StartPath=%STARTPATH% --StartClass=com.fx358.fx9.agent.AgentApp --StartMethod=main --StartParams=start --StartMode=jvm --StopPath=%% --StopClass=com.fx358.fx9.agent.AgentApp --StopMethod=stop --StopMode=jvm --Jvm=%JVMLOCATION% --Classpath=%CUSTCLASSPATH% --JvmOptions=-Xmx512M ++JvmOptions=-Djava.util.logging.config.file=logging.properties
`
Can someone point me out what I'm doing wrong? thanks in advance.
I had the same error. Turns out, I was attempting to use commons-logging and log4j directly within the Service class. However, the log4j was not initializing properly, thus causing the load to error out.
I removed all the log4j, replacing it with a simple System.out.* and it worked.
In your classpath declaration there are only 2 jar entries:
CUSTCLASSPATH="C:\FX9\release\ImageProcAgent\GenericAgent_jar\GenericAgent.jar;C:\FX9\release\ImageProcAgent\GenericAgent_jar\ImageProcAgent.jar;."
Is your application's your build as a fat-jar containing all compile and runtime dependencies? Otherwise you'll have to add each JAR that is needed at runtime of your service to the classpath. For example:
CUSTCLASSPATH="C:\FX9\release\ImageProcAgent\GenericAgent_jar\GenericAgent.jar;C:\FX9\release\ImageProcAgent\GenericAgent_jar\ImageProcAgent.jar;C:\FX9\release\ImageProcAgent\GenericAgent_jar\lib\commons-daemon-1.0.15.jar;<PROBABLY_MORE_JARS_NEED_TO_BE_ADDED_HERE>;."
Furthermore using . in the classpath of your service is probably not a good idea. You should only use fully qualified paths in there. Otherwise you'll be dependent on the location from where the service is executed by Windows.
I had the same error with a runnable jar build with ANT. The Service-Class fails with a severe error. One reason was, i used signed libraries SHA1-Digest, please check this. To avoid this problem don't build a runnable, deliver the libraries you are using, and set the Class-Path in the MANIFEST.MF of your JAR-File. Hope this helps you.

Categories