This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Start with INSTANCE | |
| The first initialization was wrong with this ErrorMessage: | |
| java.lang.ExceptionInInitializerError | |
| The error message by every next acces: | |
| The first initialization was wrong with this ErrorMessage: | |
| at de.mosst.spielwiese.no_class_def_found_error.Tester.main(Tester.java:9) | |
| Caused by: java.lang.RuntimeException: RuntimeException by instance with field | |
| at de.mosst.spielwiese.no_class_def_found_error.SingeltonClass_with_INSTANCE_as_field.<init>(SingeltonClass_with_INSTANCE_as_field.java:8) | |
| at de.mosst.spielwiese.no_class_def_found_error.SingeltonClass_with_INSTANCE_as_field.<clinit>(SingeltonClass_with_INSTANCE_as_field.java:5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.mosst.spielwiese.no_class_def_found_error; | |
| import java.util.logging.Logger; | |
| @SuppressWarnings("unused") | |
| public class Tester { | |
| public static void main(String[] args) { | |
| System.out.println("Start with INSTANCE"); | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.mosst.spielwiese.no_class_def_found_error; | |
| public class SingeltonClass_with_INSTANCE_as_field { | |
| public static SingeltonClass_with_INSTANCE_as_field INSTANCE = new SingeltonClass_with_INSTANCE_as_field(); | |
| private SingeltonClass_with_INSTANCE_as_field() { | |
| throw new RuntimeException("RuntimeException by instance with field"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.mosst.spielwiese.no_class_def_found_error; | |
| public class SingeltonClass_with_getInstanceO_Method { | |
| private static SingeltonClass_with_getInstanceO_Method INSTANCE; | |
| private SingeltonClass_with_getInstanceO_Method() { | |
| throw new RuntimeException("RuntimeException by instance with getInstanceO_Method"); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apply plugin: 'java' | |
| repositories { | |
| mavenCentral() | |
| mavenRepo urls: "http://repository.jboss.org/nexus/content/groups/public/" | |
| } | |
| dependencies { | |
| compile 'org.jboss.resteasy:resteasy-jaxrs:2.3.5.Final' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SausageServlet extends HttpServlet { | |
| @Override | |
| protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | |
| try { | |
| Context initCtx = new InitialContext(); | |
| Context envCtx = (Context) initCtx.lookup("java:comp/env"); | |
| DataSource ds = (DataSource) envCtx.lookup("jdbc/SausageDB"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| portal-dependency-jars=\ | |
| jstl-api.jar,\ | |
| jstl-impl.jar | |
| portal-dependency-tlds=\ | |
| c.tld |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.sql.Sql | |
| Sql liferayDB = Sql.newInstance("jdbc:mysql://localhost:3306/liferay", "user1", "pass1", "com.mysql.jdbc.Driver") | |
| Sql statisticsDB = Sql.newInstance("jdbc:mysql://localhost:3306/statistics", "user2", "pass2", "com.mysql.jdbc.Driver") | |
| firstRow = tugetherDB.firstRow("SELECT count(*) as anzahl FROM User_ WHERE loginDate > (NOW() - INTERVAL 1 HOUR)") | |
| statisticsDB.execute("INSERT INTO loginsPerHour (zeit, useranzahl) VALUES (NOW(), $firstRow.anzahl)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
| <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
| <category name="com.liferay.portal"> | |
| <priority value="ERROR" /> | |
| </category> | |
| <category name="my.portlet.soccer"> |