Gunter Winkler, München, 2017-12-18
Oracle WebLogic Server 12c R2 is the industry's best application server for building and deploying enterprise Java EE applications with support for new features for lowering cost of operations, improving performance, enhancing scalability and supporting the Oracle Applications portfolio.
Oracle WebLogic Server 12c, the world’s first cloud-native, enterprise Java platform enables you to fully realize the benefits of cloud computing. Unique multitenancy capability drives massive consolidation. Lightweight microcontainer architecture drives application isolation and 100 percent portability between your private and public cloud. Multi data center high availability architecture protects against application disruption.
Stand: 2017-12-08
the source for modern java
The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform.
Spring Boot is designed to get you up and running as quickly as possible, with minimal upfront configuration of Spring.
reference http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
OS | WLS | |
---|---|---|
examples | ++ | ++ |
Maven archetypes | ++ | - |
documentation | + | + |
community | ++ | o |
source code | ++ | -- |
OS | WLS | |
---|---|---|
unit | ++ | ++ |
component | ++ | ++ |
integration | ++ | o |
@RunWith(SpringJUnit4ClassRunner.class)
^1^@SpringApplicationConfiguration^^(classes = SampleJettyApplication.class)
@WebAppConfiguration @DirtiesContext @IntegrationTest("server.port:0")
public class SampleJettyApplicationTests {
@Value("${local.server.port}") private int port;
@Test public void testHome() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate()
.^2^getForEntity("http://localhost:" + this.port, String.class)^^;
^3^assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK)^^;
^4^assertThat(entity.getBody()).contains("<p>Hello</p>")^^;
}
}
OS | WLS | |
---|---|---|
Maven | ++ | + |
maven-war-plugin, maven-ear-plugin, spring-boot-maven-plugin
OS | WLS | |
---|---|---|
manually | ++ | o (+) |
automatic | ++ | o (-) |
bash, WLST
"Lightweight microcontainer"
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
guwi17/java-spring-boot1 latest d81c07d2b0d6 19 hours ago 498 MB
guwi17/weblogic-demo latest 186690bc821c 2 weeks ago 2.19 GB
guwi17/weblogic-base latest 9c824e0ed467 2 weeks ago 2.19 GB
guwi17/java-base latest abdf162be4ff 3 weeks ago 485 MB
debian latest 6d83de432e98 6 weeks ago 100 MB
OS | WLS | |
---|---|---|
Servlet+JSP | + | ++ |
JSF | o | + |
thymeleaf | ++ | + |
OS | WLS | |
---|---|---|
JAX-RS | o | o |
Spring HATEOAS | ++ | o (+) |
OS | WLS | |
---|---|---|
WLS JPA/JTA | (--) | + |
hibernate (JPA) | + | o (+) |
Atomikos (JTA) | + | (--) |
Spring Data | ++ | (+) |
public class WrapDataSourceWithAtomikosBpp implements DestructionAwareBeanPostProcessor, Ordered {
@Override public int getOrder() { return Integer.MIN_VALUE; } // we want to be first
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
{
if (bean instanceof XADataSource) {
if (bean instanceof OracleDataSource) {
try { disableCache(bean); } catch (SQLException e) { ... }
}
AtomikosDataSourceBean wrapped = new AtomikosDataSourceBean();
wrapped.setXaDataSource((XADataSource) bean);
wrapped.setMinPoolSize(minXaPoolSize);
wrapped.setMaxPoolSize(maxXaPoolSize);
wrapped.setUniqueResourceName(beanName);
try { wrapped.setLoginTimeout(60); } catch (SQLException e) { ... }
return wrapped;
} else {
return bean;
}
}
}
@Configuration
@PropertySource(name = "myprops", ignoreResourceNotFound = true,
value = {
"^1^file:${user.dir}/config/override.properties^^",
"^2^file:${user.dir}/config/${stage}/override.properties^^",
"^3^file:${user.dir}/config/${componentName}/override.properties^^",
"^4^classpath:/config/${stage}/${componentName}.properties^^",
"^5^classpath:application-default.properties^^"})
public class DiscoveryConfig {
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
}
alternative: TNG Property Loader
<weblogic-application
xmlns="http://xmlns.oracle.com/weblogic/weblogic-application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-application
http://xmlns.oracle.com/weblogic/weblogic-application/1.4/weblogic-application.xsd">
<prefer-application-packages>
<package-name>org.slf4j.*</package-name>
<package-name>^1^org.springframework.*^^</package-name>
<package-name>^2^org.hibernate.*^^</package-name>
<package-name>com.fasterxml.jackson.*</package-name>
<package-name>org.apache.log4j.*</package-name>
<package-name>org.apache.commons.*</package-name>
<package-name>com.google.*</package-name>
<package-name>org.joda.time.*</package-name>
<package-name>antlr.*</package-name>
<package-name>javax.persistence.*</package-name>
<package-name>org.javassist.*</package-name>
<package-name>javassist.*</package-name>
<package-name>org.apache.xerces.*</package-name>
</prefer-application-packages>
<prefer-application-resources>
<resource-name>^3^org/slf4j/impl/StaticLoggerBinder.class^^</resource-name>
<resource-name>^4^META-INF/services/*^^</resource-name>
</prefer-application-resources>
</weblogic-application>
guwi17@gmx.de
gunter.winkler@tngtech.com
https://github.com/guwi17