Tomcat error - java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found - heroku

My Grails 5.2 application fails to start on Heroku with this error:
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering. Duplicate fragments found in [[jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-embed-jasper-9.0.68.jar, jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/webapp-runner-9.0.70.0.jar, jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-jasper-9.0.70.jar]].
Here is the error with better formatting:
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found.
Duplicate fragments found in [
[jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-embed-jasper-9.0.68.jar,
jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/webapp-runner-9.0.70.0.jar,
jar:file:/app/build/libs/OLRMain-1.3.0-plain.war!/WEB-INF/lib/tomcat-jasper-9.0.70.jar]]
I understand the duplication error but don't know how to fix. I am deploying to Heroku.
Below is my Heroku procfile.
web: cd build; java $JAVA_OPTS -Dgrails.env=prod -jar ../build/server/webapp-runner-9.0.70.0.jar --expand-war --port $PORT libs/*.war
I've seen similar issues on SO such as "clearing" tomcat, and adding an entry to web.xml but don't know how to do this using Grails and Heroku.

Related

Getting an error while pushing message to IBM -MQ from apache camel spring application

I am getting below error while pushing a message from apache camel component to IBM-MQ.
Error:-
Caused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050: The property name 'JMS_Solace_DeadMsgQueueEligible' is reserved and cannot be set.
Below are my pom jars i am using -
<camel-spring-boot-starter.version>2.21.0</camel-spring-boot-starter.version>
<camel-spring.version>2.21.0</camel-spring.version>
<camel-jms.version>2.21.0</camel-jms.version>
I am running the application using spring boot container.
Try to remove that header, something a like:
from solace
removeHeaders("JMS_Solace*")
to ibmmq

Flink in ECS fails to find shaded ContainerCredentialsProvider

I'm trying to run Flink 1.7.2 on ECS with Fargate. I've set up the state backend for my job to be RocksDB with a path=s3://...
In my Dockerfile my base image is 1.7.2-hadoop27-scala_2.11, and I run the following 2 commands:
RUN echo "fs.s3a.aws.credentials.provider: org.apache.flink.fs.s3hadoop.shaded.com.amazonaws.auth.ContainerCredentialsProvider" >> "$FLINK_CONF_DIR/flink-conf.yaml"
RUN cp /opt/flink/opt/flink-s3-fs-hadoop-1.7.2.jar /opt/flink/lib/flink-s3-fs-hadoop-1.7.2.jar
Just like it says in
https://issues.apache.org/jira/browse/FLINK-8439
However I get the following exception:
Caused by: java.io.IOException: From option fs.s3a.aws.credentials.provider java.lang.ClassNotFoundException: Class org.apache.flink.fs.s3hadoop.shaded.com.amazonaws.auth.ContainerCredentialsProvider not found
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.fs.s3a.S3AUtils.loadAWSProviderClasses(S3AUtils.java:592)
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.fs.s3a.S3AUtils.createAWSCredentialProviderSet(S3AUtils.java:556)
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.fs.s3a.DefaultS3ClientFactory.createS3Client(DefaultS3ClientFactory.java:52)
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.fs.s3a.S3AFileSystem.initialize(S3AFileSystem.java:256)
at org.apache.flink.fs.s3.common.AbstractS3FileSystemFactory.create(AbstractS3FileSystemFactory.java:125)
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:395)
at org.apache.flink.core.fs.FileSystem.get(FileSystem.java:318)
at org.apache.flink.core.fs.Path.getFileSystem(Path.java:298)
at org.apache.flink.runtime.state.filesystem.FsCheckpointStorage.<init>(FsCheckpointStorage.java:58)
at org.apache.flink.runtime.state.filesystem.FsStateBackend.createCheckpointStorage(FsStateBackend.java:444)
at org.apache.flink.contrib.streaming.state.RocksDBStateBackend.createCheckpointStorage(RocksDBStateBackend.java:407)
at org.apache.flink.runtime.checkpoint.CheckpointCoordinator.<init>(CheckpointCoordinator.java:249)
... 17 more
Caused by: java.lang.ClassNotFoundException: Class org.apache.flink.fs.s3hadoop.shaded.com.amazonaws.auth.ContainerCredentialsProvider not found
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2375)
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.conf.Configuration.getClasses(Configuration.java:2446)
at org.apache.flink.fs.shaded.hadoop3.org.apache.hadoop.fs.s3a.S3AUtils.loadAWSProviderClasses(S3AUtils.java:589)
... 28 more
Looking in the flink-s3-fs-hadoop-1.7.2.jar I see that the package of the class ContainerCredentialsProvider is actually org.apache.flink.fs.s3base.shaded.com.amazonaws.auth
I already tried:
Adding the aws-sdk-core jar to the lib, and setting the credentials provider to be just com.amazonaws.auth.ContainerCredentialsProvider (without the shading) but I get the problem mentioned in the issue link above
Setting the credentials provider to be org.apache.flink.fs.s3base.shaded.com.amazonaws.auth.ContainerCredentialsProvider but then the code in S3FileSystemFactory.java prefixes it with org.apache.flink.fs.s3hadoop.shaded.
Any ideas here for finding the class?
The issue was resolved in one of the versions after.
I ran it on Flink 1.9.0 cluster with the following line:
RUN echo "fs.s3a.aws.credentials.provider: com.amazonaws.auth.ContainerCredentialsProvider" >> "$FLINK_CONF_DIR/flink-conf.yaml"
and the class is found and works.
You can see in:
https://github.com/apache/flink/blob/master/flink-filesystems/flink-s3-fs-hadoop/src/main/java/org/apache/flink/fs/s3hadoop/S3FileSystemFactory.java
that the FLINK_SHADING_PREFIX is now correct

Cannot delete a Kafka topic in Windows

I have set the Zookeeper properties of "delete.topic.enable" to true. But I still cannot delete the topic. When I do mvn install or mvn test, I got following problems:
WARN Error processing kafka.log:type=LogManager,name=LogDirectoryOffline,logDirectory=C:\Users\extznq\AppData\Local\Temp\EH4Test7267133751803693562 (com.yammer.metrics.reporting.JmxReporter:397)
javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
ERROR Error while deleting healthchecktopic1516638375589-0 in dir C:\Users\extznq\AppData\Local\Temp\EH4Test9083449671042580730. (kafka.server.LogDirFailureChannel:107)
java.io.IOException: Failed to rename log directory from C:\Users\{My-topic-path} to C:\Users\{My-topic-path}-0.0a40ae7410c2401aba0816891789c334-delete
at kafka.log.LogManager.asyncDelete(LogManager.scala:671)
at kafka.cluster.Partition$$anonfun$delete$1.apply(Partition.scala:178)
at kafka.cluster.Partition$$anonfun$delete$1.apply(Partition.scala:173)
at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:217)
at kafka.utils.CoreUtils$.inWriteLock(CoreUtils.scala:225)
at kafka.cluster.Partition.delete(Partition.scala:173)
at kafka.server.ReplicaManager.stopReplica(ReplicaManager.scala:341)
at kafka.server.ReplicaManager$$anonfun$stopReplicas$2.apply(ReplicaManager.scala:373)
at kafka.server.ReplicaManager$$anonfun$stopReplicas$2.apply(ReplicaManager.scala:371)
at scala.collection.Iterator$class.foreach(Iterator.scala:891)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at kafka.server.ReplicaManager.stopReplicas(ReplicaManager.scala:371)
at kafka.server.KafkaApis.handleStopReplicaRequest(KafkaApis.scala:190)
at kafka.server.KafkaApis.handle(KafkaApis.scala:104)
at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:65)
at java.lang.Thread.run(Thread.java:745)
ERROR [Broker id=0] Ignoring stop replica (delete=true) for partition healthchecktopic1516728986980-0 due to storage exception (state.change.logger:107)
org.apache.kafka.common.errors.KafkaStorageException: Error while deleting healthchecktopic1516728986980-0 in dir C:\Users\AppData\Local\Temp\EH4Test7267133751803693562.
Caused by: java.io.IOException: Failed to rename log directory from C:\Users\AppData\Local\Temp\EH4Test7267133751803693562\healthchecktopic1516728986980-0 to C:\Users\AppData\Local\Temp\EH4Test7267133751803693562\healthchecktopic1516728986980-0.65fc6c32c44940e58c1a45bd2972523a-delete
at kafka.log.LogManager.asyncDelete(LogManager.scala:671)
I think the Warning is all right. But I do not know why I would get errors, although I run the Eclipse as administrator. Especially, the KafkaStorageException, I still have 50GB in my computer.
Environment:
Windows 10
Zookeeper 3.5.3-beta
Kafka 1.0.0
looks like you have an invalid character in the properties: Invalid character ':' in value part of property; also in the line below it seems that the placeholder you are using it is not replaced properly: C:\Users\{My-topic-path}
Furthermore there is an open issues related to file operation such as moving/delete in windows environment, I got the same problem upgrading from 0.10.2.1 to 1.1.0
This is the link to the issue: KAFKA-1194

OSGI bundle status grace period

I am trying to install two bundles on Karaf. For one of the bundle i am getting error and when I see the bundle:diag i got below message. It is the same thing compaining in logs also. Similar kind of bundle already deploy and it has the same dependencies. first one is working but the for second bundle i am getting below error. any thoughts?
opendaylight-user#root>bundle:diag
videoweb (421)
Status: GracePeriod
Blueprint
2/10/16 6:07 PM
Missing dependencies:
(objectClass=org.osgi.service.http.HttpService)
2016-02-10 23:54:07.113 GMT+00:00 [Blueprint Extender: 3] ERROR o.a.a.b.c.BlueprintContainerImpl - Unable to start blueprint container for bundle com.xyz.videosdn.tesweb due to unresolved dependencies [(objectClass=org.osgi.service.http.HttpService)]
java.util.concurrent.TimeoutException: null
at org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336) [org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48) [org.apache.aries.blueprint.core:1.4.0]
The error means that your bundle has a mandatory reference to a service with the interface org.osgi.service.http.HttpService.
So you need to install a bundle that provides this service. In karaf this service is normally provided by pax-web. It can be installed using:
feature:install http

Need help in deploying warn using WSAdmin install with JNDI

I am trying to deploy a web application using WSAdmin tool. But it is throwing an error.
JACl script that I am using is :
$AdminApp install /opt/www/temp/SampleApp.war {-nopreCompileJSPs -nodeployejb -server delivery -cell delivery_cell -node delivery_node -appname SampleApp -contextroot SampleApp -MapWebModToVH {{"SampleApp" SampleApp.war,WEB-INF/web.xml default_host}}}
Error I am getting is:
com.ibm.ws.scripting.ScriptingException: WASX7109E: Insufficient data for install task "MapResRefToEJB
ADMA0007E: A validation error occurred in task Mapping resource references to resources. The Java Naming and Directory Interface (JNDI) name is not specified for resource reference jdbc/app_DB in module SampleApp with EJB name.
From the error above I understand that I need to configure my JNDI with -MapResRefToEJB. I tried to understand this option but getting too confused.
Can anyone help me to resolve this issue?
These errors appear to be caused by the MapResRefToEJB option in
the wsadmin command not being set correctly, or the resource it is pointing to
not existing correctly in the web.xml file.
Additional information on MapResRefToEJB
Options for the AdminApp object install, installInteractive, edit,
editInteractive, update, and updateInteractive commands
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rxml_taskoptions.html
Thank you
Note : Opinions are my own.

Resources