Jua*_*gés 4 java netbeans servlets glassfish
I\'m getting an error when trying to use a JavaWeb project using Glassfish 5.0. Everytime it tries to bring data from my SQL Database it gives me this error.
\nStandardWrapperValve[ListadoPersonas]: Servlet.service() for servlet ListadoPersonas threw exception\njava.lang.NoClassDefFoundError: sun/security/ssl/HelloExtension
Here is the servlet ListadoEstadosCiviles where I call the function which brings the data back from my database
GestorPersonas g = new GestorPersonas();\nArrayList<EstadoCivil> lista = g.obtenerEstadosCiviles();\nfor (EstadoCivil estadoCivil : lista) {\n out.println("<tr><td>" + estadoCivil.getId() + "</td><td>" + estadoCivil.getNombre() + "</td></tr>");\n}\nRun Code Online (Sandbox Code Playgroud)\nHere is GestorPersonas() constructor:
public GestorPersonas() {\n try {\n Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(GestorPersonas.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\nRun Code Online (Sandbox Code Playgroud)\nHere is obtenerEstadosCiviles() method
public ArrayList<EstadoCivil> obtenerEstadosCiviles() {\n ArrayList<EstadoCivil> lista = new ArrayList<>();\n \n try {\n Connection conn = DriverManager.getConnection(CONN,USER,PASS);\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery("select * from EstadosCiviles");\n // Si el select devuelve una \xc3\xbanica fila, en lugar de while, se usa un if\n while (rs.next()) {\n int id = rs.getInt("id");\n String nombre = rs.getString("nombre");\n EstadoCivil ec = new EstadoCivil(id, nombre);\n lista.add(ec);\n }\n \n rs.close();\n st.close();\n conn.close();\n } catch (SQLException ex) {\n Logger.getLogger(GestorPersonas.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return lista;\n}\nRun Code Online (Sandbox Code Playgroud)\nI have no problem connecting my java application to sql, I think the problem is with glassfish but i cant figure out why it is not working
\nThis is the servlet that is calling obtenerEstadosCiviles() function, I expect that table full with data
I\'ve just checked my plugins and it appears that Java Web and EE it\xc2\xb4s activated but the "Active" symbol doesnt appears active. Could this be part of the problem?\n
| 归档时间: |
|
| 查看次数: |
7195 次 |
| 最近记录: |