Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Initial context exception

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

When am trying to run the java code in tomcat server which tries to create the Initial context object with the following properties it is throwing an exception.


In my sample.client.T3MBeanConnector.java i have the following code.

Hashtable table = new Hashtable();
table.put(Context.SECURITY_PRINCIPAL, user);
table.put(Context.SECURITY_CREDENTIALS, password);
table.put(Context.PROVIDER_URL, url);
table.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

sop("Map obj : " + table); // This works

InitialContext context = new InitialContext(table); // It strucks & exception is thrown

sop("Context obj : " + context); //This will never get printed


It is throwing an exception given below.In order to create an initial context object I've set weblogic.jar in classpath in catalina.bat.From the stacktrace it is understandable that it has also been considered.But I dont know how to fix the below issue. From where(which jar) it is taking this SAXParserFactory is unknown still.When i try to run as a simple standalone program it works.But when tomcat is executing the same code it is not working.Strange!!!.What is wrong here?.

java.lang.NoSuchMethodError: javax.xml.parsers.SAXParserFactory.getSchema()Ljavax/xml/validation/Schema;
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.<init>(SAXParserImpl.java:124)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:98)
at weblogic.xml.jaxp.WebLogicSAXParser.<init>(WebLogicSAXParser.java:45)
at weblogic.xml.jaxp.WebLogicSAXParserFactory.newSAXParser(WebLogicSAXParserFactory.java:51)
at weblogic.rmi.internal.DescriptorManager.getDescriptorAsMap(DescriptorManager.java:176)
at weblogic.rmi.internal.DescriptorManager.getDescriptorAsMap(DescriptorManager.java:162)
at weblogic.rmi.internal.DescriptorManager.createRuntimeDescriptor(DescriptorManager.java:107)
at weblogic.rmi.internal.DescriptorManager.getBasicRuntimeDescriptor(DescriptorManager.java:88)
at weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:54)
at weblogic.rmi.extensions.server.ServerHelper.getRuntimeDescriptor(ServerHelper.java:332)
at weblogic.common.internal.RMIBootServiceStub.<clinit>(RMIBootServiceStub.java:29)
at weblogic.security.acl.internal.Security.authenticate(Security.java:177)
at weblogic.jndi.WLInitialContextFactoryDelegate.authenticateRemotely(WLInitialContextFactoryDelegate.java:700)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:633)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:440)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:353)
at weblogic.jndi.Environment.getContext(Environment.java:263)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at sample.client.T3MBeanConnector.getServerConnector(Unknown Source)
at sample.client.MBeanConnectionHelper.getMBeanServer(Unknown Source)
at sample.servlets.RuntimeAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Details of s/w used :

Weblogic : 9.1
Tomcat : 5.0
JDK : 1.5

Any inputs on this would be highly appreciated!!.
Expecting reply at the earliest..Thanks in advance..

Regards,
Priya.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Try to find out whether you have multiple XMLParser in your Tomcat Path
Since you have mentioned you dont know which Parser says that

Bye
 
I don't always make ads but when I do they're tiny
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic