Thursday, May 18, 2017

Possible solution to preflight problem with Options request in a Rest Service under Chrome.


There is a common error under rest service development with AngularJS framework after that understood that internally the framework do OPTIONS requests to know who is invoking an error like follows can occur:

Response for preflight has invalid HTTP status code 400

The possible solution to this problem is to check CORSFilter and when the request contains a OPTIONS just respond an OK status:

...
    if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
        response.setStatus(HttpServletResponse.SC_OK);
    } else {
        chain.doFilter(req, res);
    }

Important links:


Wednesday, May 3, 2017

How to solve IBM MQ NoClassDefFoundError over jms configuration?

I f you are using IBM MQ jars to development, you must carry about jms specification you are using, sometimes not all distributions is not used over application instend of that the following error can occurs:

java.lang.NoClassDefFoundError: com.ibm.mq.internal.MQCommonServices
...

The solution is to use jms.jar and part of the jars inside IBM MQ distribution as example like:
  • com.ibm.mq.jar
  • com.ibm.mq.jmqi.jar
  • com.ibm.mq.headers.jar
  • com.ibm.mq.commonservices.jar

Best Regards,

Wednesday, April 26, 2017

How to solve 'Cannot assign requested address: JVM_Bind' on NodeManager in Weblogic?

Next problem could be caused by port used by other process or ip is not suited in hosts file:

--------------------------------------------
 The server is unable to create a server socket for listening. The address localhost might be incorrect or another process is using port 5556: java.net.BindException: Cannot assign requested address: JVM_Bind
--------------------------------------------
Windows check: netstat -an | find "5556"

After checking if ports were used by another process next is to make a review in hosts file whether or not is IP correct declared.

Best Regards,