While compiling jsp WebLogic 12c throw error - java

weblogic.servlet.jsp.CompilationException: Failed to compile JSP /jspnew/loans/loanRepayment.jsp
loanRepayment.jsp:383:143: This attribute is not recognized.
branchBtnDisabled="" branchDescName="" branchDescValue="<%=branchDesc%>" branchDescCssClass = "FieldTextRO" branchTabIndex="<%=""+tabIndex++%>" branchDescReadonly="true" branchDescTabIndex="-1"
^------^
loanRepayment.jsp:386:122: This attribute is not recognized.
moduleDescName="" moduleDescValue="<%=moduleDesc%>" moduleDescCssClass = "FieldTextRO" moduleTabIndex="<%=""+tabIndex++%>" moduleDescReadonly="true" moduleDescTabIndex="-1"
^------^
loanRepayment.jsp:389:121: This attribute is not recognized.
schemeDescName="" schemeDescValue="<%=schemeDesc%>" schemeDescCssClass = "FieldTextRO" schemeTabIndex="<%=""+tabIndex++%>" schemeDescReadonly="true" schemeDescTabIndex="-1"
^------^
loanRepayment.jsp:392:133: This attribute is not recognized.
acctNoDescName="" acctNoDescValue="<%=custAcct.getNameLong()%>" acctNoDescCssClass = "FieldTextRO" acctNoTabIndex="<%=""+tabIndex++%>" acctNoDescReadonly="true" acctNoDescTabIndex="-1" noInputRequired="true"/>
^------^
at weblogic.servlet.jsp.JavelinxJSPStub.reportCompilationErrorIfNeccessary(JavelinxJSPStub.java:247)
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage0(JavelinxJSPStub.java:183)
at weblogic.servlet.jsp.JavelinxJSPStub.access$000(JavelinxJSPStub.java:50)
at weblogic.servlet.jsp.JavelinxJSPStub$1.run(JavelinxJSPStub.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:108)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:267)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:218)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:414)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:304)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:489)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:376)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at dm.web.utils.SecurityCheck.doFilter(SecurityCheck.java:126)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3654)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3620)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2423)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2280)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2258)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1626)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1586)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:617)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:397)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)

I found soln for this problem. In weblogic there is a setting for old jsp code. backward jsp compatibility have to select from weblogic console.
Here is menu path- Home >base_domain –> Under “Web Applications” Tab –> JSP Compiler Backwards Compatible it may solve ur problem.

Related

Freemarker directory path is not readable in UAT

I'm using freemarker template to create a pdf file. This code works in my local but when I deploy to UAT, it gives the below error:
| ERROR | PrintServlet | /templates does not exist.
java.io.FileNotFoundException: /templates does not exist.
at freemarker.cache.FileTemplateLoader$1.run(FileTemplateLoader.java:128)
at java.security.AccessController.doPrivileged(Native Method)
at freemarker.cache.FileTemplateLoader.<init>(FileTemplateLoader.java:125)
at freemarker.cache.FileTemplateLoader.<init>(FileTemplateLoader.java:101)
at freemarker.template.Configuration.setDirectoryForTemplateLoading(Configuration.java:1171)
at com.abg.wizardgui.servlet.PrintServlet.processRequest(PrintServlet.java:256)
at com.abg.wizardgui.servlet.PrintServlet.doPost(PrintServlet.java:420)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at com.abg.wizardgui.filter.JsessionIdRemoverFilter.doFilter(JsessionIdRemoverFilter.java:88)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3706)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)
Code:
cfg.setDirectoryForTemplateLoading(new File("/templates/"));
Template template = cfg.getTemplate("template.ftl");
The template.ftl file is located inside src/templates/ folder. I tried multiple ways of defining the directory. I also tried using the setClassForTemplateLoading method instead but it keeps giving an error.
The src directory doesn't exist on the server after deployment (at least normally), since it's source code. Instead, you could put your templates under src/main/resources/templates (assuming Maven or usual Gradle project structure), so that it will be part of the deployed jar. Then use cfg.setClassForTemplateLoading(SomeClassFromTheSameJar.class, "/templates").

Java determining reason of ClassNotFound

I have a Java EAR application deployed in a Oracle Weblogic Application Server.
The Application is processing among others some HTTP requests
In one of them it is processing some XML files (form the file system)
What makes this interesting is that the very same EAR file is deployed on another server machine, that was set up based on the same installation manual like the first one and there I get the following Class Not Found Exception:
org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
at org.example.application.BL.data.ResourceParser.parse(ResourceParser.java:178)
at org.example.application.BL.data.DataModel.validate(DataModel.java:323)
at org.example.application.BL.action.Update.execute(Update.java:165)
at org.example.application.webapp.ActionControl.doGet(ActionControl.java:78)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3682)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1026)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:987)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:83)
at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:608)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:540)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:493)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:470)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:62)
at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
... 32 more
on the suspect lines:
final XMLReader parser = XMLReaderFactory.createXMLReader();
I checked that on both servers (Same Java, Weblogic, ...) there is the same classpath available to the applications, the same commandline arguments and and as well checked that they have opened the same files (lsof) and they match for all the jar files etc (except for log files).
Currently I'm a bit irritated where the one loads the SAX form that is not accessible for the other.
Running on: Java 8, WebLogic 12c;
Edit: I've found a well this in the logs - but couldn't identify the cause:
Apr 15, 2019 12:30:04 PM weblogic.wsee.runtime.JMSStoreRoutableIDMapper addServerSetListener
INFO: add ServerSetListener for partition: DOMAIN
Warning: org.apache.xerces.parsers.SAXParser: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
Warning: org.apache.xerces.parsers.SAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
Warning: org.apache.xerces.parsers.SAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Apr 15, 2019 12:30:38 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-tx/wsat/2006/06}ATAssertion" was evaluated as "UNKNOWN".
Apr 15, 2019 12:30:38 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".

Apache Camel stax2 NoSuchMethodError

I'm getting very weird behavior from the Apache Camel application. I'm deploying the EAR on WebLogic 12.2.1.3 server on our test environment, and everything works fine. The EAR contains all the dependencies used by the application.
However, when I deploy the same EAR to production (it deploys fine), it gives the following runtime exception during message handling:
Exception occurred during execution on the exchange: Exchange[ID-napoli-34361-1518770862962-0-99], StackTrace: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[ID-napoli-34361-1518770862962-0-99]
at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1790)
at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:350)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:141)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.syncInvoke(CxfConsumer.java:220)
at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.invoke(CxfConsumer.java:147)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:191)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3697)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.lang.NoSuchMethodError: org.codehaus.stax2.ri.EmptyIterator.getInstance()Lorg/codehaus/stax2/ri/EmptyIterator;
at com.ctc.wstx.sw.OutputElementBase.getPrefixes(OutputElementBase.java:358)
at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:811)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:758)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:722)
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:214)
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:174)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:418)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:133)
... 51 more
, Out: null: ]
The camel route success all the way to the cxf component, which tries to call external web service, failing for some reason and causing the exception.
It's the same package with same dependencies on both environments, and in the production environment weblogic I can not see any external libraries installed, which could conflict with the EAR package. So, how do I trace what is causing the problem?
This seems to be a compatibility issue between Stax and Woodstox.
See this issue and try to fix your dependencies:
https://github.com/FasterXML/woodstox/issues/10
The problem was weblogic providing the following library
oracle_common/modules/org.codehaus.woodstox.stax2-api.jar
The different version of same library was also packaged within the EAR. The problem was solved by setting prefer-application-packages in the deployment descriptor.
It is still unknown, why the application worked in our environment without the prefer-application-packages attribute. Shouldn't it have loaded the weblogic-one in our environment too? What causes the seemingly random behavior in this case?

Eclipselink error 3002

I am doing a simple migration from Toplink 10g to native Eclipselink v2.6.4 by following the instructions here (particularly task 3 and 4). Everything compiles ok but when I try to run my app I get the error below.
I tried using the old mapping file (which is still compatible) as well as a new one generated from Eclipselink workbench by importing my old Toplink workbench project.
Note that I'm only doing a migration from Toplink to native Eclispelink. There is no JPA involved.
Any ideas on what`s wrong? It seems like it's trying to improperly using String instead of my actual class, but not sure.
Also, my app has never had a persistence.xml file. Do I need one now?
2017-02-20 14:55:52 ERROR - Presentation - Local Exception Stack:
Exception [EclipseLink-3002] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [ca.ncams.wisor.refdata.AccessTandem], of class [class java.lang.String], from mapping [org.eclipse.persistence.oxm.mappings.XMLDirectMapping[javaClass-->class/text()]] with descriptor [XMLDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor --> [DatabaseTable(class-mapping-descriptor)])], could not be converted to [class java.lang.Class].
Internal Exception: java.lang.ClassNotFoundException: ca.ncams.wisor.refdata.AccessTandem
at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConvertedToClass(ConversionException.java:98)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToClass(ConversionManager.java:451)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObject(ConversionManager.java:146)
at org.eclipse.persistence.internal.oxm.XMLConversionManager.convertObject(XMLConversionManager.java:197)
at org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.convertObject(DatasourcePlatform.java:179)
at org.eclipse.persistence.oxm.mappings.XMLDirectMapping.getAttributeValue(XMLDirectMapping.java:301)
at org.eclipse.persistence.oxm.mappings.XMLDirectMapping.valueFromRow(XMLDirectMapping.java:364)
at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1539)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:462)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildAttributesIntoObject(XMLObjectBuilder.java:378)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildObject(XMLObjectBuilder.java:291)
at org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping.buildCompositeObject(XMLCompositeCollectionMapping.java:380)
at org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping.buildObjectFromNestedRow(XMLCompositeCollectionMapping.java:587)
at org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping.valueFromRow(XMLCompositeCollectionMapping.java:511)
at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1539)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:462)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildAttributesIntoObject(XMLObjectBuilder.java:378)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildObject(XMLObjectBuilder.java:291)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.xmlToObject(DOMUnmarshaller.java:469)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:267)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:246)
at org.eclipse.persistence.internal.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:530)
at org.eclipse.persistence.sessions.factories.XMLProjectReader.readObjectPersistenceRuntimeFormat(XMLProjectReader.java:293)
at org.eclipse.persistence.sessions.factories.XMLProjectReader.read(XMLProjectReader.java:186)
at org.eclipse.persistence.sessions.factories.XMLProjectReader.read(XMLProjectReader.java:242)
at org.eclipse.persistence.sessions.factories.XMLProjectReader.read(XMLProjectReader.java:100)
at ca.ncams.wisor.persistence.toplink.PersistenceManager.initializeTopLink(PersistenceManager.java:491)
at ca.ncams.wisor.persistence.toplink.PersistenceManager.<init>(PersistenceManager.java:83)
at ca.ncams.wisor.persistence.toplink.PersistenceManager.getInstance(PersistenceManager.java:96)
at ca.ncams.wisor.persistence.toplink.AutoRollbackFilter.doFilter(AutoRollbackFilter.java:57)
at ca.ncams.wisor.filter.FilterChainImpl.doFilter(FilterChainImpl.java:124)
at ca.ncams.wisor.presentation.filters.CatchAllFilter.doFilter(CatchAllFilter.java:60)
at ca.ncams.wisor.filter.FilterChainImpl.doFilter(FilterChainImpl.java:124)
at ca.ncams.wisor.presentation.filters.NoCacheFilter.doFilter(NoCacheFilter.java:47)
at ca.ncams.wisor.filter.FilterChainImpl.doFilter(FilterChainImpl.java:124)
at ca.ncams.wisor.filter.FilterJspBase.service(FilterJspBase.java:111)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:489)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:376)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3679)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.__run(WebAppServletContext.java:3649)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: java.lang.ClassNotFoundException: ca.ncams.wisor.refdata.AccessTandem
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToClass(ConversionManager.java:448)
... 61 more
Here's what I ended up doing:
Add Eclipselink 2.6.4 dependency to pom (compile instead of provided)
Add to weblogic.xml:
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.eclipse.persistence</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
Now Eclipselink finds my classes and boots up.
Note that my code was only passing in the mapping file and not a classloader to XMLProjectReader.read(); so I guess was using the default classloader.
If anyone knows of how to pass in a classloader I'd still be curious to know (where do I get it from?).

java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX in Eclipse project [duplicate]

I am receiving this error on running my project and the result is 404 ultimately. The project is made on Spring framework.
I read a lot of posts and found that there is either a mix up of jars or extra jars. Following which I tried to organize my jars. The following list is what I have in my build path:
antlr-2.7.6.jar
asm.jar
asm-attrs.jar
cglib-2.2.jar
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-digester-1.8.jar
commons-email-1.0.jar
commons-fileupload-1.1.1.jar
commons-io-1.2.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
displaytag-1.0-b3.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
hibernate3.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
hibernate-validator-4.0.2.GA.jar
hsqldb.jar
itext-2.1.3.jar
javassist-3.12.0.GA.jar
jdom.jar
jstl-1.2.jar
jta-1.1.jar
log4j-1.2.14.jar
msbase.jar
mssqlserver4v65.jar
msutil.jar
mysql.jar
mysql-connector-java-5.1.15-bin.jar
ojdbc14.jar
persistence-api-1.0.jar
poi-3.0-alpha2.jar
servlet-2.3.jar
slf4j-api-1.6.6.jar
slf4j-log4j12-1.5.6.jar
slf4j-simple-1.6.6.jar
spring-asm-3.0.3.RELEASE.jar
spring-beans-3.0.3.RELEASE.jar
spring-context-3.0.3.RELEASE.jar
spring-core-3.0.3.RELEASE.jar
spring-expression-3.0.3.RELEASE.jar
spring-hibernate3-2.0.8.jar
spring-web-3.0.3.RELEASE.jar
spring-webmvc-3.0.3.RELEASE.jar
sqljdbc4.jar
standard.jar
tree.jar
validation-api-1.0.0.GA.jar
wloracle.jar
wlsqlserver.jar
Here goes the stacktrace
SEVERE: Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader#ca2dce
org.springframework.web.servlet.DispatcherServlet
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
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:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1433)
at org.apache.jasper.compiler.Parser.parse(Parser.java:133)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:153)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
I have deleted many jars, which I thought, are repetitive.
My question is whether all these jars are exactly enough or are there duplicates?
Please help, this 404 is killing me...
You have a lot of duplicated jars there:
antlr
jta
mysql-connector
javassist
mssqlserver
I would make sure you only have one of each before continuing, work out which version you need and include that one.
If you are not sure how to do this, let us know how you are importing your dependencies.
It would also be helpful to see the stacktrace you are seeing and a simplified Spring context that causes the error.
If you look at this question: JasperException: absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved
You need to make sure you have the right version of JSTL, maybe once you remove the duplicate JSTL it may fix that error.
My guess would be deleting spring.jar and spring-1.2.6.jar ; they conflict with spring*3.0.3.RELEASE.jars
And my two cents would be using maven when working with spring framework.

Categories