Add H2 database to Jetty with OSGI - cannot resolve driver - java

I am using standalone Jetty for my webapp with the org.eclipse.jetty.osgi.boot bundle.
So far, everything worked out quite satisfying. But now I tried to use authentication and add a JDBS datasource in order to store my usercredentials.
To do so, I added the following code to my jetty.xml (according to the jetty documentation):
<New id="DSTest" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/admin</Arg>
<Arg>
<New class="org.h2.jdbcx.JdbcDataSource">
<Set name="URL">jdbc:h2:C:\Users\Stephan\frontonics_data\admin</Set>
<Set name="user">sa</Set>
<Set name="password"></Set>
</New>
</Arg>
</New>
I also created a properties file with the name of the driver (org.h2.Driver), the URL to the database, and so on.
Obviously, jetty seems to "understand" the link to the datasource and parses the properties file. But unfortunately, it cannot find the org.h2.Driver class, since it fires an exception:
java.lang.ClassNotFoundException: org.h2.Driver not found by org.eclipse.jetty.security
In fact, I do not know why this dependency to org.h2.Driver cannot be resolved. I start the org.h2 bundle before the jetty bundle, I also tried adding org.h2 as imported package to the jetty bundle, but still get this error.
Does anybode know why jetty cannot resolve this dependency? Any hint?
[Edit] Stacktrace: (realm is my reference to the properties file, where also the driver class (org.h2.driver) is defined)
12:12:57.462 WARN JDBCLoginService UserRealm jdbcrealm could not connect to database; will try later
java.lang.ClassNotFoundException: org.h2.Driver not found by org.eclipse.jetty.security [41]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1550) ~[na:na]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77) ~[na:na]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1988) ~[na:na]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_45]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_45]
at java.lang.Class.forName(Unknown Source) ~[na:1.8.0_45]
at org.eclipse.jetty.security.JDBCLoginService.connectDatabase(JDBCLoginService.java:198) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.JDBCLoginService.loadUser(JDBCLoginService.java:239) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.MappedLoginService.login(MappedLoginService.java:221) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.JDBCLoginService.login(JDBCLoginService.java:223) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.authentication.LoginAuthenticator.login(LoginAuthenticator.java:52) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.authentication.FormAuthenticator.login(FormAuthenticator.java:192) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.authentication.FormAuthenticator.validateRequest(FormAuthenticator.java:229) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1099) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:446) ~[org.eclipse.jetty.servlet_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:200) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.Server.handle(Server.java:445) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:269) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) ~[org.eclipse.jetty.io_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) ~[org.eclipse.jetty.util_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) ~[org.eclipse.jetty.util_9.0.6.v20130930.jar:9.0.6.v20130930]
at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_45]
12:12:57.464 WARN JDBCLoginService UserRealm jdbcrealm could not load user information from database
java.sql.SQLException: Can't connect to database
at org.eclipse.jetty.security.JDBCLoginService.loadUser(JDBCLoginService.java:242) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.MappedLoginService.login(MappedLoginService.java:221) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.JDBCLoginService.login(JDBCLoginService.java:223) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.authentication.LoginAuthenticator.login(LoginAuthenticator.java:52) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.authentication.FormAuthenticator.login(FormAuthenticator.java:192) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.authentication.FormAuthenticator.validateRequest(FormAuthenticator.java:229) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499) ~[org.eclipse.jetty.security_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1099) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:446) ~[org.eclipse.jetty.servlet_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:200) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.Server.handle(Server.java:445) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:269) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) ~[org.eclipse.jetty.server_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) ~[org.eclipse.jetty.io_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) ~[org.eclipse.jetty.util_9.0.6.v20130930.jar:9.0.6.v20130930]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) ~[org.eclipse.jetty.util_9.0.6.v20130930.jar:9.0.6.v20130930]
at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_45]
Regards

Jetty boot uses the classloader of its bundle to resolve any classes from the configuration. To make Jetty see the packages of H2 I can think of one option:
Create a bundle that is the fragment of jetty-boot and imports the necessary package of H2. Your bundle will have only a MANIFEST.MF file with a content like the following:
Bundle-SymbolicName: jettyboot.mix.with.h2
Bundle-Version: 1.0.0
Fragment-Host: org.eclipse.jetty.osgi.boot
Import-Package: org.h2,org.h2.jdbcx
EDIT
Based on the stacktrace, you use JDBCLoginService. I have just had a quick look and it uses Class.forName(className) in its code. I am sorry but it I am sure that this will not work for you.
I am not familiar with this part of Jetty but as much as I see, there is a DataSourceLoginService. That can use a pre-instantiated DataSource so classloading should not be a problem. That could work for you.

Related

Karaf - exception when persisting a simple POJO

I am writing some code which I am deploying under Karaf. I am trying to save a simple POJO object into a table.
I am getting the exception below.
This reportRequestID is the PK field, I have it properly annotated, I think.
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
#Column(name = "ReportRequestID", unique = true, nullable = false)
public Integer getReportRequestID() {
return reportRequestID;
}
public void setReportRequestID(Integer reportRequestID) {
this.reportRequestID = reportRequestID;
}
The DB table has no foreign keys. I am saying this since I see the stack trace has this ForeignKeys.isTransient which I find weird.
So I have no idea what is wrong here. I tried googling for this error, I find many hits, but I don't find anything which is really related to my use case.
javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.hibu.microservices.dataaccess.sql.bean.KeywordReportQueue.reportRequestID
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1187)
at com.hibu.microservices.dataaccess.sql.dao.KeywordReportQueueDao.insertCustomerGoogleReportRequest2(KeywordReportQueueDao.java:118)
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.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
at com.hibu.microservices.dataaccess.sql.dao.$KeywordReportQueueDao1640762817.insertCustomerGoogleReportRequest2(Unknown Source)
at com.hibu.microservices.impl.customer.CustomerGenerateGoogleReportServiceImpl.requestReport(CustomerGenerateGoogleReportServiceImpl.java:31)
at com.hibu.microservices.impl.customer.CustomerGenerateGoogleReportServiceImpl.generateReport(CustomerGenerateGoogleReportServiceImpl.java:54)
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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.hibu.microservices.dataaccess.sql.bean.KeywordReportQueue.reportRequestID
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:192)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:346)
at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4746)
at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4465)
at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:243)
at org.hibernate.event.internal.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:511)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:116)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181)
... 52 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException#6e91316a
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:169)
... 63 more
In my karaf.log file I am also seeing this.
java.lang.ClassNotFoundException: Unable to load class 'org.hibernate.proxy.HibernateProxy' because the bundle wiring for com.hibu.microservices.data-access is no longer valid.
I don't know if it's related or how to fix it.
I just solved this by changing the hibernate dialect value.
from
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
to
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2008Dialect"/>
Note that I am using SQL Server 2008 DB.

Alfresco 3.3. community won't start again

Ubuntu-server Alfresco was working fine before, but now I get some errors. I'm doing nothing except changing the Admin password via Web-interface and cleaning of old log files.
Now I get 404 error. The log is provided below:
11:40:10,390 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.service.cmr.rendition.RenditionServiceException: 09250000 Unable to find rendering action root node.
at org.alfresco.repo.rendition.RenditionDefinitionPersisterImpl.checkRenderingActionRootNodeExists(RenditionDefinitionPersisterImpl.java:199)
at org.alfresco.repo.rendition.RenditionDefinitionPersisterImpl.findActionNode(RenditionDefinitionPersisterImpl.java:154)
at org.alfresco.repo.rendition.RenditionDefinitionPersisterImpl.findOrCreateActionNode(RenditionDefinitionPersisterImpl.java:177)
at org.alfresco.repo.rendition.RenditionDefinitionPersisterImpl.saveRenditionDefinition(RenditionDefinitionPersisterImpl.java:143)
at org.alfresco.repo.rendition.RenditionServiceImpl.saveRenditionDefinition(RenditionServiceImpl.java:233)
at org.alfresco.repo.thumbnail.ThumbnailRegistry$1.doWork(ThumbnailRegistry.java:160)
at org.alfresco.repo.thumbnail.ThumbnailRegistry$1.doWork(ThumbnailRegistry.java:149)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
at org.alfresco.repo.thumbnail.ThumbnailRegistry.initThumbnailDefinitions(ThumbnailRegistry.java:148)
at org.alfresco.repo.thumbnail.ThumbnailRegistry.access$400(ThumbnailRegistry.java:49)
at org.alfresco.repo.thumbnail.ThumbnailRegistry$RegistryLifecycle.onBootstrap(ThumbnailRegistry.java:271)
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
at org.alfresco.repo.thumbnail.ThumbnailRegistry.onApplicationEvent(ThumbnailRegistry.java:255)
at org.alfresco.repo.thumbnail.ThumbnailRegistry.onApplicationEvent(ThumbnailRegistry.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:294)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:858)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:419)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Does anyone know what could be wrong? I can provide additional information if you ask; just tell me what you want to see.
So, I've done all what Gagravarr said, thanks for Him. Error "root node" has disappeared.
I got some new errors but all been fixed, except one:
Will try to resolve it myself. If not I will ask here again. Thanks!

Exception while deploying my JPA-application to Websphere 7

I have problems deploying a web application to the most recent version of IBM Websphere 7.
The exception is caused during the JPA initialization.
The application is using servlet 2.5, eclipselink 2.1.3, java 6 update 25.
persistence.xml is using version 1.0
I am unsure, if this exception is caused by a bug/configuration error in Websphere or by my application. Maybe it's also related to eclipselink.
UPDATE
Our application does not use JNDI for providing datasources to EclipseLink. Our application passes the DataSource directly to EclipseLink (using EclipseLink specific EntityManager properties)
The persistence.xml I am using is (leaving out all entity definitions and tuning properties):
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<non-jta-data-source></non-jta-data-source>
<class>my.applications.entity.classes.A</class>
<!-- other class definitions follow -->
<properties>
<property name="eclipselink.logging.level" value="FINEST" />
<!-- some other properties, not related to datasources/connections/JNDI
follow -->
</properties>
</persistence-unit>
</persistence>
Here comes the System.err output:
com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.metadata.MetaDataException: CWWJP0018E: Incorrect syntax or error detected in /path/to/my/project/my_application_war.ear/my_application.war/WEB-INF/classes/ for application my_application_war module my_application.war. The following associated error occurred:
at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:185)
at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:895)
at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:748)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1075)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1302)
at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:221)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:607)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:726)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1268)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4588)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4766)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1273)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2045)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:441)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:384)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:655)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:617)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1074)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1332)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1225)
at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:239)
at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:564)
at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)
at org.apache.struts.action.RequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:104)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:353)
at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)
at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)
at com.ibm.isclite.container.controller.InformationController.processForwardConfig(InformationController.java:217)
at org.apache.struts.action.RequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistence(WSCUrlFilter.java:933)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:500)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:321)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:557)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:607)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:984)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1069)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
Caused by: com.ibm.ws.metadata.MetaDataException: CWWJP0018E: Incorrect syntax or error detected in path/to/my/project/my_application_war.ear/my_application.war/WEB-INF/classes/ for application my_application_war module my_application.war. The following associated error occurred:
at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:449)
at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:140)
at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
... 90 more
Caused by: java.lang.ClassCastException: com.ibm.ws.naming.jndicos.CNContextImpl cannot be cast to javax.sql.DataSource
at com.ibm.ws.jpa.management.JPAPUnitInfo.getJPADataSource(JPAPUnitInfo.java:493)
at com.ibm.ws.jpa.management.JPAPUnitInfo.getNonJtaDataSource(JPAPUnitInfo.java:577)
at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1314)
at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:393)
... 92 more
The empty non-jta-data-source is causing WebSphere Application Server to perform a lookup(""), which returns the root context, which it then attempts to cast to DataSource.
Container-managed JPA is designed for the container to acquire the data source and pass it to the EM itself. I would recommend that you either specify your data source in persistence.xml, or just disable container-managed JPA altogether to avoid the error during application start:
http://www-01.ibm.com/support/docview.wss?uid=swg1PM26361
Websphere seems to be validating your data-source value in your persistence.xml, and it seems to be invalid. You need to specify a valid value, even if you are overriding it later.
Please include your persistence.xml. You could also try not setting a data-source, or using resource_local if it does not allow no data-source.
Caused by: java.lang.ClassCastException: com.ibm.ws.naming.jndicos.CNContextImpl cannot be cast to javax.sql.DataSource
at com.ibm.ws.jpa.management.JPAPUnitInfo.getJPADataSource(JPAPUnitInfo.java:493)
at com.ibm.ws.jpa.management.JPAPUnitInfo.getNonJtaDataSource(JPAPUnitInfo.java:577)
at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1314)
at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:393)
... 92 more
In your EAR config you have set a JNDI context where there should be a JNDI DataSource

tomcat issue with loading page

I've been working off an example (http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-45.html) and I've been debugging some issues and I can't seem to figure this one out:
SEVERE: StandardWrapper.Throwable
java.lang.RuntimeException: Missing OAuthProvider class name in the configuration. Make sure 'com.sun.jersey.config.property.oauth.provider' property is set.
at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider$1.instance(OAuthProviderInjectionProvider.java:73)
at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider$1.instance(OAuthProviderInjectionProvider.java:67)
at com.sun.jersey.core.util.LazyVal.get(LazyVal.java:57)
at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider.getInjectable(OAuthProviderInjectionProvider.java:114)
at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider.getInjectable(OAuthProviderInjectionProvider.java:62)
at com.sun.jersey.core.spi.factory.InjectableProviderFactory.getInjectable(InjectableProviderFactory.java:214)
at com.sun.jersey.core.spi.factory.InjectableProviderFactory.getInjectableWithScope(InjectableProviderFactory.java:245)
at com.sun.jersey.server.impl.inject.ServerInjectableProviderFactory.getInjectableiWithScope(ServerInjectableProviderFactory.java:90)
at com.sun.jersey.server.spi.component.ResourceComponentInjector.processFields(ResourceComponentInjector.java:115)
at com.sun.jersey.server.spi.component.ResourceComponentInjector.<init>(ResourceComponentInjector.java:93)
at com.sun.jersey.server.spi.component.ResourceComponentConstructor.<init>(ResourceComponentConstructor.java:143)
at com.sun.jersey.server.impl.resource.PerRequestFactory$PerRequest.init(PerRequestFactory.java:174)
at com.sun.jersey.server.impl.application.WebApplicationImpl$9.f(WebApplicationImpl.java:542)
at com.sun.jersey.server.impl.application.WebApplicationImpl$9.f(WebApplicationImpl.java:540)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:197)
at com.sun.jersey.server.impl.application.WebApplicationImpl.getResourceComponentProvider(WebApplicationImpl.java:540)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiateResource(WebApplicationImpl.java:615)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiateResource(WebApplicationImpl.java:610)
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:155)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1182)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$600(WebApplicationImpl.java:161)
at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:698)
at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:695)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:197)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:695)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:690)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:438)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:287)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:587)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:213)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:342)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:516)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414
Managed to fix it by removing the OAuth jar from the /lib folder.

Problem with NetBeans Web Service Client when xercesImpl.jar is on classpath

I am unable to create a Web Service Client in my NetBeans Web Application when xercesImpl.jar is included as a library.
Using NetBeans 6.9 and GlassFish 3.0.1:
1.) Create new Web Application
2.) Create a new Web Service
3.) Add a new operation to the created web service (just let it return null - the implementation isn't important)
4.) Deploy web service to GlassFish (works fine)
5.) Add xercesImpl.jar (I'm using version 2.9.1) as a library to the web service (I need xerces for a third-party library that I'm using)
6.) Stop Glassfish.
7.) Clean and Build the project.
8.) Run the project. Test that the Web Service still works (it does).
9.) Create a new Web Service Client. Point it at a WSDL (I'm using http://www.webservicex.com/CurrencyConvertor.asmx?wsdl just as a test).
10.) Stop Glassfish.
11.) Clean and Build the project.
Error message is shown:
C:\NetBeansProjects\WSTest\nbproject\jaxws-build.xml:43:
Error starting wsimport: BUILD FAILED
(total time: 1 second)
Line 43 is:
<wsimport sourcedestdir="${build.generated.dir}/jax-wsCache/CurrencyConvertor"
destdir="${build.generated.dir}/jax-wsCache/CurrencyConvertor" wsdl=
"${basedir}/${conf-dir}xml-resources/web-service-references/
CurrencyConvertor/wsdl/www.webservicex.com/CurrencyConvertor.asmx.wsdl"
catalog="catalog.xml" extension="true" verbose="true"
wsdlLocation="http://www.webservicex.com/CurrencyConvertor.asmx?wsdl"
xnocompile="true" xendorsed="true">
12.) Restart NetBeans.
13.) Clean and Build the project. (The build now works)
14.) Run the project. GlassFish starts up fine except for this one-line error message:
SEVERE: Error in resolving the catalog
15.) Loading the Web Service Tester page produces the following exception in the GlassFish log:
WARNING: Servlet web service endpoint 'NewWebService' failure
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2085)
at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1018)
at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1255)
at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:238)
at com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog(Catalog.java:680)
at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:270)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:405)
at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:264)
at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:99)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
WARNING: StandardWrapperValve[NewWebService]: PWC1382: Allocate exception for servlet NewWebService
javax.servlet.ServletException
at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:271)
at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:99)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2085)
at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1018)
at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1255)
at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:238)
at com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog(Catalog.java:680)
at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:270)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:405)
at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:264)
... 26 more
Any ideas on what I can do to fix this? Note that it only happens after I create a new Web Service Client/Reference. Even if someone could suggest which project I should be creating a bug against (i.e. is it a NetBeans fault? A Glassfish fault? A JAX-WS fault? etc.), that would be good.
Well I've finally found a solution:
http://forums.java.net/jive/thread.jspa?threadID=59445
What I needed to do was to remove these files from the xercesImpl.jar file:
META-INF/services/javax.xml.parsers.DocumentBuilderFactory
META-INF/services/javax.xml.parsers.SAXParserFactory
When the modified JAR file is included in my project it no longer causes any issues.
If anyone has a neater solution, please let me know.
I found the solution for my problem which is similar with yours.
I added inside my jar the following file:
META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration
The content of this file is just :
org.apache.xerces.parsers.XML11Configuration
Regards.

Categories