I have Alfresco Community Edition 5.2.
The project has been cloned from GitHub repository, and after that I cannot run it.
I am getting the following error at catalina.out file:
2023-02-02 13:16:49,623 ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 01020049 Not all patches could be applied
at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(PatchExecuter.java:118)
at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:131)
at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:1)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter.java:135)
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:214)
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:185)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Feb 02, 2023 1:16:49 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextLoaderListener
org.alfresco.error.AlfrescoRuntimeException: 01020049 Not all patches could be applied
at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(PatchExecuter.java:118)
at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:131)
at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:1)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter.java:135)
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:214)
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:185)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
and this one also:
2023-02-02 13:16:48,818 ERROR [admin.patch.PatchExecuter] [localhost-startStop-1] 01020048 org.alfresco.error.AlfrescoRuntimeException: 01020047 Bootstrap failed
at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:367)
at com.prodyna.adama.gas.patch.SiteReloadedPatch.applyInternalImpl(SiteReloadedPatch.java:388)
at com.prodyna.adama.gas.patch.SiteReloadedPatch.applyInternal(SiteReloadedPatch.java:269)
at org.alfresco.repo.admin.patch.AbstractPatch$1.execute(AbstractPatch.java:455)
at org.alfresco.repo.admin.patch.AbstractPatch$1.execute(AbstractPatch.java:1)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
at org.alfresco.repo.admin.patch.AbstractPatch.applyWithTxns(AbstractPatch.java:462)
at org.alfresco.repo.admin.patch.AbstractPatch.access$0(AbstractPatch.java:442)
at org.alfresco.repo.admin.patch.AbstractPatch$4.doWork(AbstractPatch.java:620)
at org.alfresco.repo.admin.patch.AbstractPatch$4.doWork(AbstractPatch.java:1)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.admin.patch.AbstractPatch.apply(AbstractPatch.java:624)
at org.alfresco.repo.admin.patch.AbstractPatch.apply(AbstractPatch.java:586)
at org.alfresco.repo.admin.patch.PatchServiceImpl$PatchWork.applyPatch(PatchServiceImpl.java:564)
at org.alfresco.repo.admin.patch.PatchServiceImpl$PatchWork.execute(PatchServiceImpl.java:477)
at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatch(PatchServiceImpl.java:332)
at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatchAndDependencies(PatchServiceImpl.java:309)
at org.alfresco.repo.admin.patch.PatchServiceImpl.applyOutstandingPatches(PatchServiceImpl.java:198)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy142.applyOutstandingPatches(Unknown Source)
at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(PatchExecuter.java:83)
at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:131)
at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:1)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter.java:135)
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:214)
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:185)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 487; column 75 due to error: Namespace URI http://www.adama.com/model/adamaStudyNotification/1.0 has not been defined in the Repository dictionary
at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:201)
at org.alfresco.repo.importer.ImporterComponent.parserImport(ImporterComponent.java:430)
at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:279)
at org.alfresco.repo.importer.ImporterBootstrap.doImport(ImporterBootstrap.java:485)
at org.alfresco.repo.importer.ImporterBootstrap.access$0(ImporterBootstrap.java:374)
at org.alfresco.repo.importer.ImporterBootstrap$1$1.execute(ImporterBootstrap.java:356)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
at org.alfresco.repo.importer.ImporterBootstrap$1.doWork(ImporterBootstrap.java:360)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:363)
... 54 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Namespace URI http://www.adama.com/model/adamaStudyNotification/1.0 has not been defined in the Repository dictionary
at org.alfresco.repo.importer.view.ViewParser.getName(ViewParser.java:995)
at org.alfresco.repo.importer.view.ViewParser.processStartElement(ViewParser.java:226)
at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:183)
... 63 more
While ago I added new sites to alfresco project, and bootstraped them. But now I do not know what could be the problem.
It looks like you have a problem with customized code:
com.prodyna.adama.gas.patch.SiteReloadedPatch.applyInternalImpl
is not an official Alfresco patch.
Failed to import package at line 487; column 75 due to error: Namespace URI http://www.adama.com/model/adamaStudyNotification/1.0 has not been defined in the Repository dictionary
seems to be at least one of your issues: the referenced model http://www.adama.com/model/adamaStudyNotification/1.0 is not defined. You may have forgotten to deploy a dependent module which contains the model xml?
If your intention is to run Alfresco without that module you would need to deploy at least the document model, otherwise Alfresco will not be able to read the metadata of existing documents having the type or aspects defined in that model.
I am running wso2is Version 5.7 and tried to implement a TokenGenerator based on msf4j JWTAccessTokenBuilder.
My identity.xml includes
<IdentityOAuthTokenGenerator>com.wso2.jwt.token.builder.JWTAccessTokenBuilder</IdentityOAuthTokenGenerator>
<AccessTokenValueGenerator>org.wso2.carbon.identity.oauth.tokenvaluegenerator.SHA256Generator</AccessTokenValueGenerator>
When I login an exception is thrown
[2019-05-16 18:27:18,163] ERROR
{org.apache.catalina.core.StandardWrapperValve} - Servlet.service()
for servlet [OAuth2Endpoints] in context with path [/oauth2] threw
exception java.lang.RuntimeException:
org.apache.cxf.interceptor.Fault:
com/nimbusds/jwt/ReadOnlyJWTClaimsSet
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:336)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)
...
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.cxf.interceptor.Fault:
com/nimbusds/jwt/ReadOnlyJWTClaimsSet
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:170)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:136)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:204)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:101)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
... 49 more Caused by: java.lang.NoClassDefFoundError: com/nimbusds/jwt/ReadOnlyJWTClaimsSet
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
...
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:188)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104)
... 54 more Caused by: java.lang.ClassNotFoundException: com.nimbusds.jwt.ReadOnlyJWTClaimsSet cannot be found by
JWTAccessTokenBuilder_2.7.4.SNAPSHOT
Can anybody give me a hint?
As per the error com.nimbusds.jwt.ReadOnlyJWTClaimsSet cannot be found by JWTAccessTokenBuilder_2.7.4.SNAPSHOT, it is due to the OSGi class binding.
In the maven-bundle-plugin configuration Import-Package of the pom, make sure you have the com.nimbusds.jwt with the correct version range.
Or the quick fix is to add <DynamicImport-Package>*</DynamicImport-Package>
I found the problem:
I used an old version of org.wso2.carbon.identity.inbound.auth.oauth2
I updated the pom.xml to
<dependency>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
<version>6.0.172</version>
<scope>provided</scope>
</dependency>
from https://mvnrepository.com and had to update the code to use the version of com.nimbusds.jwt used by wso2is.
And finally in the service provider settings you must select the Token Issuer.
I am trying to access an ejb that is exposed in jbossAS7.1 from code running in an embedded jetty server:
final Properties jndiProperties = new Properties();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "ubiant");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "ubiant2iA");
ctx = new InitialContext(jndiProperties);
Object b = ctx.lookup("ejb:Hemis/HemisCoreClient//" + "HardwareDataManagement" + "!" + "com.ubiant.hemis.client.ejb.interf.I_HardwareDataManagement");
But I am getting this exception:
"EJB client context selector may not be changed"
Could someone help me with this ?
Here the full stacktrace:
11:17:43,003 ERROR [stderr] (qtp10117087-119)
javax.naming.NamingException: Failed to create remoting connection
[Root exception is java.lang.RuntimeException: Failed to setup EJB
remote context]
11:17:43,011 ERROR [stderr] (qtp10117087-119) at
org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
11:17:43,011 ERROR [stderr] (qtp10117087-119) at
org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
javax.naming.InitialContext.init(InitialContext.java:242)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
javax.naming.InitialContext.(InitialContext.java:216)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
authentification.TokenAuthentificationBroker.addConnection(TokenAuthentificationBroker.java:86)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:97)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:733)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:79)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:149)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.transport.ws.MQTTSocket.sendToActiveMQ(MQTTSocket.java:112)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.transport.mqtt.MQTTProtocolConverter.sendToActiveMQ(MQTTProtocolConverter.java:133)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.transport.mqtt.MQTTProtocolConverter.onMQTTConnect(MQTTProtocolConverter.java:235)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.transport.mqtt.MQTTProtocolConverter.onMQTTCommand(MQTTProtocolConverter.java:157)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.apache.activemq.transport.ws.MQTTSocket.onMessage(MQTTSocket.java:59)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.websocket.WebSocketConnectionRFC6455$WSFrameHandler.onFrame(WebSocketConnectionRFC6455.java:860)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.websocket.WebSocketParserRFC6455.parseNext(WebSocketParserRFC6455.java:349)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.websocket.WebSocketConnectionRFC6455.handle(WebSocketConnectionRFC6455.java:225)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
java.lang.Thread.run(Thread.java:745)
11:17:43,012 ERROR [stderr] (qtp10117087-119) Caused by:
java.lang.RuntimeException: Failed to setup EJB remote context
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.jboss.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:438)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:115)
11:17:43,012 ERROR [stderr] (qtp10117087-119) ... 25 more
11:17:43,012 ERROR [stderr] (qtp10117087-119) Caused by:
java.lang.reflect.InvocationTargetException
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:17:43,012 ERROR [stderr] (qtp10117087-119) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
11:17:43,028 ERROR [stderr] (qtp10117087-119) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:17:43,028 ERROR [stderr] (qtp10117087-119) at
java.lang.reflect.Method.invoke(Method.java:606)
11:17:43,028 ERROR [stderr] (qtp10117087-119) at
org.jboss.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:420)
11:17:43,028 ERROR [stderr] (qtp10117087-119) ... 26 more
11:17:43,028 ERROR [stderr] (qtp10117087-119) Caused by:
java.lang.SecurityException: EJB client context selector may not be
changed
11:17:43,028 ERROR [stderr] (qtp10117087-119) at
org.jboss.ejb.client.EJBClientContext.setSelector(EJBClientContext.java:181)
11:17:43,028 ERROR [stderr] (qtp10117087-119) at
org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.setupSelector(RemoteNamingEjbClientContextSelector.java:18)
11:17:43,028 ERROR [stderr] (qtp10117087-119) ... 31 more
According to https://developer.jboss.org/thread/273859, "Setting jboss.naming.client.ejb.context = true tries to create an EJB client context selector but it is already created for the JBoss EAP 6 instance," so "It is not possible to change the ejbSelector if the client run inside the [JBoss] server", as you're doing. The recommendation in that thread is to use the scoped-context feature (7.5.4. Using Scoped EJB Client Contexts) for a situation like yours.
BTW, I was thinking that the other approach that might work is to go back to doing a local (non-remote) lookup that relies on the fact that your code is ultimately running inside of JBoss, as you were originally trying to do in your first question (Get EJB object inside rar deployed inside jboss). But https://developer.jboss.org/thread/273428 say "You need to implement the Remote interface to be able to look it up from a different application ear/jar," so I think that's not a viable option, and the way you're approaching it (doing a remote invocation) sounds like the right approach.
EDIT 1, based on the comment on 6/23/2017:
Based on the "Pre-requisites of remotely accessible JNDI objects" section of https://docs.jboss.org/author/display/AS72/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project, EJBs are only remotely exposed when they satisfy two conditions:
1) Such objects should be bound under the java:jboss/exported/
namespace. For example, java:jboss/exported/foo/bar
2) Objects bound to the java:jboss/exported/ namespace are expected to be serializable.
This allows the objects to be sent over the wire to the remote clients
When I look at the logs showing EJBs being registered from your original question, I don't see anything to indicate that the EJB you're trying to access is being bound under the java:jboss/exported/ namespace. For the remote lookup to work, I think you'll also need to figure out how to bind your EJB under that namespace, in addition to using a scoped context.
A little background:
I am trying to use spring-boot-actuator in spring MVC application that we have in production. It is NOT a spring-boot-application.
I have put together a simple spring MVC App with spring-boot-actuator.
The sample code is available here. It is simple app to clone and reproduce the error. I have README with instructions in there.
I have used spring-boot-actuator 1.1.1.RELEASE dependency and it works fine.
However, when I wanted to use 1.2.5.RELEASE and that is where I get errors during container start up.
SEVERE: StandardWrapper.Throwable
java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$RequestMappingEndpointConfiguration#requestMappingEndpoint due to internal class not found. This can happen if you are #ComponentScanning a springframework package (e.g. if you put a #ComponentScan in the default package by mistake)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:51)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:92)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:174)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:136)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:324)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:530)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1091)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/SmartInitializingSingleton
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:163)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:152)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:120)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:95)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:45)
... 30 more
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.SmartInitializingSingleton
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 42 more
Sep 05, 2015 9:09:42 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /MyController threw load() exception
java.lang.ClassNotFoundException: org.springframework.beans.factory.SmartInitializingSingleton
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:163)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:152)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:120)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:95)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:45)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:92)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:174)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:136)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:324)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:530)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1091)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
You're using an old and incompatible version of Spring Framework. I'd guess 4.0.x.
SmartInitializingSingleton is new in Spring Framework 4.1. Furthermore, as described in the documentation, Spring Boot 1.2.5 requires Spring Framework 4.1.5.RELEASE or above.
Does anyone know how i cant listen to global hotkeys in javaFX?
i found a library for normal java but i cant get it to work with javafx.
I can get it to work on a normal java project but. When i use it in a javafx project i get the following error
jfx-project-run:
Executing D:\Administrator\Documents\NetBeansProjects\MPDClient\dist\run1477960237\MPDClient.jar using platform C:\Program Files\Java\jdk1.7.0_51\jre/bin/java
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.javafx.main.Main.launchApp(Main.java:698)
at com.javafx.main.Main.main(Main.java:871)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoClassDefFoundError: com/sun/jna/Platform
at com.tulskiy.keymaster.common.Provider.getCurrentProvider(Provider.java:52)
at mpdclient.FXMLDocumentController.initialize(FXMLDocumentController.java:173)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2193)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2069)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2830)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2809)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2795)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2782)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2771)
at mpdclient.MPDClient.start(MPDClient.java:26)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:219)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:182)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:179)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Platform
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.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 21 more
Link to the Libray
thanks in advance
You need to add jna library in your dependencies:
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.1.0</version>
</dependency>
Add this in pom.xml