Calling a method on ear deployment.
Hi,
Our application needs to do some pre-processing when the application ear file is first deployed.
Is it possible to execute custom code when a particular ear file is deployed to application server? I looked around and found few ways to do it, none of them worked as specified. I would appreciate any help.
Following are the suggested methods .
1. Include a servlet in the ear file that loads on startup and put the custom code in the init method. I tried this but even though I specify load-on-startup to 0 in web.xml, the init method doesn't get called when the app server starts, (it gets called when first time the servlet is accessed from a browser).
2. The second option suggested was to create a client application in the ear file that has main method and specify in orion-application.xml
<client-module path="client.jar" auto-start="true" user="anonymous" />
(In the test case that I made, the client.jar has a single class that has a main method that prints a message. I also made sure that the manifest.mf file in client.jar has the class name specified for Main-class property and there is an application-client.xml file in this jar file). However, the main method didn't get called when I deployed the ear file as the document suggested.
Any help in this regard is very much appreciated.
Thanks,
prashant.
class Life extends JPanel{
pulic Life( JFrame owner )
owner.doSomething(); // pass the JFrame to the constructor and feel free to use it
}[code[
Similar Messages
-
How to initialized main method in a deployed application
Hello,
I am trying to deploy a simple java application to OC4J, I created a jar file as my deployment profile and then I created EAR file and finally delpoyed succesfully, but I'm wondering how can I start my main method in deployed application, note that my application requires some input arguments as well. Any ideas how can I do that ?
Regards,
Hussam GalalI might be missing the point of this post, but you can't 'start your main method' in any type of deployed application.
You must expose your methods via some mechanism. You could call your method via a JSP, wrap in an EJB and create a client to call it remotely etc.
What is in your JAR file? Just POJOs? If so you will have to wrap them in EJBs so they can be called, that or deploy a web application with some servlets or JSPs so they are accessible via some URL. -
JCA - Failed calling get method getThreadSecurity on the ManagedConnectionF
Hi All,
This is my first post with the SDN, hope I could see and extend helping hands in form of technology and solutions
My problem
=============
I am new to JCA.I am trying to deploy the helloworldra.ear provided by the IBM site.I deployed the resoource adapter and created a connectionFactory named "HelloWorld"(jndi).I get the below mentioned exception when I do
ConnectionFactory cxFactory = (ConnectionFactory) context.lookup("java:comp/env/HelloWorld");
Kindly chek into the exception and provide me with the solution.
Thanks in Advance
KABA
Exceptions Snapshot
==================
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O Populating Context
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O #################### JNDI Context Contents ####################
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.hostname.normalizer ---:-- com.ibm.ws.naming.util.DefaultHostnameNormalizer
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O java.naming.factory.initial ---:-- com.ibm.websphere.naming.WsnInitialContextFactory
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.name.syntax ---:-- jndi
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.namespace.connection ---:-- lazy
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.ws.naming.ldap.ldapinitctxfactory ---:-- com.sun.jndi.ldap.LdapCtxFactory
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.jndicache.cacheobject ---:-- populated
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.namespaceroot ---:-- defaultroot
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.ws.naming.wsn.factory.initial ---:-- com.ibm.ws.naming.util.WsnInitCtxFactory
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.jndicache.maxcachelife ---:-- 0
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.jndicache.maxentrylife ---:-- 0
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O com.ibm.websphere.naming.jndicache.cachename ---:-- providerURL
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O java.naming.provider.url ---:-- corbaloc:rir:/NameServiceServerRoot
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O java.naming.factory.url.pkgs ---:-- com.ibm.ws.runtime:com.ibm.ws.naming
[7/7/06 14:38:27:624 EDT] 5a004128 SystemOut O #################### JNDI Context Contents END ####################
[7/7/06 14:38:28:718 EDT] 5a004128 ConnectionFac E J2CA0066E: Failed calling get method getThreadSecurity on the ManagedConnectionFactory class com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jca/HelloWorld with the value <null>. Exception is java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.getThreadSecurity(WSManagedConnectionFactoryImpl.java:612)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getThreadSecurity(ConnectionFactoryBuilderImpl.java:2520)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFactoryBuilderImpl.java:1747)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1188)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:144)
at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:127)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:135)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1227)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ssya.helloworldra.servlets.HelloWorldBean.execute(HelloWorldBean.java:81)
at org.apache.jsp._HelloWorldResults._jspService(_HelloWorldResults.java:105)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.dispatch(HelloWorldController.java:101)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.performTask(HelloWorldController.java:66)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.doPost(HelloWorldController.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
[7/7/06 14:38:28:812 EDT] 5a004128 ConnectionFac E J2CA0009E: An exception occurred while trying to instantiate the ManagedConnectionFactory class com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jca/HelloWorld : java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.getThreadSecurity(WSManagedConnectionFactoryImpl.java:612)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getThreadSecurity(ConnectionFactoryBuilderImpl.java:2520)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFactoryBuilderImpl.java:1747)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1188)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:144)
at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:127)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:135)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1227)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ssya.helloworldra.servlets.HelloWorldBean.execute(HelloWorldBean.java:81)
at org.apache.jsp._HelloWorldResults._jspService(_HelloWorldResults.java:105)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.dispatch(HelloWorldController.java:101)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.performTask(HelloWorldController.java:66)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.doPost(HelloWorldController.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
[7/7/06 14:38:28:859 EDT] 5a004128 Helpers W NMSV0605W: A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jca/HelloWorld" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl
Reference Factory Class Location URLs: <null>
Reference Class Name: HelloWorld
Type: connectorName
Content: HelloWorld
Type: classpath
Content: C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1\runtimes\base_v5/lib/rsadapter.rar
Type: FactoryJndiName
Content: jca/HelloWorld
Address Type: dd
AddressContents: ffffffac ffffffed 0 5 73 72 0 25 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 52 65 73 6f 75 72 63 65 ...
Address Type: poolProps
AddressContents: ffffffac ffffffed 0 5 73 72 0 27 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 43 6f 6e 6e 65 63 74 6f ...
Address Type: configProps
AddressContents: ffffffac ffffffed 0 5 73 72 0 23 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 43 6f 6e 6e 65 63 74 6f ...
Address Type: mmProps
AddressContents: ffffffac ffffffed 0 5 73 72 0 14 6a 61 76 61 2e 75 74 69 6c 2e 50 72 6f 70 65 72 74 69 65 73 39 12 ffffffd0 7a ...
Address Type: mbeanProps
AddressContents: ffffffac ffffffed 0 5 73 72 0 1a 63 6f 6d 2e 69 62 6d 2e 65 6a 73 2e 6a 32 63 2e 4d 42 65 61 6e 50 72 6f ...
Exception data follows:
java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.getThreadSecurity(WSManagedConnectionFactoryImpl.java:612)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getThreadSecurity(ConnectionFactoryBuilderImpl.java:2520)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFactoryBuilderImpl.java:1747)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1188)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:144)
at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:127)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:135)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1227)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ssya.helloworldra.servlets.HelloWorldBean.execute(HelloWorldBean.java:81)
at org.apache.jsp._HelloWorldResults._jspService(_HelloWorldResults.java:105)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.dispatch(HelloWorldController.java:101)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.performTask(HelloWorldController.java:66)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.doPost(HelloWorldController.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
[7/7/06 14:38:28:953 EDT] 5a004128 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: lookup
Context name: localhost/nodes/localhost/servers/server1
Target name: jca/HelloWorld
Other data:
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.getThreadSecurity(WSManagedConnectionFactoryImpl.java:612)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getThreadSecurity(ConnectionFactoryBuilderImpl.java:2520)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFactoryBuilderImpl.java:1747)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1188)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:144)
at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:127)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:135)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1227)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.ibm.ssya.helloworldra.servlets.HelloWorldBean.execute(HelloWorldBean.java:81)
at org.apache.jsp._HelloWorldResults._jspService(_HelloWorldResults.java:105)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.dispatch(HelloWorldController.java:101)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.performTask(HelloWorldController.java:66)
at com.ibm.ssya.helloworldra.servlets.HelloWorldController.doPost(HelloWorldController.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
[7/7/06 14:38:29:031 EDT] 5a004128 ConnectionFac E J2CA0066E: Failed calling get method getThreadSecurity on the ManagedConnectionFactory class com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jca/HelloWorld with the value <null>. Exception is java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.getThreadSecurity(WSManagedConnectionFactoryImpl.java:612)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getThreadSecurity(ConnectionFactoryBuilderImpl.java:2520)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createMCFandPM(ConnectionFPersianKamran wrote:
folks.. i am sending my class object on Sockets from client to Server (i am implementing Seriablizable Interface).
No your aren't.
You are sending the data in the class.
That is what serialization does. (And actually not all data can be sent either.)
When i get the object on server, i am able to print all its fields and methods... But i have one problem. I want to invoke a simple static method that just prints "hello".. The method on client that i am trying to invoke is....You probably either need stop attempting that or re-architect the solution.
It is possible to send a class (not data) to another computer and that computer runs it. That is how applets work.
But for that to work you must send the class. And deal with how the VM loads and unloads classes (not data) as well. -
Error while calling a method on Bean (EJB 3.0)
I am getting an error while calling a method on EJB. I am using EJB3.0 and my bean is getting properly deployed(i am sure b'cos i can see the successfullly deployed message). Can any body help me
Error is -->
Error while destroying resource :An I/O error has occured while flushing the output - Exception: java.io.IOException: An established connection was aborted by the software in your host machine
Stack Trace:
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
at sun.nio.ch.IOUtil.write(IOUtil.java:75)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
at com.sun.enterprise.server.ss.provider.ASOutputStream.write(ASOutputStream.java:138)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.postgresql.PG_Stream.flush(PG_Stream.java:352)
at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
at org.postgresql.jdbc1.AbstractJdbc1Connection.rollback(AbstractJdbc1Connection.java:1031)
at org.postgresql.jdbc2.optional.PooledConnectionImpl$ConnectionHandler.invoke(PooledConnectionImpl.java:223)
at $Proxy34.close(Unknown Source)
at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:274)
at com.sun.enterprise.resource.LocalTxConnectorAllocator.destroyResource(LocalTxConnectorAllocator.java:103)
at com.sun.enterprise.resource.AbstractResourcePool.destroyResource(AbstractResourcePool.java:603)
at com.sun.enterprise.resource.AbstractResourcePool.resourceErrorOccurred(AbstractResourcePool.java:713)
at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:424)
at com.sun.enterprise.resource.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:393)
at com.sun.enterprise.resource.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:69)
at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:618)
at com.sun.gjc.spi.ConnectionHolder.close(ConnectionHolder.java:163)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:379)
at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:367)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:402)
at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.afterJTSTransaction(DatasourceAccessor.java:100)
at oracle.toplink.essentials.threetier.ClientSession.afterTransaction(ClientSession.java:104)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.afterTransaction(UnitOfWorkImpl.java:1816)
at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.afterCompletion(AbstractSynchronizationListener.java:161)
at oracle.toplink.essentials.transaction.JTASynchronizationListener.afterCompletion(JTASynchronizationListener.java:87)
at com.sun.ejb.containers.ContainerSynchronization.afterCompletion(ContainerSynchronization.java:174)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:467)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy84.addDepartment(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
End of Stack Trace
|#]
RAR5035:Unexpected exception while destroying resource. To get exception stack, please change log level to FINE.
EJB5018: An exception was thrown during an ejb invocation on [DepartmentSessionBean]
javax.ejb.EJBException: Unable to complete container-managed transaction.; nested exception is: javax.transaction.SystemException
javax.transaction.SystemException
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:452)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy84.addDepartment(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)Means theres an error in XML/ABAP conversion probably due a syntax error...
Regards
Juan -
Call applet methods from Javascript
Hello,
If I call applet method like :
function callbackFunc(){
var pp = appletID.getData();
alert(pp);
It works only if applet is deployed with <APPLET> tag or with javascript.
If applet is deployed using <Object> and <embed> tags, in browser console the error is :
TypeError: appletID.getData is not a function
I couldn't find why is that behaviour. What do I do wrong?
ThanksHi Paul,
(1)Seems to be your Java Runtime Environment path is still setted for JRE 1.3.0_01 and not for 1.3.1. So pelase go to the
Control Panel-->java plugin 1.3.1-->Advanced. Here you set the Java Runtime Environment to the JRE 1.3.1 version. Its better to remove the older version before installing the new version on JRE.
(2)<OBJECT> tag won't work for Netscape. You can only use <APPLET> or <EMBED> tag for Netscape.
Hope this will help you.
Anil
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support -
How to reference sapjco from EAR deployment descriptors
Hello techies,
I´ve set up an EJB to use the JCo RFC Provider Service of the J2EE engine. Connection from R3 to EJB works but as soon as the EJB gets invoked, I get the error 'incompatible bean type - no processFunction found' from the RFCDefaultRequestHandler.invokeBean(..., JCO.Function) method.
The reason is clear to me - the JCO.Function class is loaded by different class loaders and thus the method parameters don´t match.
I´ve read in earlier postings that it is neccessary to reference the JCO in the module project and the ear deployment descriptor. That´s where my question begins.
How do I reference the JCO in the module project (what´s that?)? I think it has to do with the EJB jar, doesn´t it?
In the DeployTool I found a way how to set a reference to a library in the menu deploy-->libraries. But I am not sure what to specify here. I entered 'sapjco', since I saw an entry in the managers/library.txt file. Is that correct?
Any hints are welcome!
Regards,
JanJan,
you can set the reference to the EAR project using the reference.txt file that exists in the /managers folder.
In the library.txt file set a path which is reference to sapjco.jar files..like
library JCO sapjco.jar
in the refernce.txt add the JCO referece to the EAR project...like
reference Project library:JCO
where Project here is the name of your EAR file..
Ravi -
Hello Everyone,
I´m trying to call a method wich is inside a DDL by JNI. This works fine in a Java console application. However, this call doesn´t work when i put this operation in a web apllication and deploy in a weblogic server. I´ve already put the dll path in the PATH variable but it didn´t work. When I debug the application, the DLL can be loaded but i call the native method a error happens and a get the following message:
java.lang.UnsatisfiedLinkError: criptografa
at com.tim.util.cripto.ACC_Cripto.criptografa(Native Method)
Why does it work when I use a java console application ?
Thanks for help
Rodrigo LopesI see yere points but what I see on linux is it makes it to the constructor of the Java object and somewhere afterwards it bails out, the Java app does work alone. It appears to have problems initializing the JFrame, could there be a problem with the Java inheritance when a JVM is invoked throurgh native invocation??
Here's some of the Java stuff
public class Framework extends WindowAdapter {
public int numWindows = 0;
private Point lastLocation = null;
private int maxX = 500;
private int maxY = 500;
public Framework() {
System.out.println("JAVA Framework cnst");//GETTING HERE
makeNewWindow();
public void makeNewWindow() {
System.out.println("JAVA makeWindow"); //GETTING HERE
JFrame frame = new MyFrame(this); //NOT GETTING HERE!!!!!!!!!
numWindows++;
System.out.println("Number of windows: " + numWindows);
System.out.println("Frame location: " + lastLocation);
frame.setVisible(true);
System.out.println("Post Java set frame visible");
public static void main(String[] args) {
System.out.println("Main method in Framework");
Framework framework = new Framework();//GETTING HERE
class MyFrame extends JFrame {
protected Dimension defaultSize = new Dimension(200, 200);
protected Framework framework = null;
public MyFrame(Framework controller) {
super("New Frame");
System.out.println("MyFrame cnst ");//NOT GETTING HERE!!!!!!
framework = controller;
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
addWindowListener(framework);
JMenu menu = new JMenu("Window");
menu.setMnemonic(KeyEvent.VK_W);
setSize(defaultSize);
} -
ClassCastException when calling finder-method
Hello,
i want to get all results from my table. Therefore i created an entity bean with a new finder method ejbFindAll which returns a Collection.
In my stateless session bean i am instantiating the entity bean in this way:
+CustomerLocalHome myCustomerLocalHome = null;
Context myContext = new InitialContext();
myCustomerLocalHome =(CustomerLocalHome) myContext.lookup("/bsp_ear/CustomerBean");+
When i now call the method in this way:
+ myCustomerLocalHome.findAll();+
i get a ClassCastExcetpion.
Does anybody know what this causes?
I tried for hours an could not find a solutions
Thanks for help,
AndréHi Andre,
Just a suggestion.
In your deployment descriptor what class you have written against EJBNAME ?Is tht CustomerLocalHome??
Rdgs,
Guru -
Calling varargs method without varargs parameter.
Hello
I really appreciate your help on clarifying the following problem.
1) I have method signature as
public User validateUser(User usr, boolean isLogin,Object...args)
2) When I call this method as
obj.validateUser(usrObject,true);
In windows environment, the method implementation specified in 1) is called and no issues.
But, when the same code is deployed on linux, I get the following error
java.lang.NoSuchMethodError: com.mysubpackage.dao.myobject.*validateUser(Lcom/startf orce/system/User;Z)Lcom/startforce/system/User;*
Please let me know, if there is any known incompatibility issue out there between windows and linux.
Thanks
MuthuHi Jverd
You are right! I think I worked too much and got lost somewhere, to prove me wrong I wrote the following test class and ran on both linux and windows and produced the same result (as it should). -:) Thanks all of you for responding.
public class VarArgsTest {
* @param args
public static void main(String[] args) {
VarArgsTest test = new VarArgsTest();
System.out.println("\nCalling varArgs with two parameter as test.printVarArgs(\"I am Param1 Value\", \"I am Param2 value\")");
test.printVarArgs("I am Param1 Value", "I am Param2 value");
System.out.println("Calling varArgs with three parameter as test.printVarArgs(\"I am Param1 Value\", \"I am Param2 value\", \"I am Param3 value\")");
test.printVarArgs("I am Param1 Value", "I am Param2 value","I am Param2 value");
public void printVarArgs(String param1, String param2, Object...objects) {
System.out.println("\nparam1 = "+param1+"\nparam2 = "+param2);
System.out.println();
System.out.println(" param3 [Object...objects] length = "+objects.length);
System.out.println();
if(objects.length > 0)
System.out.println("Param 3 is not empty and its first value is = "+objects[0]);
else
System.out.println("Param 3 is empty and nothing to display, it is an empty array ");
Output
Calling varArgs with two parameter as test.printVarArgs("I am Param1 Value", "I am Param2 value")
param1 = I am Param1 Value
param2 = I am Param2 value
param3 [Object...objects] length = 0
Param 3 is empty and nothing to display, it is an empty array
Calling varArgs with three parameter as test.printVarArgs("I am Param1 Value", "I am Param2 value", "I am Param3 value")
param1 = I am Param1 Value
param2 = I am Param2 value
param3 [Object...objects] length = 1
Param 3 is not empty and its first value is = I am Param2 value
Edited by: Startup_Muthu on Mar 12, 2008 11:41 AM
Edited by: Startup_Muthu on Mar 12, 2008 11:43 AM -
IBFBS failed to deploy in Embedde OC4J but works with EAR deploy.
Hi
When i try to deploy IBFBS sample project in JDevloper by Embedde OC4J : its giving
an error saying "there is no EJB module to deploy".
But when i deployed through EAR deployment method its working fine.
PLease kindly help me.
Sai.Hi,
Can you pls post the Version of JDeveloper and OC4J that you are using?
I tried to deploy IBFBS using JDeveloper 9.0.3.988 (JDK 1.3.1) on Standalone OC4J server (9.0.3) and it works fine.
One constraint for not running the application from JDeveloper (by using embedded OC4J) is that, the OC4J where the FBS is deployed needs to have the -userThreads option enabled.
This option is enabled by starting OC4J with -userThreads option.
java -jar oc4j.jar -userThreadsRef : Connection to embedded OC4J per FBS Setup Tutorial-Problem.
Let us know if your problem still persists.
Thanks
-- OTN@IDC Team -
Calling the method deployJava.installJRE("1.6*") always installs JRE7
The call to deployJava.installJRE(verison, callback) in deployjava.js
seems to ignore the version when we supply *"1.6*"* as a version and always installs the latest java 7.
This happens if we had npdeployJava1.dll version 10.3.0.5 from Java7 still on the machine after uninstalling java7.
Any ideas how to make it respect the version requested?
note: deployjava.js is the deployment toolkit javascript that came before dtjava.js
Edited by: bali on 05-Apr-2012 13:36
Edited by: bali on 05-Apr-2012 13:37Only with The dt toolkit installed can deployJava install specific versions or families. The javascript will default, if no dt plugin is available to calling java.com to install the latest secure version available.
After that, the dt plugin, deploy1ava1.dll, or npdeployJava1.dll should be available for IE and Firefox type browsers, and if not specifically disabled in the browser, you should be able to do this specif installation.
My testing shows with JRE 8 or JRE 7, or some earlier JRE 6 version already installed, calling the method deployJava.installJRE("1.6*") currently installs 1.6.0_31.
/Andy -
AutomationException while calling a method
Hi all,
I've got a problem accessing a COM/DCOM component in a Win2k box (Advanced Server)
with jcom. I configured the server and client described in the "JSP to COM" example.
The only difference: I don't want to access the excel sheet and I don't use a jsp
to execute.
I used the java2com.exe to create the proxies from my dll ScriptableUniversalTransAgt.dll.
But when I try to call a method on the dll via Java, I get the exception:
AutomationException: 0x80070005 - General access denied error in 'Invoke'
at com.bea.jcom.Rpc.a(Rpc.java)
at com.bea.jcom.be.a(be.java)
at com.bea.jcom.StdObjRef.a(StdObjRef.java)
at com.bea.jcom.Dispatch.vtblInvoke(Dispatch.java)
at de.conet.galileo.suta.IScriptableUniversalTransAgentProxy.setHcmName(IScriptableUniversalTransAgentProxy.java:271)
at de.conet.galileo.suta.ScriptableUniversalTransAgent.setHcmName(ScriptableUniversalTransAgent.java:336)
at de.conet.galileo.SUTATest.start(SUTATest.java:33)
at de.conet.galileo.SUTATest.main(SUTATest.java:27)
I checked everything on the server, the user has all rights he needs but it doesn't
work. In the eventlog of the server I can see that the login was successful.
The attachment contains some log files and my program with the dll.
Maybe someone can help me?
Thanks
Michael
[src.zip]"Jeff Muller" <[email protected]> wrote in message
news:[email protected]...
Yeah, now I'm getting this error on code that worked two days ago.
javax.servlet.ServletException: Unable to initialize servlet:
AutomationExceptio
n: 0x80070005 - General access denied error, status: Getting instance, and
calli
ng initialize.
at com.teloquent.MyApp.MyServlet.initCOMObj(MyServlet.
java:308)
at com.teloquent.MyApp.MyServlet.init(MyServlet.java:8
1)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:700)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:643)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:588)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:368)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
... but then again, I don't expect any response here.
"Michael" <[email protected]> wrote in message
news:[email protected]...
Hi all,
I've got a problem accessing a COM/DCOM component in a Win2k box
(Advanced
Server)
with jcom. I configured the server and client described in the "JSP toCOM" example.
The only difference: I don't want to access the excel sheet and I don'tuse a jsp
to execute.
I used the java2com.exe to create the proxies from my dllScriptableUniversalTransAgt.dll.
But when I try to call a method on the dll via Java, I get the
exception:
>>
AutomationException: 0x80070005 - General access denied error in'Invoke'
at com.bea.jcom.Rpc.a(Rpc.java)
at com.bea.jcom.be.a(be.java)
at com.bea.jcom.StdObjRef.a(StdObjRef.java)
at com.bea.jcom.Dispatch.vtblInvoke(Dispatch.java)
atde.conet.galileo.suta.IScriptableUniversalTransAgentProxy.setHcmName(IScript
ableUniversalTransAgentProxy.java:271)
at
de.conet.galileo.suta.ScriptableUniversalTransAgent.setHcmName(ScriptableUni
versalTransAgent.java:336)
at de.conet.galileo.SUTATest.start(SUTATest.java:33)
at de.conet.galileo.SUTATest.main(SUTATest.java:27)
I checked everything on the server, the user has all rights he needs butit doesn't
work. In the eventlog of the server I can see that the login wassuccessful.
The attachment contains some log files and my program with the dll.
Maybe someone can help me?
Thanks
Michael -
Generically calling a method on an object
Hello,
I am trying to write a small utility method to generically call a method on an object.
This is what I have.
public static void doCall(Object o, String methodName, Object ... args){
Class[] types = new Class[args.length];
int i = 0;
for(Object arg : args){
types[i] = arg.getClass();
try {
Method m = o.getClass().getMethod(methodName, types);
m.invoke(o, args);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Error dynamically calling method " + methodName + " on " + o.toString());
}It doesn't work because it can't find the method. If I hard code the parameter types as "new Object[] {Double.TYPE}" it works fine (on methods that take a double).
So, my question is, how can I generically set up the parameter types based on the types of the arguments?
Thanks,
~EricThe problem is not on calling agr.getClass(), your primitive double is already autoboxed to a Double object. It is the doCall(...) method who expects an object, not a primitive. So when giving it a primitive value, java autoboxes it to the corresponding object type.
This means your attempt will only work if the methods to call do not have any primitives as parameters.
Test this code:
public class GenericMethodCaller {
public static void doCall(Object o, String methodName, Object ... args){
Class[] types = new Class[args.length];
int i = 0;
for(Object arg : args){
types[i++] = arg.getClass();
try {
Method m = o.getClass().getMethod(methodName, types);
m.invoke(o, args);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Error dynamically calling method " + methodName + " on " + o.toString());
public static void main(String[] args) {
Callable callee = new Callable();
callee.callabelMethod(10d);
GenericMethodCaller.doCall( callee, "callabelMethod", 10d ); // 10d gets autoboxed to a Double object.
class Callable {
public void callabelMethod(Double o) {
System.out.println("callabelMethod(Double o) called");
public void callabelMethod(double o) {
System.out.println("callabelMethod(double o) called");
}The output will be:
callabelMethod(double o) called
callabelMethod(Double o) called
- Roy -
Calling a method on backing bean in response to contextual event
Hi
I am using Jdeveloper 11.1.1.6.0 and using ADF contextual events..
I have a drop down list and i am rasiing a contextual event on changing the current selection. In response to that event i want to call a backing bean method with parameters.. But when i click on the subscriber section for the contextual event, i can see only some bindings of the page.. How can i call a method on backing bean as a subscriber..
Thanks
RaghuHi,
this article has a use case for the POJO approach: http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html
Another is to define a method binding in the receiving PageDef file and configure it as explained here
http://java.net/projects/smuenchadf/pages/ADFSamplesBindings/revisions/3#SMU164
Frank -
Any way (event) to call Java method after view created in JSF 2.0
Hi,
I am using JSF 2.0 Mojarra's implementation.
I am interested to know if there is a way to call Java methods before and/or after view has been restored.
I wanted to initialize data for my page in this Java method.
I could see there is an event class PostRestoreStateEvent added in JSF 2.0. How to use it?
I tired to use f:event element as below, but it does not work. Can anyone share anyother idea to achieve this behaviour?
<f:metadata>
<f:event type="postRestoreState" listener="#{employeeLoadBean.loadAfterRestoreView}"/>
</f:metadata>
Regards,
Kishore K SHi,
The problem is solved as below.
<f:metadata>
<f:event type="javax.faces.event.PostRestoreStateEvent" listener="#{employeeViewEventListener.postRestoreState}"/>
</f:metadata>
The above calls the Java method #{employeeViewEventListener.postRestoreState} whenever View has been restored.
It was not working when shortName of the event (ie., postRestoreState) is given and throwing ClassNotFound exception.
Regards,
Kishore K S
Maybe you are looking for
-
Hi all I am vex. Any idea how to solve this Print Layout Design printing error happening to only one sap user's computer? Other sap users login to the same Database printing the same Print Layout Design Name in their own computer has no problem. Howe
-
I need to delete the photo album on my iphone 4, I went though all of the steps on the support page but the only place the pics were deleted were on my pc not my phone. When I selected selected alnums, it only gave the options of albums on my pc. it
-
Can we use Windows Server 2012 RDS CAL license in RDS 2008 R2 Server
Respected Sir, We have RDS Server 2012 CAL license select plus but we want to use Windows Server 2008 R2 RDS so is it possible to use 2012 RDS license in RDS 2008 Server? if yes how can put this. Waiting for your reply. thanks, Hiren Patel +91 99740
-
Horrible time making customs themes and masters
I'm having just the most difficult time working with Keynote (2.0.2) and custom themes. I've create a new master slides but all kinds of problems just keep creeping in. First the bullets that I created on the master would (sometimes) be hidden on the
-
Bluetooth doesn't work on iPhone6 and no restore from iTunes
Once again Apple released a buggy phone. Much like the iPhone5, iPhone6 has already shown issues in the connectivity department. Thousands of users have already blogged about it all over the internet, so I hope that Apple steps up to the plate and fi