Struts Action Invocation Framework for Struts 1.3 - struts

I'm trying to integration SAIF plugin to intercept my struts action. I learn from
http://struts.sourceforge.net/saif/index.html
I've write configuration like this:
struts-config.xml
<plug-in className="net.sf.struts.saif.SAIFPlugin">
<set-property property="interceptor-config" value="/WEB-INF/interceptor-config.xml" />
</plug-in>
interceptor-config.xml
<interceptor-config>
<interceptor name="componentInterceptor" type="net.sf.struts.saif.ComponentInterceptor"/>
<interceptor name="testInterceptor" type="net.sf.struts.saif.TestInterceptor"/>
<default-interceptors>
<interceptor name="componentInterceptor"/>
</default-interceptors>
<action type="org.apache.struts.webapp.example.EditRegistrationAction">
<interceptor name="testInterceptor"/>
</action>
</interceptor-config>
I got error like this:
javax.servlet.UnavailableException: Specified RequestProcessor not compatible with saif.
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:402)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
can you help me to solve this problem ?

Quoting this message from the struts users mailing list:
It's unlikely that SAIF would work
with the default S1.3 config since the
request processor is different--you
could try using the old request
processor if your application doesn't
rely on it.
AFAICT SAIF wouldn't work with
anything other than the standard (old)
request processor, but it might be
possible to hack it up so it would.

I haven't worked with the Struts Action Invocation Framework before but the exception message is familiar to me from Tiles. Tiles throws a message like this: Specified RequestProcessor not compatible with TilesRequestProcessor so I think that besides the familiarity of the message (in your case Specified RequestProcessor not compatible with saif) there is also a chance that the cause be the same.
Here is an article that fixes this on the Tiles plugin. Might help you.
When the Struts Servlet is initialized it does an init of all the plugins. The message should come from the init method of your plugin and if it is the same as Tiles then a test with Class.isAssignableFrom should be the cause.
EDIT: Looked up the source code for the SAIF plugin and found this in it:
protected void initRequestProcessorClass(ActionServlet servlet, ModuleConfig config) throws ServletException {
.........
.........
ControllerConfig ctrlConfig = config.getControllerConfig();
String configProcessorClassname = ctrlConfig.getProcessorClass();
.........
.........
// Check if specified request processor is compatible with saif.
try {
Class saifProcessorClass = SAIFRequestProcessor.class;
Class saifTilesProcessorClass = SAIFTilesRequestProcessor.class;
Class configProcessorClass = Class.forName(configProcessorClassname);
if (!saifProcessorClass.isAssignableFrom(configProcessorClass)
&& !saifTilesProcessorClass.isAssignableFrom(configProcessorClass)) {
String msg = "Specified RequestProcessor not compatible with saif.";
throw new ServletException(msg);
}
} catch (Exception ex) {
throw new ServletException(ex);
}
.........
.........
}
It seems to be the same as with Tiles plugin so the article that I indicated contains the answer.

Related

Kotlin Error: Im a beginner in Kotlin programming and came up with this error

Im a beginner in Kotlin programming and came up with this error my code is fine but when I compile it an error always occur:
Error:Kotlin: [Internal Error] java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.io.InvalidClassException: com.intellij.util.io.PersistentEnumeratorBase$CorruptedException; local class incompatible: stream classdesc serialVersionUID = -8686679909601592115, local class serialVersionUID = -5823904506976358318
at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:273)
at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:217)
at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:162)
at com.sun.proxy.$Proxy12.incrementalCache_getModuleMappingData(Unknown Source)
at org.jetbrains.kotlin.daemon.RemoteIncrementalCacheClient.getModuleMappingData(RemoteIncrementalCacheClient.kt:37)
at org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackagePartProvider$moduleMappings$1.invoke(IncrementalPackagePartProvider.kt:36)
at org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackagePartProvider$moduleMappings$1.invoke(IncrementalPackagePartProvider.kt:27)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:355)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:474)
at org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackagePartProvider.findPackageParts(IncrementalPackagePartProvider.kt:44)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageFragment$binaryClasses$2.invoke(LazyJavaPackageFragment.kt:43)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageFragment$binaryClasses$2.invoke(LazyJavaPackageFragment.kt:36)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:355)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:474)
at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageFragment.getBinaryClasses$descriptors_jvm(LazyJavaPackageFragment.kt)
at org.jetbrains.kotlin.load.java.lazy.descriptors.JvmPackageScope$kotlinScopes$2.invoke(JvmPackageScope.kt:44)
at org.jetbrains.kotlin.load.java.lazy.descriptors.JvmPackageScope$kotlinScopes$2.invoke(JvmPackageScope.kt:36)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:355)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:474)
at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
at org.jetbrains.kotlin.load.java.lazy.descriptors.JvmPackageScope.getKotlinScopes(JvmPackageScope.kt)
at org.jetbrains.kotlin.load.java.lazy.descriptors.JvmPackageScope.getContributedClassifier(JvmPackageScope.kt:55)
at org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope.getContributedClassifier(ChainedMemberScope.kt:33)
at org.jetbrains.kotlin.resolve.scopes.AbstractScopeAdapter.getContributedClassifier(AbstractScopeAdapter.kt:44)
at org.jetbrains.kotlin.resolve.lazy.FileScopeFactory$currentPackageScope$1.getContributedClassifier(FileScopeFactory.kt:260)
at org.jetbrains.kotlin.resolve.scopes.ResolutionScope$DefaultImpls.getContributedClassifierIncludeDeprecated(ResolutionScope.kt:40)
at org.jetbrains.kotlin.resolve.scopes.HierarchicalScope$DefaultImpls.getContributedClassifierIncludeDeprecated(Scopes.kt)
at org.jetbrains.kotlin.resolve.scopes.ImportingScope$DefaultImpls.getContributedClassifierIncludeDeprecated(Scopes.kt)
at org.jetbrains.kotlin.resolve.lazy.FileScopeFactory$currentPackageScope$1.getContributedClassifierIncludeDeprecated(FileScopeFactory.kt:253)
at org.jetbrains.kotlin.resolve.scopes.utils.ScopeUtilsKt.findFirstClassifierWithDeprecationStatus(ScopeUtils.kt:118)
at org.jetbrains.kotlin.resolve.QualifiedExpressionResolver.findClassifierAndReportDeprecationIfNeeded(QualifiedExpressionResolver.kt:78)
at org.jetbrains.kotlin.resolve.QualifiedExpressionResolver.resolveDescriptorForType(QualifiedExpressionResolver.kt:102)
at org.jetbrains.kotlin.resolve.TypeResolver.resolveDescriptorForType(TypeResolver.kt:932)
at org.jetbrains.kotlin.resolve.TypeResolver$resolveTypeElement$1.visitUserType(TypeResolver.kt:247)
at org.jetbrains.kotlin.psi.KtVisitorVoid.visitUserType(KtVisitorVoid.java:923)
at org.jetbrains.kotlin.psi.KtVisitorVoid.visitUserType(KtVisitorVoid.java:21)
at org.jetbrains.kotlin.psi.KtUserType.accept(KtUserType.java:42)
at org.jetbrains.kotlin.psi.KtElementImplStub.accept(KtElementImplStub.java:59)
at org.jetbrains.kotlin.resolve.TypeResolver.resolveTypeElement(TypeResolver.kt:245)
at org.jetbrains.kotlin.resolve.TypeResolver.resolvePossiblyBareType(TypeResolver.kt:124)
at org.jetbrains.kotlin.resolve.TypeResolver.resolveType(TypeResolver.kt:114)
at org.jetbrains.kotlin.resolve.TypeResolver.resolveType(TypeResolver.kt:85)
at org.jetbrains.kotlin.resolve.FunctionDescriptorResolver.resolveValueParameters(FunctionDescriptorResolver.kt:419)
at org.jetbrains.kotlin.resolve.FunctionDescriptorResolver.createValueParameterDescriptors(FunctionDescriptorResolver.kt:301)
at org.jetbrains.kotlin.resolve.FunctionDescriptorResolver.initializeFunctionDescriptorAndExplicitReturnType(FunctionDescriptorResolver.kt:195)
at org.jetbrains.kotlin.resolve.FunctionDescriptorResolver.resolveFunctionDescriptor(FunctionDescriptorResolver.kt:128)
at org.jetbrains.kotlin.resolve.FunctionDescriptorResolver.resolveFunctionDescriptor(FunctionDescriptorResolver.kt:95)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getDeclaredFunctions(AbstractLazyMemberScope.kt:115)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.access$getDeclaredFunctions(AbstractLazyMemberScope.kt:36)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$declaredFunctionDescriptors$1.invoke(AbstractLazyMemberScope.kt:56)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$declaredFunctionDescriptors$1.invoke(AbstractLazyMemberScope.kt:36)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:512)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunctionToNotNull.invoke(LockBasedStorageManager.java:587)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.doGetFunctions(AbstractLazyMemberScope.kt:96)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.access$doGetFunctions(AbstractLazyMemberScope.kt:36)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$functionDescriptors$1.invoke(AbstractLazyMemberScope.kt:49)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$functionDescriptors$1.invoke(AbstractLazyMemberScope.kt:36)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:512)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunctionToNotNull.invoke(LockBasedStorageManager.java:587)
at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedFunctions(AbstractLazyMemberScope.kt:92)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitNamedFunction(LazyDeclarationResolver.kt:125)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitNamedFunction(LazyDeclarationResolver.kt:94)
at org.jetbrains.kotlin.psi.KtNamedFunction.accept(KtNamedFunction.java:50)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:94)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:91)
at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.createFunctionDescriptors(LazyTopDownAnalyzer.kt:282)
at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations(LazyTopDownAnalyzer.kt:204)
at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations$default(LazyTopDownAnalyzer.kt:60)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:82)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:554)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:81)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:545)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:176)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:163)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:85)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:105)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1479)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.io.InvalidClassException: com.intellij.util.io.PersistentEnumeratorBase$CorruptedException; local class incompatible: stream classdesc serialVersionUID = -8686679909601592115, local class serialVersionUID = -5823904506976358318
at java.base/java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:715)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1999)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1868)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2161)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1685)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:499)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:457)
at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:270)
... 99 more
This is a known Kotlin compiler bug, you can watch https://youtrack.jetbrains.com/issue/KT-39474 for updates.
As a workaround, please rebuild the project, so incremental compilation caches are cleared.
Hello, I've had this error before, try the following steps: restart IntelliJ, restart PC / laptop, update IntelliJ.
If the error still occurs, change under "Project Structure", "Project SDK" to any Java version click on "Apply", wait until the project has been successfully indexed, now switch the "Project SDK" back to Kotlin, click "Apply" again and wait again till the project has been successfully indexed.
The error should normally no longer occur.

How do I solve EclipseLink's (MOXy) 'getting property "eclipselink.oxm.metadata-source" is not supported'?

I've got the following piece of code which I've put together mainly based on tutorials on EclipseLink's website:
Partner p = new Partner();
p.setId(1);
p.setKey("a");
p.setName("this is the name");
Map<String, Source> metadataSourceMap = new HashMap<String, Source>();
metadataSourceMap.put("com.company.pas.entity.partner", new StreamSource("/com/company/pas/entity/mapping/partner-pojo2xml.xml"));
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, metadataSourceMap);
JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] {Partner.class}, properties);
When I try to run this piece of code, all I get is an exception:
Exception in thread "main" javax.xml.bind.JAXBException: property "eclipselink.oxm.metadata-source" is not supported
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:115)
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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:445)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
I haven't included the "mapping file" (partner-pojo2xml.xml) here, as the exception occurs regardless of whether the mapping file is added to the metaDataSourceMap or not.
The relevant part from pom.xml can be found below.
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.1</version>
</dependency>
What am I doing wrong? I've tried too many combinations, but I just can't get it to run.
You need to be sure you have a jaxb.properties file with the following entry:
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
When you are using Maven this file needs to be in a directory structure matching the package name of the classes used to bootstrap the JAXBContext. This structure needs to go under the src/main/resources folder. Below is a link to an example I have in GitHub:
https://github.com/bdoughan/blog20110322

Object in mule's registry cannot be cast to org.mule.construct.AbstractFlowConstruct on application startup

I'm trying to store instance of some class in mule registry on flow application startup. Below you can see my java code and flow fragment. My problem is that sometimes application deployment fails with following error:
Caused by: java.lang.ClassCastException: com.company.test.sorter.model.Config cannot be cast to org.mule.construct.AbstractFlowConstruct
at org.mule.module.management.mbean.FlowConstructService.postRegister(FlowConstructService.java:139)
at org.mule.module.management.agent.ClassloaderSwitchingMBeanWrapper.postRegister(ClassloaderSwitchingMBeanWrapper.java:101)
You can find whole stacktrace below. I must repeat: this exception is raised only sometimes, approximately every fifth deployment of unchanged application. In most cases application runs perfectly fine. I googled for this exceptions and classes but I didn't find any solution. I am using Mule 3.2.1 (standalone). Is it a bug or am I doing something wrong?
#XmlRootElement(name = "config")
public class Config {
private String x2Regex;
private String x3Regex;
private String x2QueueName;
private String x3QueueName;
// constructors, getters and setters
}
public class Initializer implements
MuleContextNotificationListener<MuleContextNotification> {
#Override
public void onNotification(MuleContextNotification notification) {
if (notification.getAction() == MuleContextNotification.CONTEXT_STARTED) {
try {
notification.getMuleContext().getRegistry().registerObject("config", new Config());
} catch (RegistrationException e) {
// cut
}
}
}
}
<notifications>
<notification event="CONTEXT"/>
<notification-listener ref="Initializer"/>
</notifications>
<spring:beans>
<spring:bean id="Initializer" name="Initializer" class="com.company.test.sorter.Initializer" doc:name="Bean"/>
</spring:beans>
Below is fragment of mule's log with exception:
+ Failed to deploy app 'number-sorter', see below +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
org.mule.module.launcher.DeploymentException: Failed to deploy application [number-sorter]
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:68)
at org.mule.module.launcher.DeploymentService.start(DeploymentService.java:175)
at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:157)
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.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:56)
at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788)
Caused by: org.mule.api.MuleRuntimeException: MBeans Failed to initialise
at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:707)
at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:685)
at org.mule.context.notification.Sender.dispatch(Sender.java:40)
at org.mule.context.notification.Policy.dispatch(Policy.java:122)
at org.mule.context.notification.ServerNotificationManager.notifyListeners(ServerNotificationManager.java:244)
at org.mule.context.notification.ServerNotificationManager.fireNotification(ServerNotificationManager.java:197)
at org.mule.DefaultMuleContext.fireNotification(DefaultMuleContext.java:404)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:226)
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146)
at org.mule.module.launcher.application.ApplicationWrapper.start(ApplicationWrapper.java:107)
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:52)
... 8 more
Caused by: javax.management.RuntimeMBeanException: RuntimeException thrown in postRegister method
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(Unknown Source)
at org.mule.module.management.agent.JmxAgent.registerFlowConstructServices(JmxAgent.java:428)
at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:700)
... 18 more
Caused by: java.lang.ClassCastException: com.company.test.sorter.model.Config cannot be cast to org.mule.construct.AbstractFlowConstruct
at org.mule.module.management.mbean.FlowConstructService.postRegister(FlowConstructService.java:139)
at org.mule.module.management.agent.ClassloaderSwitchingMBeanWrapper.postRegister(ClassloaderSwitchingMBeanWrapper.java:101)
... 25 more
Feels like a bug: after reading the source code, I find no reasonable explanation to why Mule would try to register your custom object in JMX while mistaking it for a Flow!
As a side note, why using a notification listener and the Mule registry when you can just build your object with Spring?

Can't access remote EJB

I've created EJB with remote and local interfaces.
#Stateless
public class VendorBean implements VendorBeanLocal, VendorBeanRemote {
...
}
#Local
public interface VendorBeanLocal {
...
}
#Remote
public interface VendorBeanRemote {
...
}
There are some methods instead of dots (it doesn't matter in this case).
Then deploy it to glassfish 3.1. It's accessible from my client web application (deployed as war on the same server) and works fine. But I can't access it from my integration tests.
I wrote integration test which is supposed to be run by maven 2. I looked JNDI name of this bean in the glassfish server.log:
java:global/<my business module name>/VendorBean!<package>.VendorBeanRemote
and wrote the test. But I always get exception on lookup:
javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:61)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:501)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:540)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:518)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at com.widewebtech.mercury.core.test.ejb.VendorBeanIntegrationTest.manageVendor(VendorBeanIntegrationTest.java:126)
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:616)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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:616)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:487)
... 33 more
The code of test:
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
p.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
p.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
Context context = new InitialContext(p);
Object o = context.lookup("java:global/<my business module name>/VendorBean!<package>.VendorBeanRemote");
I'm confused. I've read a lot of articles, tried a lot suggestions but nothing works.
I've also tried to list a context within the test:
NamingEnumeration<NameClassPair> list = context.list("");
while (list.hasMore()) {
NameClassPair ncPair = (NameClassPair) list.next();
System.out.print(ncPair.getName() + " (type ");
System.out.println(ncPair.getClassName() + ")");
}
Result:
<package>.VendorBeanRemote__3_x_Internal_RemoteBusinessHome__ (type com.sun.corba.se.impl.corba.CORBAObjectImpl)
SerialContextProvider (type com.sun.corba.se.impl.corba.CORBAObjectImpl)
java:global (type com.sun.jndi.cosnaming.CNCtx)
INITIAL_GIS (type com.sun.corba.se.impl.corba.CORBAObjectImpl)
So, looks like bean in the context.
What I do wrong? Please help!
Eventually I've managed to solve this issue. So, the code is:
Properties p = new Properties();
p.setProperty(Context.PROVIDER_URL, "corbaname:iiop:localhost:3700");
context = new InitialContext(p);
VendorBeanRemote vendorBean = (VendorBeanRemote) context.lookup("java:global/<my business module name>/VendorBean!<package>.VendorBeanRemote");
Important thing, gf-client.jar must be in the classpath. It can be taken from the
glassfish lib directory.
If somebody is strugling with remote EJB calls between 2 different hosts on glassfish, with the exception stated above:
Set your orb-listener-1 network adress to your IP. (ORB / IIOP listeners section in config)

Unable to do a remote ejb access from a different host

We are using a servlet to access a remote ejb deployed on a different host and getting the
exception mentioned in the stacktrace below.
The remote access works if the servlet client and the remote ejb war are deployed in different domains and on the same host.
Works if they are deployed on the same host and same domain
does not work when deployed on two diffrent hosts.
Looking at the exception"CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No", we thought it could be security issue.
But the test ejb application didnt have any security configurations. Tried adding the "" details to the sun-ejb-jar.xml
and used ProgrammaticLogin api. We got the same exception. Not sure if the security config was correct though.
The glassfish-corba log level was set to finest in the server where the ejb application was deployed. We then got this exception, "
org.omg.CORBA.BAD_INV_ORDER: FINE: IOP01600015: Service context add failed in portable interceptor because a service context with id 15 already exists vmcid: SUN minor code: 15 completed: No".
The full stacktrace is mentioned below in the server log.
tried using the front-end back-end test cases from Glassfish bug: http://java.net/jira/browse/GLASSFISH-15523. We are
getting the same exception.
Glassfish version: 3.1 build 43
Not sure where we are going wrong. Please help. Thanks.
Client Side log:
Caused by: javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=TestService,Remote 3.x interface =com.medallion.test.service.TestService,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:50.57.150.62:3700#TestService,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'corbaname:iiop:50.57.150.62:3700#TestService__3_x_Internal_RemoteBusinessHome__' [Root exception is org.omg.CORBA.BAD_PARAM: FINE: IOP00100009: string_to_object conversion failed due to bad schema specific part in name TestService__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No]
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:178)
at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1106)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:172)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 38 more
Caused by: org.omg.CORBA.BAD_PARAM: FINE: IOP00100009: string_to_object conversion failed due to bad schema specific part in name TestService__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy142.soBadSchemaSpecific(Unknown Source)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:227)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:154)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:145)
at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:976)
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:171)
... 43 more
Caused by: org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace----------
org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.handle_null_service_context(SecServerRequestInterceptor.java:421)
at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:443)
at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeServerInterceptorIntermediatePoint(InterceptorInvoker.java:612)
at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIIntermediatePoint(PIHandlerImpl.java:612)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.getServantWithPI(CorbaServerRequestDispatcherImpl.java:333)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:196)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
----------END server-side stack trace---------- vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:900)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:131)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:637)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:499)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:373)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:273)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:395)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextExtHelper.narrow(NamingContextExtHelper.java:73)
at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:212)
... 47 more
Server Side log( after setting the corba log level to finest):
[#|2011-12-02T11:37:16.111-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory;MethodName=setAcceptedSocketOptions;|setAcceptedSocketOptions: SocketOrChannelAcceptorImpl[3700 IIOP_CLEAR_TEXT true true] ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=3700] Socket[addr=/173.13.42.205,port=54829,localport=3700]|#]
[#|2011-12-02T11:37:16.113-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=15;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.180-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.179-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.POAProtocolMgr;MethodName=getEjbDescriptor;|POAProtocolMgr.getEjbDescriptor->: [B#77dc7838|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.POAProtocolMgr;MethodName=getEjbDescriptor;|POAProtocolMgr.getEjbDescriptor: [B#77dc7838: ejbId: 4,294,967,297|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.logging.LogDomains$1;MethodName=getResourceBundle;|Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.GlassFishORBManager|#]
[#|2011-12-02T11:37:16.181-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.org.glassfish.enterprise.iiop.impl|_ThreadID=161;_ThreadName=Thread-2;ClassName=org.glassfish.enterprise.iiop.impl.POAProtocolMgr;MethodName=getEjbDescriptor;|POAProtocolMgr.getEjbDescriptor<-: [B#77dc7838: null|#]
[#|2011-12-02T11:37:16.183-0600|FINE|glassfish3.1.1|javax.enterprise.resource.corba.OMG|_ThreadID=161;_ThreadName=Thread-2;ClassName=com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator;MethodName=handleFullLogging;|IOP01600015: Service context add failed in portable interceptor because a service context with id 15 already exists
org.omg.CORBA.BAD_INV_ORDER: FINE: IOP01600015: Service context add failed in portable interceptor because a service context with id 15 already exists vmcid: SUN minor code: 15 completed: No
at sun.reflect.GeneratedConstructorAccessor729.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy210.serviceContextAddFailed(Unknown Source)
at com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl.enqueue(ServerRequestInfoImpl.java:702)
at com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl.add_reply_service_context(ServerRequestInfoImpl.java:482)
at com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl.setCurrentExecutionPoint(ServerRequestInfoImpl.java:738)
at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIEndingPoint(PIHandlerImpl.java:632)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.runInterceptors(CorbaMessageMediatorImpl.java:2189)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.createResponseHelper(CorbaMessageMediatorImpl.java:2101)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.createResponseHelper(CorbaMessageMediatorImpl.java:2089)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.createSystemExceptionResponse(CorbaMessageMediatorImpl.java:2014)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1796)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1758)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:255)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
|#]
Code used:
Client:
servlet:
#WebServlet("/TestServlet")
public class TestServlet extends HttpServlet {
#EJB(name = "TestService")
private TestService testService;
/**
* #see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter w = response.getWriter();
try {
w.write("Test o/p: " + testService.testEJB("This is a test msg") + "\n");
} catch (Exception e) {
e.printStackTrace(w);
}
}
}
sun-web.xml:
<ejb-ref>
<ejb-ref-name>TestService</ejb-ref-name>
<!-- <jndi-name>corbaname:iiop:localhost:3700#TestService</jndi-name> -->
<jndi-name>corbaname:iiop:<ip>:3700#TestService</jndi-name>
</ejb-ref>
Remote ejb:
#Stateless(mappedName="TestService")
public class TestServiceImpl implements Serializable, TestService {
private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(TestServiceImpl.class.getName());
#Resource EJBContext ejbContext;
#Override
public String testEJB(String testStr) {
String userName = ejbContext.getCallerPrincipal().getName();
System.out.println("Username: " + userName);
return "Msg Recieved: " + testStr;
}
sun-ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>TestServiceImpl</ejb-name>
<jndi-name>TestService</jndi-name>
<!--<ior-security-config>
<as-context>
<auth-method>USERNAME_PASSWORD</auth-method>
<realm>database-realm</realm>
<required>true</required>
</as-context>
<sas-context>
<caller-propagation>supported</caller-propagation>
</sas-context>
<transport-config>
<establish-trust-in-client>supported</establish-trust-in-client>
</transport-config>
</ior-security-config>-->
</ejb>
</enterprise-beans>
<security-role-mapping>
</security-role-mapping>
</sun-ejb-jar>
Perhaps not the answer to your question but I'll mention this here:
We had a similar problem with glassfish 3.1.2 where the occurring exception mentions CORBA.NO_PERMISSION and there is no stacktrace on the server side. Somewhere in the logfile we found the Exception Invalid iiop-listener orb-listener-1. Lazy-init not supported for SSL iiop-listeners
This is a bug in glassfish see:
https://java.net/jira/browse/GLASSFISH_CORBA-13
The glassfish admin interface automatically adds an SSL entry to the configured non SSL iiop-listener, due to this, the exception occures and remoting won't work anymore. As workaround you can remove the SSL-config-entry from the domain.xml manually to get remoting work again. But a soon as you open the IOP-Listener section again in the admin interface, the entry will be created again on glassfish restart.