Jersey Library errors (NoSuchMethod then IncompatibleClassChangeError) - maven

We just upgraded from Weblogic 10 to Weblogic 12 and started to get this error
<Error> <com.sun.jersey.spi.container.ContainerResponse> <hostname> <nodename> <[ACTIVE] ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)'> <ws_user> <> <> <140123234234> <BEA-000000> <The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchMethodError: com.sun.jersey.client.apache.ApacheHttpClientHandler.getRequestEntityWriter(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriter
After little bit digging, I realized that Jersey library (com.sun.jersey.contribs) needs to be upgraded to 1.18.1 version from 1.2. I did that change and then started to get following error
weblogic.application.ModuleException: java.lang.IncompatibleClassChangeError: com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider and com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl disagree on InnerClasses attribute
a little digging in it i learned that my JSR311-api (javax.ws.rs) has to be 1.1.1 and it is already that. Now i am lost what else shall i change to have these errors fixed

I had a similar issue when updating the Jersey library. In the end it turned out that the old jar was still in the /lib folder. Make sure that you have completely removed the previous version.
Hope that helps.

Related

Space Issue being caused due to Weblogic Server warning messages

We have CRM running on seven clustered servers which comprises of our Front End. We have another cluster the Process Manager Cluster comprising of two other machines. These two machines are running weblogic 8.1 windows installation and random nodes on these servers are causing zero space issue due to the logs getting full as a result of a warning message.
There is no change done to the code since ages. What can be the issue here?
####<12-Mar-2007 15:29:35 o'clock GMT> <Alert> <Log Management> <Server1> <scm1-04> <ExecuteThread: '4' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-170018> <The log file has been rotated to scm1-04.log17956. Log messages will continue to be logged in D:\logs\scm1-04.log.>
####<12-Mar-2007 15:29:35 o'clock GMT> <Warning> <EJB> <Server1> <scm1-04> <ExecuteThread: '4' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception was:
java.lang.NoClassDefFoundError.
java.lang.NoClassDefFoundError
at com.clarify.procmgr.ejb.ProcessManagerMDB.onMessage(ProcessManagerMDB.java:58)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>

The Message-Driven EJB unable to connect JMS Destination stating Error creating the db_connection

we have Oracle OSB 11g which is connecting to Oracle 12C DB in remote location or a different LAN.
THE WebLogic EJBs connecting to Oracle AQs via JMS/JDBC and currently we are having issues with them.
the WLS logs says:
####<Sep 21, 2018 9:15:51.083 AM GMT+00:00> <Warning> <EJB> <10.170.128.102>
<osb02_m1> <[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default
(self-tuning)'> <<anonymous>> <>
<e10b4740d6c6fa2e:-5f6b2f84:165f9d83f34:-8000-0000000000000f87>
<1537521351083> <BEA-010096> <The Message-Driven EJB:
RequestEJB3103778799539238415X86e7f92.165e6e1ae31.X725d is unable to connect
to the JMS destination or bind to JCA resource adapter: queue/ProvRequestAQ.
Connection failed after 2,609 attempts. The MDB will attempt to
reconnect/rebind every 10 seconds. This log message will repeat every 600
seconds until the condition clears.>
####<Sep 21, 2018 9:15:51.083 AM GMT+00:00> <Warning> <EJB> <10.170.128.102>
<osb02_m1> <[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default
(self-tuning)'> <<anonymous>> <>
<e10b4740d6c6fa2e:-5f6b2f84:165f9d83f34:-8000-0000000000000f87>
<1537521351083> <BEA-010061> <The Message-Driven EJB:
RequestEJB3103778799539238415X86e7f92.165e6e1ae31.X725d is unable to connect
to the JMS destination: queue/ProvRequestAQ. The Error was:
oracle.jms.AQjmsException: Error creating the db_connection
Nested exception: java.lang.UnsupportedOperationException: Remote JDBC
disabled
Nested exception: java.lang.UnsupportedOperationException: Remote JDBC
disabled>
I searched in internet and found the solution that I have to add the below parameter and add to setDomainEnv.sh and restart the WebLogic admins and managed servers, but still this issue is not resolved. I also checked that the DB User used to connect the DB has enqueue/dequeue privileges over the Oracle queues.
Parameter was
WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"
I think the parameter must be added to the startup parameters of your managed servers from your domain console. After adding the parameter restart your managed servers.
The requested parameter might give some trouble on weblogic 12.1.3. As a matter of fact the parameter is deprecated since weblogic 10.3.6.
If you are still in trouble try the following workaround:
https://docs.oracle.com/cd/E24329_01/web.1211/e24376/rmidriver.htm#JDBCP350
Might be helpful.

log4j2 shutdownHook="disable" not working

I have the shutdownhook error in my Spring boot application in which i use log4j2.
I saw that it was a bug in log4j2 and shutdownHook="disable" was suppossed to resolve it. But inspite of using the same i still get the same error.
I am using spring boot version 1.3.7.RELEASE and the dependecy for log4j2 is
spring-boot-starter-log4j2 .
Error which i get whetry to close the session using Ctrl-C
2016-08-23 13:38:56,098 Thread-7 ERROR No log4j2 configuration file found. Using
default configuration: logging only errors to the console.
2016-08-23 13:38:56,105 Thread-7 FATAL Unable to register shutdown hook because
JVM is shutting down. java.lang.IllegalStateException: Cannot add new shutdown h
ook as this is not started. Current state: STOPPED
at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry.ad
dShutdownCallback(DefaultShutdownCallbackRegistry.java:113)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.addShutdownCal
lback(Log4jContextFactory.java:271)
at org.apache.logging.log4j.core.LoggerContext.setUpShutdownHook(LoggerC
ontext.java:256)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
216)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:146)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:41)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:185)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(Abstrac
tLoggerAdapter.java:103)
at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFac
tory.java:43)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(Abstract
LoggerAdapter.java:42)
at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFact
ory.java:29)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at com.worldline.frm.dataloader.policy.CustomQueueRoutePolicy.onStop(Cus
tomQueueRoutePolicy.java:90)
at org.apache.camel.impl.RouteService.doStop(RouteService.java:249)

Upgrading from Spring 3.2.1 to 3.2.13 gives 404 on static resources

We'd like to upgrade our Spring dependency, but are having issues with resources not being found by the server. No code-changes have been made, this works fine in 3.2.1.
We register the handler like this
#Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
registry.addResourceHandler("/kjernejournal.html").addResourceLocations("/kjernejournal.html").setCachePeriod(0);
}
Log has
o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/kjernejournal.html] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
But this fails later on, with the following error.
12:07:04.520 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Mapping [/kjernejournal.html] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler#75288586] and 1 interceptor
12:07:04.520 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG o.s.web.servlet.DispatcherServlet - Last-Modified value for [/hpp-webapp/kjernejournal.html] is: -1
12:07:04.520 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Trying relative path [/kjernejournal.html] against base location: ServletContext resource [/kjernejournal.html]
12:07:04.520 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - No matching resource found - returning 404
The file does exist in the root of the WAR-file.
Any idea on where to begin?
Figured out the problem.
When we register like
registry.addResourceHandler("/kjernejournal.html").addResourceLocations("/").setCachePeriod(0);
Instead of
registry.addResourceHandler("/kjernejournal.html").addResourceLocations("/kjernejournal.html").setCachePeriod(0);
It works fine. So the problem seems to be that resourceLocations pointed to a file instead of a directory. From ResourceHandlerRegistration JavaDoc:
Add one or more resource locations from which to serve static content. Each location must point to a valid directory.
Weird that it worked before, though...

Enable DRCP in Weblogic 12c fails

I'm trying to create a data source enabled with DRCP in Weblogic 12c installed in Linux. After providing all required values & 'Test Configuration' there is an error (cited below ). I have tried the same on Windows and it worked for same port number (also included SERVER=POOLED in 'tnsnames.ora' for client purpose in Windows).
Configurations:
Linux machine : Weblogic 12c (12.1.2)
URL : jdbc:oracle:thin:#//10.125.158.115:1521/PERF01:POOLED
oracle.jdbc.DRCPConnectionClass = myDRCPClass
Error:
<AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <> <1432019762569>
<BEA-240003> <Administration Console encountered the following error: java.sql.SQLRecoverableException:
IO Error: Invalid number format for port number
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:465)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:232)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:469)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:156)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:101)
at weblogic.jdbc.common.internal.DataSourceUtil.testConnection0(DataSourceUtil.java:356)
at weblogic.jdbc.common.internal.DataSourceUtil.access$000(DataSourceUtil.java:22)
at weblogic.jdbc.common.internal.DataSourceUtil$1.run(DataSourceUtil.java:254)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.jdbc.common.internal.DataSourceUtil.testConnection(DataSourceUtil.java:251)
.
.
at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
Caused by: oracle.net.ns.NetException: Invalid number format for port number
at oracle.net.resolver.AddrResolution.resolveSimple(AddrResolution.java:512)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:409)
Change of Weblogic version (from Weblogic 12.1.2 to 12.1.3) solved this problem. Both Weblogic 12.1.1 & Weblogic 12.1.3 supports DRCP.

Resources