Disable log messages about warnings for org.glassfish.jersey.internal.inject.Providers in Kafka-Connect - apache-kafka

My goal is to make log format in kafka-connect as json, but the following log messages are always not json and cannot be disabled:
Feb 10, 2020 4:36:03 PM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime
WARNING: A provider org.apache.kafka.connect.runtime.rest.resources.RootResource registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.apache.kafka.connect.runtime.rest.resources.RootResource will be ignored.
Feb 10, 2020 4:36:03 PM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime
WARNING: A provider org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource will be ignored.
Feb 10, 2020 4:36:03 PM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime
WARNING: A provider org.apache.kafka.connect.runtime.rest.resources.ConnectorPluginsResource registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.apache.kafka.connect.runtime.rest.resources.ConnectorPluginsResource will be ignored.
Feb 10, 2020 4:36:05 PM org.glassfish.jersey.internal.Errors logErrors
WARNING: The following warnings have been detected: WARNING: The (sub)resource method createConnector in org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource contains empty path annotation.
WARNING: The (sub)resource method listConnectors in org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource contains empty path annotation.
WARNING: The (sub)resource method listConnectorPlugins in org.apache.kafka.connect.runtime.rest.resources.ConnectorPluginsResource contains empty path annotation.
WARNING: The (sub)resource method serverInfo in org.apache.kafka.connect.runtime.rest.resources.RootResource contains empty path annotation.
I know those are warings, so my goal is to either avoid those to show up, or make it in json. Neither work though.
I tried the following setup:
<logger name="org.glassfish.jersey.internal.inject.Providers" additivity="true" level="ERROR" />
Those log messages still appear. Any suggestion?
I can use either logback or log4j. I currently use logback but using log4j is not a problem.
UPDATE
I switch to log4j
log4j.rootCategory=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=net.logstash.log4j.JSONEventLayoutV1
log4j.logger.org.reflections=ERROR
log4j.logger.org.apache.kafka=INFO
log4j.logger.org.apache.kafka.connect.runtime.rest=ERROR
log4j.logger.org.apache.kafka.clients.consumer.ConsumerConfig=ERROR
log4j.logger.org.apache.kafka.clients.producer.ProducerConfig=ERROR
log4j.logger.org.apache.kafka.clients.admin.AdminClientConfig=ERROR
Logs are in json format except for the WARNINGS are still there even if I set
log4j.logger.org.glassfish.jersey.internal.inject.Provider=ERROR

WARNINGS are still there even if I set log4j.logger.org.glassfish.jersey.internal.inject.Provider=ERROR
The class is Providers, with an s
Personally, I'd suggest
log4j.logger.org.glassfish.jersey.internal=OFF

That log message is being logged using the JDK built-in logger (java.util.logging), not SLF4J or log4J:
https://github.com/jersey/jersey/blob/faa809da43538ce31076b50f969b4bd64caa5ac9/core-common/src/main/java/org/glassfish/jersey/internal/inject/Providers.java#L514
You need to edit the default JVM logging.properties file or create a custom one and reference it with JVM option -Djava.util.logging.config.file in order to set the log level of org.glassfish.jersey.internal to SEVERE.
Logging in Java is complicated and messy. You end up having to know all of the different logging products and often they are mixed together in the same project.
Example logging.properties file:
handlers= java.util.logging.ConsoleHandler
.level= INFO
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
org.glassfish.jersey.internal.level = SEVERE

Related

Enable REST service for CAS Apereo version cas-overlay-template-6.0

I want to enable REST service for CAS Apereo version cas-overlay-template-6.0 (on Ubuntu 16.04)
I have done following this step:
Step 1: Add compile for REST API to build.gradle file
root#ubuntu16:~/cas-overlay-template-6.0# nano build.gradle
And add two line below under dependencies clock
compile "org.apereo.cas:cas-server-support-rest:6.0.0"
compile "org.apereo.cas:cas-server-support-rest-services:6.0.0"
Step 2: clean build
root#ubuntu16:~/cas-overlay-template-6.0# ./build.sh clean
Step 3: Build source code again
root#ubuntu16:~/cas-overlay-template-6.0# ./build.sh run
But in step 3, I got error like this.
CAS is configured to accept a static list of credentials for authentication. While this is generally useful for demo purposes, it is STRONGLY recommended that you DISABLE this authentication method (by setting 'cas.authn.accept.users' to a blank value) and switch to a mode that is more suitable for production.>
2019-12-30 01:17:55,465 WARN [org.apereo.cas.config.support.authentication.AcceptUsersAuthenticationEventExecutionPlanConfiguration] - <>
2019-12-30 01:17:55,806 INFO [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Found and added static attributes [[email]] to the list of candidate attribute repositories>
2019-12-30 01:17:59,004 WARN [org.apereo.cas.web.CasWebApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'registeredServiceResourceRestController' defined in class path resource [org/apereo/cas/support/rest/config/RestServicesConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apereo.cas.support.rest.RegisteredServiceResource]: Factory method 'registeredServiceResourceRestController' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: No attribute name is defined to enforce authorization when adding services via CAS REST APIs. This is likely due to misconfiguration in CAS settings where the attribute name definition is absent>
Where have I gone wrong?
Remove this:
compile "org.apereo.cas:cas-server-support-rest-services:6.0.0"
This module does this:
Invoke CAS to register applications into its own service registry. The REST call must be authenticated using basic authentication where credentials are authenticated and accepted by the existing CAS authentication strategy, and furthermore the authenticated principal must be authorized with a pre-configured role/attribute name and value that is designated in the CAS configuration via the CAS properties. The body of the request must be the service definition that shall be registered in JSON format and of course, CAS must be configured to accept the particular service type defined in the body. The accepted media type for this request is application/json.
So you can remove it, if you don't need the functionality.
If you do need it, you will need to define attribute names/values that can enforce authorization as the error message is telling you.
No attribute name is defined to enforce authorization when adding services via CAS REST APIs. This is likely due to misconfiguration in CAS settings where the attribute name definition is absent.
So, define:
# cas.rest.attributeName=
# cas.rest.attributeValue=
PS Don't add things you do not need.

Alfresco 5.2.4 in weblogic server

I am getting the following error when trying to install Alfresco 5.2.4 in weblogic 12. I am using all the supported technology stack as per the alfresco documentation. Any help would be greatly appreciated.
<Nov 28, 2018 10:13:21,313 PM CST> <Error> <javax.faces> <BEA-000000> <Unable
to call #PreDestroy annotated methods because no InjectionProvider can be
found. Does this container implement the Mojarra Injection SPI?>
<Nov 28, 2018 10:13:21,313 PM CST> <Error>
<javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Critical
error during deployment:
com.sun.faces.config.ConfigurationException: Factory
'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
I have faced similar issue recently. The following Work Around should fix this error:
Uncomment following lines in /META-INF/weblogic-application.xml
<package-name>javax.faces.*</package-name>
<package-name>javax.faces.application.*</package-name>
<package-name>javax.faces.component.*</package-name>
<package-name>javax.faces.context.*</package-name>
<package-name>javax.faces.convert.*</package-name>
<package-name>javax.faces.el.*</package-name>
<package-name>javax.faces.event.*</package-name>
<package-name>javax.faces.lifecycle.*</package-name>
<package-name>javax.faces.model.*</package-name>
<package-name>javax.faces.render.*</package-name>
<package-name>javax.faces.validator.*</package-name>
<package-name>javax.faces.webapp.*</package-name>

Why is database medrec not found by the Avitek sample application?

Circumstances: performed a by-the-book developer install using wls1212_dev.zip and wls1212_dev_supplemental.zip. Followed the README.txt and the README_SUPP.txt strictly. Created a sample domain by hand, no issues seen. Executed the run_samples.sh configuration script, no issues seen.
When starting the medrec domain (Avitek sample app) using startWebLogic.sh, the medrec database is not found (specific error below). The Avitek app comes up and display-only pages are navigable, but database touches all fail. The WLS console in the medrec domain works fine. The JDBC data source "MedRecGlobalDataSourceXA" exists in the domain and the fields look ... well, reasonable, to my untrained eye.
For now I am taking the error message at face value and assuming database creation failed within the setup script (run_samples.sh) But I examined all the logs in wlserver/samples after executing the run_samples.sh script, and there was nothing that seemed relevant.
Platform: VirtualBox VM with CentOS 6.5 and JDK1.7.0_45
Other notes: I am aware of the security fix in 1.7.0_51 and higher JDKs that breaks existing Derby database applications. I purposely chose to avoid this issue by installing the 0_45 JDK until I resolve this "database not found" issue.
Grateful for any help.
Error:
<May 25, 2014 8:40:46 AM PDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<May 25, 2014 8:40:46 AM PDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<May 25, 2014 8:40:47 AM PDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "MedRecGlobalDataSourceXA" due to error weblogic.application.ModuleException: org.apache.derby.client.am.DisconnectException: The connection was refused because the database medrec was not found.
weblogic.application.ModuleException: org.apache.derby.client.am.DisconnectException: The connection was refused because the database medrec was not found.
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:338)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:172)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:167)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
Truncated. see log file for complete stacktrace
Caused By: org.apache.derby.client.am.DisconnectException: The connection was refused because the database medrec was not found.
at org.apache.derby.client.net.NetConnectionReply.parseRDBNFNRM(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source)
at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
Truncated. see log file for complete stacktrace
In linux unset variable LANG before starting Derby database server.

Hadoop's WordCount runs form command line but not from Eclipse

In the last few days, I have tested multiple version of Hadoop (1.0.1, 1.0.2, 1.1.4). In each case, I can easily run the WordCount program using the following command line:
hadoop jar hadoop-examples-1.1.1.jar wordcount /input output
Since the above command executes successfuly, then I assume that my Hadoop configuration is correct. But I get the following error message for each single version when I try to run the program using exact same input from Eclipse. Can anyone give me the reason why it wouldn't run from Eclipse?
Dec 12, 2012 2:19:41 PM org.apache.hadoop.util.NativeCodeLoader <clinit>
WARNING: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Dec 12, 2012 2:19:41 PM org.apache.hadoop.mapred.JobClient copyAndConfigureFiles
WARNING: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
****file:/tmp/wordcount/in
Dec 12, 2012 2:19:42 PM org.apache.hadoop.mapred.JobClient$2 run
INFO: Cleaning up the staging area file:/tmp/hadoop-root/mapred/staging/root-41981592/.staging/job_local_0001
Dec 12, 2012 2:19:42 PM org.apache.hadoop.security.UserGroupInformation doAs
SEVERE: PriviledgedActionException as:root cause:org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979)
at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1093)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
at com.igalia.wordcount.WordCount.run(WordCount.java:94)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at com.igalia.wordcount.App.main(App.java:28)
Add the following two lines in your job through your Configuration abject :
Configuration.addResource(new Path("path-to-your-core-site.xml file"));
Configuration.addResource(new Path("path-to-your-hdfs-site.xml file"));
For hadoop-2.2.0 on windows 7, I added the below lines and it solved the issue (NOTE: My Hadoop Home is: C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0)
Configuration conf = new Configuration();
conf.addResource(new Path("C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0\etc\hadoop\core-site.xml"));
conf.addResource(new Path("C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0\etc\hadoop\hdfs-site.xml"));

Akka warning about "Too many HashedWheelTimer instances"

I'm getting the following warning when my Akka 1.2-based application tries to work with more than 500 or so grid nodes:
Jan 05, 2012 1:36:43 PM org.jboss.netty.util.internal.SharedResourceMisuseDetector
WARNING: You are creating too many HashedWheelTimer instances.
HashedWheelTimer is a shared resource that must be reused across the application, so that only a few instances are created.
I'm going to dig more deeply into the Akka code to find out where the HashedWheelTimer is being used and what I should do to avoid too many of those being created. While I'm doing that, I thought I'd post the warning here in case one of the experts may be able to give me a pointer or two that may narrow and speed up my search, please?
Using Akka 1.3-RC6, I'm getting the following exception:
Jan 12, 2012 1:24:38 PM org.jboss.netty.util.HashedWheelTimer
WARNING: An exception was thrown by TimerTask.
org.jboss.netty.channel.ChannelException: Failed to open a socket.
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:49)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.<init>(NioClientSocketChannel.java:83)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:139)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:86)
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:218)
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)
at akka.remote.netty.ActiveRemoteClient.connect(NettyRemoteSupport.scala:470)
at akka.remote.netty.ActiveRemoteClientHandler$$anonfun$channelClosed$1$$anon$4.run(NettyRemoteSupport.scala:599)
at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:519)
at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440)
at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.SocketException: Too many open files
at sun.nio.ch.Net.socket0(Native Method)
at sun.nio.ch.Net.socket(Net.java:323)
at sun.nio.ch.Net.socket(Net.java:316)
at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:101)
at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60)
at java.nio.channels.SocketChannel.open(SocketChannel.java:142)
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:47)
... 11 more
Has been fixed in Akka 2.0-M1, I've now backported the fix to 1.3 and it will be in the next RC.