当前位置: 首页 > 知识库问答 >
问题:

Wildfly 8.2.0 invocate安全远程ejb

东郭自珍
2023-03-14

我试图调用一个安全的远程ejb,但我不能。我使用ejb-client-API。

应用程序部署在名为som的ear中。耳朵

我用的是Wildfly 8.2.0决赛

代码客户端:

public class SomTestClient {

public static void main(String[] args) throws Exception {
    invokeStatelessBean();
}

private static void invokeStatelessBean() throws NamingException  {
    final RemoteCalculator statelessRemoteCalculator = lookupRemoteStatelessCalculator();
    int a = 204;
    int b = 340;
    int sum = statelessRemoteCalculator.add(a, b);
    System.out.println("Remote calculator returned sum = " + sum);

}

private static RemoteCalculator lookupRemoteStatelessCalculator()
        throws NamingException {
    final Hashtable jndiProperties = new Hashtable();
    jndiProperties.put(Context.URL_PKG_PREFIXES,
            "org.jboss.ejb.client.naming");
    Context context = new InitialContext(jndiProperties);
    String jdniLookup = "ejb:som/platform_api_service/CalculatorBean!"
            + RemoteCalculator.class.getName();
    return (RemoteCalculator) context.lookup(jdniLookup);
}
}

JBossEJB客户端。财产

remote.connections=default

remote.connection.default.host=127.0.0.1
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false

remote.connection.default.username=admin
remote.connection.default.password=scheduler

EJB

@Stateless
@SecurityDomain("som_security_domain")
@DeclareRoles("tms_login")
@RolesAllowed("tms_login")
@Remote(RemoteCalculator.class)
public class CalculatorBean implements RemoteCalculator {
    @Override
    public int add(int a, int b) {
        return a + b;
    }

    @Override
    public int subtract(int a, int b) {
        return a - b;
    }
}

独立的。xml

<security-realms>
    ....
    <security-realm name="SomRealm">
        <authentication>
            <jaas name="som_security_domain"/>
        </authentication>
    </security-realm>
    ....
</security-realms>
....
<subsystem xmlns="urn:jboss:domain:remoting:2.0">
    <endpoint worker="default"/>
    <http-connector name="http-remoting-connector" connector-ref="default" security-realm="SomRealm"/>
</subsystem>
....
<security-domains>
    <security-domain name="som_security_domain" cache-type="default">
        <authentication>
            <login-module code="Database" flag="required">
                <module-option name="dsJndiName" value="java:jboss/datasources/TMSDS"/>
                <module-option name="principalsQuery" value="select Password from TMSUser where UserName=?"/>
                <module-option name="rolesQuery" value="select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=?"/>
            </login-module>
        </authentication>
    </security-domain>
</security-domains>

服务器日志

2015-06-23 13:30:24,108 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "darioschmidtpc:MANAGEMENT" task-3) Client version 2.0.0.Final
2015-06-23 13:30:24,134 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "darioschmidtpc:MANAGEMENT" task-2) Chosen version 0x02
2015-06-23 13:30:24,139 DEBUG [org.jboss.remotingjmx.protocol.v2.ParameterProxy] (Remoting "darioschmidtpc:MANAGEMENT" task-2) Created connection - ID to be established after parameter negotiation.
2015-06-23 13:30:24,153 DEBUG [org.jboss.remotingjmx.protocol.v2.ServerProxy] (pool-2-thread-1) Created connectionID edb2b548-f8b0-4b5c-8531-1bafd5c86cd9
2015-06-23 13:30:24,153 DEBUG [org.jboss.remotingjmx.RemotingConnectorServer] (pool-2-thread-1) Connection 'edb2b548-f8b0-4b5c-8531-1bafd5c86cd9' now opened.
2015-06-23 13:30:34,529 TRACE [org.jboss.security] (default task-1) PBOX000200: Begin isValid, principal: admin, cache entry: null
2015-06-23 13:30:34,529 TRACE [org.jboss.security] (default task-1) PBOX000209: defaultLogin, principal: admin
2015-06-23 13:30:34,530 TRACE [org.jboss.security] (default task-1) PBOX000221: Begin getAppConfigurationEntry(som_security_domain), size: 4
2015-06-23 13:30:34,531 TRACE [org.jboss.security] (default task-1) PBOX000224: End getAppConfigurationEntry(som_security_domain), AuthInfo: AppConfigurationEntry[]:
[0]
LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
ControlFlag: LoginModuleControlFlag: required
Options:
name=dsJndiName, value=java:jboss/datasources/TMSDS
name=principalsQuery, value=select Password from TMSUser where UserName=?
name=rolesQuery, value=select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=?

2015-06-23 13:30:34,534 TRACE [org.jboss.security] (default task-1) PBOX000236: Begin initialize method
2015-06-23 13:30:34,534 TRACE [org.jboss.security] (default task-1) PBOX000262: Module options [dsJndiName: java:jboss/datasources/TMSDS, principalsQuery: select Password from TMSUser where UserName=?, rolesQuery: select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=?, suspendResume: true]
2015-06-23 13:30:34,535 TRACE [org.jboss.security] (default task-1) PBOX000240: Begin login method
2015-06-23 13:30:34,541 TRACE [org.jboss.security] (default task-1) PBOX000263: Executing query select Password from TMSUser where UserName=? with username admin
2015-06-23 13:30:34,548 FINE  [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:2 created by (ConnectionID:2 ClientConnectionId: 2fdf752a-850a-415a-8eb6-d900b16854cd)
2015-06-23 13:30:34,560 FINE  [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:2: calling sp_prepexec: PreparedHandle:0, SQL:select Password from TMSUser where UserName=@P0        
2015-06-23 13:30:34,563 FINE  [com.microsoft.sqlserver.jdbc.internals.SQLServerResultSet] (default task-1) SQLServerResultSet:2 created by (SQLServerPreparedStatement:2)
2015-06-23 13:30:34,568 TRACE [org.jboss.security] (default task-1) PBOX000241: End login method, isValid: true
2015-06-23 13:30:34,568 TRACE [org.jboss.security] (default task-1) PBOX000242: Begin commit method, overall result: true
2015-06-23 13:30:34,568 TRACE [org.jboss.security] (default task-1) PBOX000263: Executing query select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=? with username admin
2015-06-23 13:30:34,570 TRACE [org.jboss.security] (default task-1) PBOX000263: Executing query select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=? with username admin
2015-06-23 13:30:34,570 FINE  [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:3 created by (ConnectionID:3 ClientConnectionId: 884a76af-268c-4742-859b-9087141727a2)
2015-06-23 13:30:34,571 FINE  [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:3: calling sp_prepexec: PreparedHandle:0, SQL:select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=@P0        
2015-06-23 13:30:34,576 FINE  [com.microsoft.sqlserver.jdbc.internals.SQLServerResultSet] (default task-1) SQLServerResultSet:3 created by (SQLServerPreparedStatement:3)
2015-06-23 13:30:34,579 TRACE [org.jboss.security] (default task-1) PBOX000210: defaultLogin, login context: javax.security.auth.login.LoginContext@7660e36, subject: Subject(1245810797).principals=org.jboss.security.SimplePrincipal@489131543(admin)org.jboss.security.SimpleGroup@870530995(Roles(members:tms_login,tms_security_admin))org.jboss.security.SimpleGroup@870530995(CallerPrincipal(members:admin))
2015-06-23 13:30:34,580 TRACE [org.jboss.security] (default task-1) PBOX000207: updateCache, input subject: Subject(1245810797).principals=org.jboss.security.SimplePrincipal@489131543(admin)org.jboss.security.SimpleGroup@870530995(Roles(members:tms_login,tms_security_admin))org.jboss.security.SimpleGroup@870530995(CallerPrincipal(members:admin)), cached subject: Subject(1494215433).principals=org.jboss.security.SimplePrincipal@489131543(admin)org.jboss.security.SimpleGroup@870530995(Roles(members:tms_login,tms_security_admin))org.jboss.security.SimpleGroup@870530995(CallerPrincipal(members:admin))
2015-06-23 13:30:34,580 TRACE [org.jboss.security] (default task-1) PBOX000208: Inserted cache info: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@bee0537
2015-06-23 13:30:34,580 TRACE [org.jboss.security] (default task-1) PBOX000201: End isValid, result = true
2015-06-23 13:30:34,581 TRACE [org.jboss.security.audit] (default task-1) [Success]principal=admin;Action=authentication;Source=org.jboss.as.security.service.SimpleSecurityManager;
2015-06-23 13:30:34,621 DEBUG [org.jboss.as.ejb3] (default task-3) Client with protocol version 2 and marshalling strategy river trying to communicate on Channel ID 67b58316 (inbound) of Remoting connection 274a0859 to /127.0.0.1:63598
2015-06-23 13:30:34,625 DEBUG [org.jboss.as.ejb3] (default task-3) Sending initial module availability message, containing 5 module(s) to channel Channel ID 67b58316 (inbound) of Remoting connection 274a0859 to /127.0.0.1:63598
2015-06-23 13:30:34,627 DEBUG [org.jboss.as.ejb3] (default task-3) Writing out cluster formation message for 0 clusters, to channel Channel ID 67b58316 (inbound) of Remoting connection 274a0859 to /127.0.0.1:63598
2015-06-23 13:30:34,737 TRACE [org.jboss.security] (EJB default - 1) PBOX000200: Begin isValid, principal: admin, cache entry: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@bee0537
2015-06-23 13:30:34,737 TRACE [org.jboss.security] (EJB default - 1) PBOX000204: Begin validateCache, domainInfo: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@bee0537, credential class: class java.lang.String
2015-06-23 13:30:34,738 TRACE [org.jboss.security] (EJB default - 1) PBOX000205: End validateCache, result = true
2015-06-23 13:30:34,738 TRACE [org.jboss.security] (EJB default - 1) PBOX000201: End isValid, result = true
2015-06-23 13:30:34,738 TRACE [org.jboss.security.audit] (EJB default - 1) [Success]principal=admin;Action=authentication;Source=org.jboss.as.security.service.SimpleSecurityManager;
2015-06-23 13:30:34,738 TRACE [org.jboss.security] (EJB default - 1) PBOX000354: Setting security roles ThreadLocal: {}
2015-06-23 13:30:34,750 ERROR [stderr] (EJB default - 1) Jun 23, 2015 1:30:34 PM nl.tudelft.simulation.naming.JVMContextFactory getInitialContext

2015-06-23 13:30:34,750 ERROR [stderr] (EJB default - 1) WARNING: unused environment variables in jndi.properties

2015-06-23 13:30:34,754 TRACE [org.jboss.as.security] (EJB default - 1) Look up of JNDI for som_security_domain/authorizationMgr failed with java:jboss not found.
2015-06-23 13:30:34,755 TRACE [org.jboss.as.security] (EJB default - 1) Exception getting AuthorizationManager for domain=
2015-06-23 13:30:34,755 TRACE [org.jboss.security] (EJB default - 1) PBOX000354: Setting security roles ThreadLocal: null
2015-06-23 13:30:34,755 ERROR [org.jboss.as.ejb3.invocation] (EJB default - 1) JBAS014134: EJB Invocation failed on component CalculatorBean for method public abstract int com.soteica.platform.api.tests.RemoteCalculator.add(int,int): java.lang.RuntimeException: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
    at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:305) [wildfly-security-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:133) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:330) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_25]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_25]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_25]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_25]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
    at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:298) [picketbox-4.0.21.Final.jar:4.0.21.Final]
    at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:303) [wildfly-security-8.2.0.Final.jar:8.2.0.Final]
    ... 32 more

客户端日志

Jun 23, 2015 1:30:34 PM nl.tudelft.simulation.naming.JVMContextFactory getInitialContext
WARNING: unused environment variables in jndi.properties
Jun 23, 2015 1:30:34 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.0.1.Final
Jun 23, 2015 1:30:34 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.0.Final
Jun 23, 2015 1:30:34 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.0.Final
Jun 23, 2015 1:30:34 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.6.Final
Jun 23, 2015 1:30:34 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
Jun 23, 2015 1:30:34 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@306279ee, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@545997b1,channel=jboss.ejb,nodename=darioschmidtpc]} on channel Channel ID e7b58316 (outbound) of Remoting connection 3eecc1af to /127.0.0.1:8080
Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
    at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:305)
    at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:133)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:330)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)
    at java.util.concurrent.Executors$RunnableAdapter.call(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)
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
    at ...asynchronous invocation...(Unknown Source)
    at org.jboss.ejb.client.remoting.InvocationExceptionResponseHandler$MethodInvocationExceptionResultProducer.getResult(InvocationExceptionResponseHandler.java:96)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:276)
    at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocationResult(EJBObjectInterceptor.java:64)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
    at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocationResult(EJBHomeInterceptor.java:88)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
    at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:46)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
    at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:129)
    at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:265)
    at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:453)
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:202)
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
    at com.sun.proxy.$Proxy0.add(Unknown Source)
    at com.soteica.som.client.test.SomTestClient.invokeStatelessBean(SomTestClient.java:24)
    at com.soteica.som.client.test.SomTestClient.main(SomTestClient.java:16)
Caused by: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
    at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:298)
    at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:303)
    at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:133)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:330)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70)
    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)
    at java.util.concurrent.Executors$RunnableAdapter.call(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)
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

我可以看到,之所以使用安全域“som_security_domain”的配置,是因为它运行查询以获取密码和主体的角色,但在尝试执行安全域的AuthenticationManager的查找时失败。在日志中我可以看到:

[org.jboss.as.security](EJB默认值-1)在JNDI中查找som_security_domain/authorizationMgr失败,java:未找到jboss。

提前谢谢

共有1个答案

曾嘉福
2023-03-14

问题在于文件夹lib(naming-2.0.9.jar)中的DSOL Simulation Environment库。该库包含一个jndi文件。财产。一旦我删除了文件,一切都好了。我可以用安全域的注释将ejb远程调用。

 类似资料:
  • 我知道jar文件(或类文件)可以用URLClassLoader远程加载。但是这种方法能防止盗版吗? 假设我在服务器上有一个jar文件,在客户端,我可以用URLClassLoader动态加载jar。但是安全呢?jar文件是否下载到客户端的临时目录中?有人可以访问jar文件的内容并对其进行反编译吗? 提前感谢, 奥努尔

  • 我的本地分支映射到远程分支:

  • 本文向大家介绍Docker开启远程安全访问的图文教程详解,包括了Docker开启远程安全访问的图文教程详解的使用技巧和注意事项,需要的朋友参考一下 一、编辑docker.service文件 vi /usr/lib/systemd/system/docker.service 找到 [Service] 节点,修改 ExecStart 属性,增加 -H tcp://0.0.0.0:2375 ExecSt

  • 我有一个http-connector级别的安全领域(ApplicationRealm ),还有一个用于远程出站连接的安全领域,名为MyRealm。当我设置jboss-ejb-client属性时,我设置了以下两个属性: remote.connection.default.username=${用户名} remote.connection.default.password=${密码} 这有助于我向远程

  • 问题内容: HttpUrlConnection线程安全吗?即,如果我有一个连接到服务器的HttpConnection实例,并且该实例被不同的线程使用(例如,尝试同时发送POST),HttpUrlConnection将如何处理这种情况?a)他们将串行发送POST,还是b)第一个线程发送POST,获取响应,然后第二个线程发送POST?如果它们以串行方式发送POST,则意味着到同一tcp连接的多个活动P

  • 假设我有一个Executors静态工厂方法的ExecutorService实例。 如果我从某个线程提交了一个调用,其中RetVal不是线程安全的本地实例化对象,那么当我从同一个线程获得()它时,我需要担心retvals的完整性吗?人们说局部变量是线程安全的,但我不确定当您返回一个本地实例化的对象并从其他线程接收它时,它是否适用。 下面是我的定制实现,我只是为了测试。您可以忽略EType枚举。