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

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

Related

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

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.

How to set args using Spring Camel Lib in application.properties

Working with SpringBoot, Java 11.
In application.properties i want to configure: camel.component.rabbitmq.args
Documentation by camel using rabbitmq: https://camel.apache.org/components/3.18.x/rabbitmq-component.html#_message_body
Note: I'm not asking about rabbit, just the configuration in application.
Error i have received trying to configure by my way:
application.properties
camel.component.rabbitmq.args={arg.queue.x-message-ttl=3600000}
Error:
Failed to bind properties under 'camel.component.rabbitmq.args' to java.util.Map<java.lang.String, java.lang.Object>:
Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.Object>]
How is the correct way by example? Thanks!!!
In the application.properties, the proper syntax for a component option of type Map is componentOptionName[mapKey]=mapValue so in your case it would be:
camel.component.rabbitmq.args[queue.x-message-ttl]=3600000

Error while triggering quartz job in spring boot, kubernetes

I'm using Quartz Scheduler in Spring Boot with Postgres as Database. It was working fine in local enivornment with both dev and prod profile, but once we deployed the appliation in kubernetes. We got the error while triggering the job.
quartz.properties file
> org.quartz.scheduler.instanceId=AUTO
org.quartz.threadPool.threadCount=20
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.jobStore.misfireThreshold=60000
org.quartz.jobStore.tablePrefix=QRTZ_
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.clusterCheckinInterval=20000
org.quartz.scheduler.classLoadHelper.class=org.quartz.simpl.ThreadContextClassLoadHelper
>
We received the following error
> org.quartz.JobPersistenceException: Couldn't retrieve trigger: Bad value for type long : \x
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveTrigger(JobStoreSupport.java:1538)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverMisfiredJobs(JobStoreSupport.java:984)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.doRecoverMisfires(JobStoreSupport.java:3264)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:4012)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:4033)
>
> Caused by: org.postgresql.util.PSQLException: Bad value for type long : \x
at org.postgresql.jdbc.PgResultSet.toLong(PgResultSet.java:2878)
at org.postgresql.jdbc.PgResultSet.getLong(PgResultSet.java:2085)
at org.postgresql.jdbc.PgResultSet.getBlob(PgResultSet.java:417)
at org.postgresql.jdbc.PgResultSet.getBlob(PgResultSet.java:404)
at com.zaxxer.hikari.pool.HikariProxyResultSet.getBlob(HikariProxyResultSet.java)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.getObjectFromBlob(StdJDBCDelegate.java:3190)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTrigger(StdJDBCDelegate.java:1780)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveTrigger(JobStoreSupport.java:1536)
Looking at your stacktrace, you are still using
org.quartz.impl.jdbcjobstore.StdJDBCDelegate
where your quartz.properties is set to
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
Therefore my guess is you are picking up wrong quartz.properties when it is running in kubernetes.

Spring Boot JMS & Batch

Previously everything worked properly. Today I configured Spring Batch together with my Spring Boot application and faced an issue with application.properties.
I have following properties encrypted with Jasypt:
spring.profiles.active=https
ENVIRONMENT=h2
#aws sqs
aws.sqs.account.access.key=ENC(kjsdh456fgkjhdfsgkjhdfg)
#queue message listener
queue.message.listener.task.executor.threads.number=1
queue.message.listener.task.executor.max.concurrent.consumers=1
Now, in order to configure Spring Batch I added
ENVIRONMENT=h2
to application.properties file.
also, I have added batch-h2.properties file:
# Placeholders batch.* for H2 database:
batch.jdbc.driver=org.h2.Driver
batch.jdbc.url=jdbc:h2:~/testdb;CIPHER=AES;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE
batch.jdbc.user=sa
batch.jdbc.password="sa sa"
batch.jdbc.testWhileIdle=false
batch.jdbc.validationQuery=
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-h2.sql
batch.schema.script=classpath:/org/springframework/batch/core/schema-h2.sql
batch.business.schema.script=classpath:/business-schema-h2.sql
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.H2SequenceMaxValueIncrementer
batch.database.incrementer.parent=sequenceIncrementerParent
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE
batch.table.prefix=BATCH_
and after that I continuously receiving following exception:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'aws.sqs.account.access.key' in string value "${aws.sqs.account.access.key}"
aws.sqs.account.access.key property now cannot be resolved.
I'm injecting this property into my configuration:
#Configuration
public class SQSConfig {
#Value("${aws.sqs.account.access.key}")
private String accessKey;
How to fix it ?

Weblogic deployment error

I have deployed ear files in oracle weblogic server and i also configured datasource for that project. When i try to test it it is giving me this error.
"Message icon - Error weblogic.application.ModuleException: :org.springframework.beans.factory.BeanDefinitionStoreException:Invalid bean definition with name 'userContext' defined in class path resource [voyager-seats-usercontext.xml]: Could not resolve placeholder 'IDM.USERNAME'
Message icon - Warning Errors were encountered while performing this operation."
I restarted and reconfigured this app still it is giving error.

Resources