= JBoss5 = * JEE5 certified * Java EE 5 (May 11, 2006) (Java Servlet 2.5, JSP 2.1, JSTL 1.2, JSF 1.2, EJB 3.0, JDBC 3.0) * https://docs.oracle.com/javaee/5/tutorial/doc/javaeetutorial5.pdf * https://docs.oracle.com/javaee/5/tutorial/doc/ * Web container * EJB container * Requires jdk-1_5_0_22-linux-amd64.bin from Oracle to run * run.sh -c options :minimal default all standard web {{attachment:jeeTiers.png}} {{attachment:jeeContainers.png}} == Locally on debian buster == {{{ cp jdk-1_5_0_22-linux-amd64.bin ~ cd ~ ./jdk-1_5_0_22-linux-amd64.bin unzip jboss-5.1.0.GA.zip JAVA_HOME=jdk1.5.0_22/ jboss-5.1.0.GA/bin/run.sh -b 0.0.0.0 http://127.0.0.1:8080/ wget https://archive.apache.org/dist/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.zip unzip apache-maven-3.1.1-bin.zip JAVA_HOME=jdk1.5.0_22/ ~/apache-maven-3.1.1/bin/mvn -version JAVA_HOME=~/jdk1.5.0_22/ ~/apache-maven-3.1.1/bin/mvn clean install }}} == Docker == Dockerfile {{{ FROM ubuntu:16.04 RUN apt-get update && apt-get install -y openssh-server unzip openjdk-8-jdk net-tools maven vim RUN mkdir /var/run/sshd RUN echo 'root:screencast' | chpasswd RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config # SSH login fix. Otherwise user is kicked off after login RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd ENV NOTVISIBLE "in users profile" RUN echo "export VISIBLE=now" >> /etc/profile RUN useradd userx RUN echo 'userx:userx' | chpasswd EXPOSE 22 8080 8081 8009 8009 CMD ["/usr/sbin/sshd", "-D"] }}} {{{#!highlight bash wget http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA.zip unzip jboss-5.1.0.GA.zip nano Dockerfile docker build -t docker_jboss5 . mkdir target docker run -d -p 8080:8080 --name jboss5_container --mount type=bind,source="$(pwd)"/target,target=/app docker_jboss5 #docker run -d -P --name jboss5_container --mount type=bind,source="$(pwd)"/target,target=/app docker_jboss5 mv ~/jboss-5.1.0.GA.zip target/ docker exec -it jboss5_container bash cd /app unzip jboss-5.1.0.GA.zip ./jdk-1_5_0_22-linux-amd64.bin /app# jdk1.5.0_22/bin/java -version #java version "1.5.0_22" #Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03) #Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode) #/app/jdk1.5.0_22/bin/java -jar run.jar mvn -version #Apache Maven 3.3.9 #Maven home: /usr/share/maven #Java version: 1.8.0_252, vendor: Private Build #Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre #Default locale: en_US, platform encoding: ANSI_X3.4-1968 #OS name: "linux", version: "4.19.0-6-amd64", arch: "amd64", family: "unix" cd /app/jboss-5.1.0.GA/bin JAVA_HOME=/app/jdk1.5.0_22 ./run.sh -c all -b 0.0.0.0 }}} == HyperSQL Database (HSQLDB) == * http://hsqldb.org/ HyperSQL is used for development, testing and deployment of database applications. {{{ user: sa pwd: empty port: 1701 db path: /app/jboss-5.1.0.GA/server/default/data/hypersonic/localDB java -cp ./common/lib/hsqldb.jar org.hsqldb.util.SqlTool localDB #rcfile # vi /root/sqltool.rc urlid localDB url jdbc:hsqldb:/app/jboss-5.1.0.GA/server/default/data/hypersonic/localDB;shutdown=true username sa password /app/jboss-5.1.0.GA/server/default/data/hypersonic java -cp /app/jboss-5.1.0.GA/common/lib/hsqldb.jar org.hsqldb.util.SqlTool localDB \? \q # show tables \dt TABLE_SCHEM TABLE_NAME ----------- -------------- PUBLIC ADDENTITY sql> select * from addentity; ID CREATIONDATE OP1 OP2 RES -- ----------------------- --- --- --- 1 2020-06-20 15:05:29.037 1 7 8 2 2020-06-20 15:05:30.509 1 7 8 3 2020-06-20 15:05:31.137 1 7 8 4 2020-06-20 15:05:43.043 1 70 71 5 2020-06-20 15:09:01.0 299 1 300 6 2020-06-20 15:25:14.918 1 2 3 7 2020-06-20 15:25:42.434 10 20 30 }}} == JNDIView == * http://127.0.0.1:8080/jmx-console/ Show JNDI info. In jmx console choose jboss, service=JNDIView, invoke list, Global JNDI Namespace * http://127.0.0.1:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DJNDIView == Spring 3.0.1 in JBoss 5 == * https://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/new-in-3.html#new-in-3-intro === pom.xml === {{{#!highlight xml 4.0.0 org.allowed.bitarus testSpringMVCJSP 0.1.0 war org.springframework spring-core 3.0.1.RELEASE org.springframework spring-web 3.0.1.RELEASE org.springframework spring-webmvc 3.0.1.RELEASE src/main/java maven-compiler-plugin 1.5 1.5 }}} === src/main/java/org/allowed/bitarus/hello/HelloController.java === {{{#!highlight java package org.allowed.bitarus.hello; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller public class HelloController { @RequestMapping("/hello") public String hellox(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) { model.addAttribute("name", name); return "greeting"; } } }}} === src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml === {{{#!highlight xml /WEB-INF/pages/ .jsp }}} === src/main/webapp/WEB-INF/pages/greeting.jsp === {{{#!highlight html Getting Started: Serving Web Content

Hello ${name}

}}} === src/main/webapp/WEB-INF/web.xml === {{{#!highlight xml Spring MVC Application + JSP mvc-dispatcher org.springframework.web.servlet.DispatcherServlet 1 mvc-dispatcher / contextConfigLocation /WEB-INF/mvc-dispatcher-servlet.xml org.springframework.web.context.ContextLoaderListener }}}