Skip to content

Instantly share code, notes, and snippets.

View jrbalsas's full-sized avatar

José Ramón Balsas jrbalsas

  • University of Jaén
  • Jaén - Spain
View GitHub Profile
@jrbalsas
jrbalsas / README.MD
Last active June 13, 2020 08:59
Prevent Payara console log in Eclipse stop showing server logs

Fix Payara/Glassfish Tools console lock in Eclipse

Domain CA expired certificates made Payara server generate errors on starting which prevent payara console in Eclipse to show further message logs.

(temporal) workaround for development

Just remove related expired certificates from ${PAYARA_HOME}/glassfish/domains/domain1/config/cacerts.jks keystore.

Next cacerts.jks file (obtained from OpenJDK 14.0.1 installation) has them removed, so replace with it Payara domain cacerts.jks and restart Payara server. Download it from https://drive.google.com/file/d/1bKeWztVi0Ng_QGF9YQiEwLlGxT5uHyb0

@jrbalsas
jrbalsas / web.xml
Created February 8, 2020 19:56
web.xml JEE standard deploy descriptor compatible with Netbeans 11.2 edit wizard
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>

Keybase proof

I hereby claim:

  • I am jrbalsas on github.
  • I am jrbalsas (https://keybase.io/jrbalsas) on keybase.
  • I have a public key ASDoiUvqg0r4LnC-BB843eqdzk6EW_hU0l2amLR3nPW-Nwo

To claim this, I am signing this object:

@jrbalsas
jrbalsas / create_realm.bat
Last active April 12, 2019 16:14
JDBC realm creation with asadmin util
REM Windows version: escape : with \: and linefeed with ^
c:\payara5\glassfish\bin\asadmin create-auth-realm ^
--classname com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm ^
--property jaas-context=jdbcRealm^
:datasource-jndi=java\:global/jdbc/auth^
:user-table=USUARIOS^
:user-name-column=USUARIO^
:password-column=CLAVE^
:group-table=ROLES^
@jrbalsas
jrbalsas / ClientesRESTService.java
Last active March 23, 2019 15:14
Cambios para introducir JAX-RS en app SpringMVC
@Path("/clientes")
@Produces(MediaType.APPLICATION_JSON)
//@RequestScoped //No necesario con Spring
public class ClientesRESTService {
@Context
private UriInfo context;
@Autowired //Utilizamos anotaciones de inyección Spring
@Qualifier("clienteDAOList")
@jrbalsas
jrbalsas / app.js
Last active May 4, 2018 12:02
Práctica angular
angular.module('Club',[ 'ClientesControllerModule' /*otros módulos de la APP*/ ] );
@jrbalsas
jrbalsas / 01_MuroWebApplicationInitializer.java
Last active March 26, 2019 08:49
DAW P8 fragmentos de código
public class MuroWebApplicationInitializer
implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext container) {
// Create the 'root' Spring application context
AnnotationConfigWebApplicationContext rootContext
= new AnnotationConfigWebApplicationContext();
rootContext.register(SpringMvcConfig.class);
// Manage the lifecycle of the Spring root application context
@jrbalsas
jrbalsas / Racional.cpp
Last active February 20, 2018 12:03
Ejemplo de clase Racional
/*
* File: Racional.cpp
* Author: jrbalsas
*
* Created on 6 de febrero de 2018, 11:24
*/
#include "Racional.h"
#include <iostream>
//Racional::Racional()
@jrbalsas
jrbalsas / SpringDispatcher-servlet.xml
Last active March 27, 2017 07:23
DAW Muro SpringMVC
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
@jrbalsas
jrbalsas / nombre.jsp
Last active March 1, 2017 17:16
DAW. Práctica 4. Ejemplos de uso de JSP
<%--
Ejemplo de formulario con validación simple en JSP utilizando scriptlets
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>