How to overcome ConcurrentModificationException : null received in Spring Rest Template's exchange() method - spring-resttemplate

I am attaching the stack trace of exception that I am getting in my code.
java.util.ConcurrentModificationException: null
at java.base/java.util.ArrayList.forEach(ArrayList.java:1543)
at org.springframework.http.client.support.HttpAccessor.initialize(HttpAccessor.java:133)
at org.springframework.http.client.support.HttpAccessor.createRequest(HttpAccessor.java:125)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:772)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)

Related

JMS queue not found exception

Oi
I have a bpel process that puts messages in a jms queue and I need to do some specific work if the insertion on the queue fails for some reason.
To test that i disabled the insertion on the EM console but when the bpel tries to insert an exception is raised and i can't catch it.
Any work around for my problem?
This is my response
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<tracking:faultId xmlns:tracking="http://oracle.soa.tracking.core.TrackingProperty">470018</tracking:faultId>
</env:Header>
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>Exception occurred when binding was invoked. Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'Produce_Message' failed due to: ERRJMS_PROVIDER_ERR. ERRJMS_PROVIDER_ERR. Unable to produce message due to JMS provider internal error. Please examine the log file to determine the problem. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.</faultstring>
<faultactor/>
<detail>
<exception>Failed to send message to the destination SRVMEModule!SRVS04: Destination is suspended</exception>
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
Your fault looks like a standard binding fault which could be easly caught and handled. Put your jms insert activity inside a scope and you should be able to define error handler(catch all) on the scope level.

Create a P6 XML file using MPXJ java library

I have a json having all the information of my project, its activities, dependencies / relationships and the calendar. Using the MPXJ java library am trying to generate a corresponding Primevera P6 XML file that can be imported in Oracle primevera. I have been successful in creating an xml but when I import it in P6 it is giving me the below error.
*Microsoft.Practices.Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'CommandLineModule'.
The exception message was: Object reference not set to an instance of an object.
The Assembly that the module was trying to be loaded from was:
Primavera.Mercury.CommandLineModule, Version=15.2.0.15383, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Primavera.Mercury.Importer.ImportCleaner.CleanupActivities(EntityContext sourceContext)
at Primavera.Mercury.Importer.ImportCleaner.CleanSourceContext(EntityContext sourceContext, IVenusDataServiceContext targetContext, ILoggerFacade logger, ImportProjectSettings importProjectSettings, Dictionary`2 initialKeyDictionary)
at Primavera.Mercury.CommandLineModule.ExecuteImportExport.DoImport()
at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
--- End of inner exception stack trace ---
Failed to load type for module CommandLineModule.
Error was: An exception occurred while initializing module 'CommandLineModule'.
- The exception message was: Object reference not set to an instance of an object.
- The Assembly that the module was trying to be loaded from was:Primavera.Mercury.CommandLineModule, Version=15.2.0.15383, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.*

when I run my jsp pgogram I got this exception error type Exception report

type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it
from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 44 in the jsp file:
/jsp/ShoppingCart/AddBook.jsp The method getValue(String) is undefined
for the
type HttpServletRequest
int int_BookID,int_CategoryID,int_Price,int_Quantity;
String str_Title, str_Author, str_Publisher,str_Edition,str_Description;
int_BookID=(int)(10000*Math.random()+1);
int_CategoryID=Integer.parseInt(request.getValue("cat"));
str_Title=request.getParameter("title");
str_Author=request.getParameter("author");
str_Publisher=request.getParameter("pub");
request.getValue("cat") is the problem here.
I suppose the 'cat' is a parameter.
Instead , use request.getParameter("cat")
PS- I recommend you to read the basics of JSP first try the HeadFirst series.

How can I get a stack trace from my own code on errors in RabbitMQ subscription handler?

If an error is thrown inside a node.js function that handles incoming messages from RabbitMQ, the stack trace is from the node-amqp code instead of the one in my handler (and the error is commonly "cannot call method indexOf of undefined", regardless of what the actual error is).
Is there any way to get a stacktrace of my code being executed instead of one that stops at "the edge" of the node-amqp module?
Example stack trace:
stackTrace=TypeError: Cannot call method 'indexOf' of undefined
at Queue._onMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/queue.js:398:23)
at Queue.Channel._onChannelMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/channel.js:85:12)
at Connection._onMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/connection.js:443:28)
at AMQPParser.self.parser.onMethod (/myproject/node_modules/besedoq/node_modules/amqp/lib/connection.js:136:12)
In the lib at the line your stack trace refers to seems to lack a name of the queue, if you give your queue a name - maybe you get better stack trace?
https://github.com/postwait/node-amqp/blob/master/lib/queue.js#L398

groovy.lang$run.call(Unknown Source)

What is the meaning of groovy.lang$run.call(Unknown Source) and on what circumstances it will throw, this is the error what i'm getting in my groovy program
at groovy.lang$run.call(Unknown Source)
at groovy.lang.run(groovy.lang.Two_Script:6)
...................................................
...................................................
at groovy.lang.run(groovy.lang.Two_Script:6)
at groovy.lang$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
at one_script.run(level_one_script.groovy:5)
why it has not thrown at the compile time only # runtime it has thrown any Idea ?
attached the sample groovy these are very simple recursive calls;
level_one_script.groovy
new Two_Script(binding).run()
Two_Script.groovy
new Three_Script().run()
Three_Script.groovy
println "Anish"
the exception was thrown while evaluating Three_Script.groovy , it give me recurive call on Two_Script.groovy
Exception occurred while executing the script [level_one_script.groovy] - [java.lang.StackOverflowError].
try
{
compiledScript.eval(bindings)
//compiledScript is the type of CompiledScript
}
Surprising part is if i remove the call new Three_Script().run() from "Two_Script.groovy"
it shows me correct result
Surprising
If the Groovy scripts are all defined in a package, the error is not thrown.
If the scripts are moved to the default package (no package), the error is thrown.
What is the actual exception thrown (first few lines)
Looks like there's problem in your file level_one_script.groovy at line 5

Resources