ADDITIONAL SYSTEM INFORMATION :
Java 8
A DESCRIPTION OF THE PROBLEM :
I am using Jdev 12.2.1.4 version and using the Java 8 Lambda Expression, It gives the error on ruining the app. The Fast Swap is true in weblogic.xml file, this file in in web-inf/weblogic.xml.
Error: java.lang.ClassFormatError: Class file version does not support constant tag 18 in class file
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
@WebServlet(name = âConsumerâ, urlPatterns = { â/consumerâ })
public class Consumer extends HttpServlet {
private static final String CONTENT_TYPE = âtext/html; charset=windows-1252â;
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println(ââ);
out.println(âConsumerâ);
out.println(ââ);
out.println(âThe servlet has received a GET. This is the reply.â);
out.println(ââ);
out.close();
Runnable r = () ->{
System.out.println(âHelloâ);
};
r.run();
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a web application in jdeveloper 12C
2. Ceate deployment descriptor which weblogic.xml in web-inf folder, here is the content of weblogic.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd"
xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<fast-swap>
<enabled>true</enabled>
<refresh-interval>20</refresh-interval>
</fast-swap>
</weblogic-web-app>
3. Create a servlet and add lambda expression in doPost method
4. Run the application on right clinking the servlet.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
App runs file
ACTUAL -
java.lang.ClassFormatError: Class file version does not support constant tag 18 in class file view/Consumer$beaVersion1_2
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
Truncated. see log file for complete stacktrace
---------- BEGIN SOURCE ----------
package view;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
@WebServlet(name = "Consumer", urlPatterns = { "/consumer" })
public class Consumer extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Consumer</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
out.close();
Runnable r = () ->{
System.out.println("Hello");
};
r.run();
}
}
---------- END SOURCE ----------
Java 8
A DESCRIPTION OF THE PROBLEM :
I am using Jdev 12.2.1.4 version and using the Java 8 Lambda Expression, It gives the error on ruining the app. The Fast Swap is true in weblogic.xml file, this file in in web-inf/weblogic.xml.
Error: java.lang.ClassFormatError: Class file version does not support constant tag 18 in class file
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
@WebServlet(name = âConsumerâ, urlPatterns = { â/consumerâ })
public class Consumer extends HttpServlet {
private static final String CONTENT_TYPE = âtext/html; charset=windows-1252â;
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println(ââ);
out.println(âConsumerâ);
out.println(ââ);
out.println(âThe servlet has received a GET. This is the reply.â);
out.println(ââ);
out.close();
Runnable r = () ->{
System.out.println(âHelloâ);
};
r.run();
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a web application in jdeveloper 12C
2. Ceate deployment descriptor which weblogic.xml in web-inf folder, here is the content of weblogic.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd"
xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<fast-swap>
<enabled>true</enabled>
<refresh-interval>20</refresh-interval>
</fast-swap>
</weblogic-web-app>
3. Create a servlet and add lambda expression in doPost method
4. Run the application on right clinking the servlet.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
App runs file
ACTUAL -
java.lang.ClassFormatError: Class file version does not support constant tag 18 in class file view/Consumer$beaVersion1_2
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
Truncated. see log file for complete stacktrace
---------- BEGIN SOURCE ----------
package view;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
@WebServlet(name = "Consumer", urlPatterns = { "/consumer" })
public class Consumer extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Consumer</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
out.close();
Runnable r = () ->{
System.out.println("Hello");
};
r.run();
}
}
---------- END SOURCE ----------