Quantcast
Channel: DevOps tips & tricks
Viewing all 181 articles
Browse latest View live

Java EE compatibility - JBoss EAP , JBoss AS, JBoss WildFly

$
0
0

Java EE compatibility

 http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html

Java EE 7


JBoss EAP 7 - Enterprise version - no official date yet

JBoss WildFly  8/9/10 - Community version http://wildfly.org/

Weblogic 12.1.4 - no official date yet -  https://blogs.oracle.com/emeapartnerweblogic/entry/the_road_ahead_for_weblogic2

Java EE6


JBoss EAP 6 - Enterprise version - http://www.jboss.org/products/eap/overview/

JBoss AS 7  - Community version - discontinued - project moved to WildFly  ( archived downloads are here http://jbossas.jboss.org/downloads.html )

Weblogic 12.1.3 -  http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html

Draw graph using GraphML and yEd graph editor

$
0
0
Graph theory http://algs4.cs.princeton.edu/41graph/

GraphMLhttp://graphml.graphdrawing.org/
GraphML Primer http://graphml.graphdrawing.org/primer/graphml-primer.html

yEd graph editor
http://www.yworks.com/en/products/yfiles/yed/
http://docs.yworks.com/yfiles/doc/developers-guide/graphml.html


Graph stored in simple text format



user11 group1
user12 group1
user21 group2
user22 group2
user31 group3
user32 group3
user41 group4
user42 group4
group1 orgunit1
group2 orgunit1
group3 orgunit2
group4 orgunit2 

Java code to create GraphML file fromgraph stored in simple text format
( using algs4 libs - can beeasily rewritten to use  standard Java IO)
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import edu.princeton.cs.algs4.In;
import edu.princeton.cs.algs4.Out;
import edu.princeton.cs.algs4.StdOut;

public class TestDrawGraph {

public static void main(String[] args) {

Map<String, Integer> principals = new HashMap<>();
Map<Integer, String> revert_principals = new HashMap<>();
Map<Integer, List<Integer>> graph = new HashMap<>();

In in = new In(args[0]);

int V = 0;

while (in.hasNextLine()) {
String v = in.readString();
String w = in.readString();

// StdOut.println("v=" + v + " w=" + w);

if (!principals.containsKey(v)) {
principals.put(v, V++);
revert_principals.put(principals.get(v), v);
graph.put(principals.get(v), new ArrayList<Integer>());
}
if (!principals.containsKey(w)) {
principals.put(w, V++);
revert_principals.put(principals.get(w), w);
graph.put(principals.get(w), new ArrayList<Integer>());
}

graph.get(principals.get(v)).add(principals.get(w));

}

Out out = new Out(args[0] + ".graphml");

out.print("<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\""
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+ " xmlns:y=\"http://www.yworks.com/xml/graphml\""
+ " xmlns:yed=\"http://www.yworks.com/xml/yed/3\""
+ " xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns"
+ "http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd\"> ");

out.print(
"<key for=\"node\" id=\"d6\" yfiles.type=\"nodegraphics\"/> ");

out.print("<graph id=\"G\" edgedefault=\"undirected\">\n");

for (String node : principals.keySet()) {
out.printf(
"<node id=\"%s\">\n" + "<data key=\"%s\">\n"
+ "<y:GenericNode configuration=\"com.yworks.entityRelationship.small_entity\">\n"
+ "\t<y:Geometry height=\"40.0\" width=\"80.0\" x=\"383.0\" y=\"227.0\"/>\n"
+ "\t<y:Fill color=\"#E8EEF7\" transparent=\"false\"/>\n"
+ "\t<y:BorderStyle color=\"#000000\" type=\"line\" width=\"1.0\"/>\n"
+ "\t<y:NodeLabel>%s</y:NodeLabel>\n"
+ "</y:GenericNode>\n" + "</data>\n </node>\n",
node, "d6", node);
}

for (Map.Entry<Integer, List<Integer>> me : graph.entrySet()) {
for (Integer w : me.getValue()) {
out.printf("<edge source=\"%s\" target=\"%s\"/>\n",
revert_principals.get(me.getKey()),
revert_principals.get(w));

}
}

out.print("</graph>\n" + "</graphml>\n");

out.close();

StdOut.print("Created" + args[0] + ".graphml");

}

}

Generated graph displayed in yEd

 http://www.summa-tech.com/blog/2011/04/12/a-visual-maven-dependency-tree-view
 In yEd modify the layout of the graph using menu
  Select Layout > Hierarchical > Orientation > Left to Right > OK 

Graph using Bottom -> Top



Graph using Tree -> Ballon



GraphML file created
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:y="http://www.yworks.com/xml/graphml"  xmlns:yed="http://www.yworks.com/xml/yed/3"  xsi:schemaLocation="http://graphml.graphdrawing.org/xmlnshttp://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">  <key for="node" id="d6" yfiles.type="nodegraphics"/>   <graph id="G" edgedefault="undirected">
<node id="user11">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user11</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user22">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user22</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user21">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user21</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user32">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user32</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user31">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user31</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user42">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user42</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user41">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user41</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="user12">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>user12</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="group4">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>group4</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="group3">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>group3</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="group2">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>group2</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="group1">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>group1</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="orgunit1">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>orgunit1</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<node id="orgunit2">
<data key="d6">
<y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
<y:Geometry height="40.0" width="80.0" x="383.0" y="227.0"/>
<y:Fill color="#E8EEF7" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel>orgunit2</y:NodeLabel>
</y:GenericNode>
</data>
</node>
<edge source="user11" target="group1"/>
<edge source="group1" target="orgunit1"/>
<edge source="user12" target="group1"/>
<edge source="user21" target="group2"/>
<edge source="group2" target="orgunit1"/>
<edge source="user22" target="group2"/>
<edge source="user31" target="group3"/>
<edge source="group3" target="orgunit2"/>
<edge source="user32" target="group3"/>
<edge source="user41" target="group4"/>
<edge source="group4" target="orgunit2"/>
<edge source="user42" target="group4"/>
</graph>
</graphml>

Create new Scala Maven project for Eclipse

$
0
0
Scala with Maven tutorial
http://docs.scala-lang.org/tutorials/scala-with-maven.html

Download latest version of Scala http://www.scala-lang.org/download/2.11.7.html

Upgrade Scala version

[root@localhost Downloads]# dnf  upgrade  scala-2.11.7.rpm


Create Scala Maven project from archetype using

   mvn archetype:generate

Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 686: scala
Choose archetype:
1: remote -> co.cask.cdap:cdap-spark-scala-archetype (-)
2: remote -> com.github.igor-petruk.archetypes:maven-archetype-scala-executable (Creates executable Scala Project that is ready to run with 'java -jar')
3: remote -> de.schlichtherle:javafx-scala-demo (An archetype for a standalone JavaFX 2.0 application written in Scala.
The generated application is translated from the Colorful Circles demo from the
JavaFX 2.0 SDK.)
4: remote -> eu.stratosphere:quickstart-scala (-)
5: remote -> net.alchim31.maven:scala-archetype-simple (The maven-scala-plugin is used for compiling/testing/running/documenting scala code in maven.)
6: remote -> net.ladstatt:scala-javafx-archetype (The Scala JavaFX Archetype provides a simple template for a scala based
    JavaFX project)
7: remote -> org.apache.camel.archetypes:camel-archetype-component-scala (Creates a new Camel component with Scala.)
8: remote -> org.apache.camel.archetypes:camel-archetype-scala (Creates a new Camel project using Scala DSL.)
9: remote -> org.apache.flink:flink-quickstart-scala (-)
10: remote -> org.fusesource.scalate.tooling:scalate-archetype-empty (An archetype which creates an empty Scalate web application)
11: remote -> org.fusesource.scalate.tooling:scalate-archetype-guice (An archetype which creates an empty Scalate Guice web application)
12: remote -> org.fusesource.scalate.tooling:scalate-archetype-guice_2.10 (An archetype which creates an empty Scalate Guice web application)
13: remote -> org.fusesource.scalate.tooling:scalate-archetype-guice_2.9 (An archetype which creates an empty Scalate Guice web application)
14: remote -> org.fusesource.scalate.tooling:scalate-archetype-jersey (An archetype which creates an empty Scalate web application)
15: remote -> org.fusesource.scalate.tooling:scalate-archetype-jersey_2.10 (An archetype which creates an empty Scalate web application)
16: remote -> org.fusesource.scalate.tooling:scalate-archetype-jersey_2.9 (An archetype which creates an empty Scalate web application)
17: remote -> org.fusesource.scalate.tooling:scalate-archetype-sitegen (An archetype which creates an empty Scalate static website generation project)
18: remote -> org.fusesource.scalate.tooling:scalate-archetype-sitegen_2.10 (An archetype which creates an empty Scalate static website generation project)
19: remote -> org.fusesource.scalate.tooling:scalate-archetype-sitegen_2.9 (An archetype which creates an empty Scalate static website generation project)
20: remote -> org.openjdk.jmh:jmh-scala-benchmark-archetype (Generates Scala benchmarking project, uses JMH bytecode processors)
21: remote -> org.scala-tools.archetypes:scala-archetype-simple (The maven-scala-plugin is used for compiling/testing/running/documenting scala code in maven.)
22: remote -> org.scalatra.scalate.tooling:scalate-archetype-guice_2.10 (An archetype which creates an empty Scalate Guice web application)
23: remote -> org.scalatra.scalate.tooling:scalate-archetype-guice_2.11 (An archetype which creates an empty Scalate Guice web application)
24: remote -> org.scalatra.scalate.tooling:scalate-archetype-jersey_2.10 (An archetype which creates an empty Scalate web application)
25: remote -> org.scalatra.scalate.tooling:scalate-archetype-jersey_2.11 (An archetype which creates an empty Scalate web application)
26: remote -> org.scalatra.scalate.tooling:scalate-archetype-sitegen_2.10 (An archetype which creates an empty Scalate static website generation project)
27: remote -> org.scalatra.scalate.tooling:scalate-archetype-sitegen_2.11 (An archetype which creates an empty Scalate static website generation project)
28: remote -> org.wicketstuff.scala:wicket-scala-archetype (Basic setup for a project that combines Scala and Wicket,
        depending on the Wicket-Scala project. Includes an example Specs
        test.)
29: remote -> org.wicketstuff.scala:wicketstuff-scala-archetype (Basic setup for a project that combines Scala and Wicket,
        depending on the Wicket-Scala project. Includes an example Specs
        test.)
30: remote -> pl.org.miki:scala-quickstart-archetype (Customizable cruft-free Scala archetype. Options:
-sourceFolders: [all-in-src-java, scala-only, both-split-src]. DEFAULT: all-in-src-java.
--all-in-src-java: Scala and Java code are both in src/main/java (same for test). Plays nicely with IDEs.
--scala-only: only src/main/scala set up, and set as source folder.
--both-split-src: both src/main/java and src/main/scala. Can play merry havock with IDEs, so not the default.
-testLibrary: [scalatest, specs2, scalacheck-only, junit-only]. DEFAULT: scalatest.
--scalatest: adds Scalatest AND Scalacheck AND JUnit for most of your testing needs.
--specs2: adds specs2 AND Scalacheck AND JUnit.
--scalacheck-junit: adds Scalacheck AND JUnit.
--junit-only: adds JUnit ONLY.
-scalaVersion: 2.10.x+. DEFAULT: 2.11.2.
*The Scala tool version is generated automatically.
*Some Scala versions may not be compatible with selected test library versions. Adjust as necessary.)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :

Choose simple archetype ( number 5 or 30 )

https://github.com/mikolak-net/scala-quickstart-archetype 

Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 5
Choose net.alchim31.maven:scala-archetype-simple version:
1: 1.4
2: 1.5
3: 1.6
Choose a number: 3: 3
Downloading: http://maven.repository.redhat.com/earlyaccess/all/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.jar
Downloading: http://maven.repository.redhat.com/techpreview/all/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.jar
Downloading: https://repo.maven.apache.org/maven2/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.jar
Downloaded: https://repo.maven.apache.org/maven2/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.jar (5 KB at 16.5 KB/sec)
Downloading: http://maven.repository.redhat.com/earlyaccess/all/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.pom
Downloading: http://maven.repository.redhat.com/techpreview/all/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.pom
Downloading: https://repo.maven.apache.org/maven2/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.pom
Downloaded: https://repo.maven.apache.org/maven2/net/alchim31/maven/scala-archetype-simple/1.6/scala-archetype-simple-1.6.pom (4 KB at 33.7 KB/sec)
Define value for property 'groupId': : scala
Define value for property 'artifactId': : class-finder
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': scala: : dave
Confirm properties configuration:
groupId: scala
artifactId: class-finder
version: 1.0-SNAPSHOT
package: dave
Y: :


Created project
[dave@localhost scala]$ find 
.
./class-finder
./class-finder/pom.xml
./class-finder/.gitignore
./class-finder/src
./class-finder/src/main
./class-finder/src/main/scala
./class-finder/src/main/scala/dave
./class-finder/src/main/scala/dave/App.scala
./class-finder/src/test
./class-finder/src/test/scala
./class-finder/src/test/scala/samples
./class-finder/src/test/scala/samples/junit.scala
./class-finder/src/test/scala/samples/specs.scala
./class-finder/src/test/scala/samples/scalatest.scala



Add into pom.xml  the build-helper-maven-plugin to add new source folders as described here http://docs.scala-lang.org/tutorials/scala-with-maven.html

Import existing  Maven  project into Eclipse

Edit .project and .classpath files to include Scala

Optionally
  -- Run mvn eclipse:eclipse in project dir
  --- Configure Eclipse workspace

dave@localhost class-finder]$ mvn -Declipse.workspace="/home/dave/workspace/scala"  eclipse:configure-workspace

.project

[dave@localhost class-finder]$ more .project 
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>class-finder</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.scala-ide.sdt.core.scalabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.m2e.core.maven2Builder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.scala-ide.sdt.core.scalanature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.m2e.core.maven2Nature</nature>
    </natures>
</projectDescription>

.classpath

[dave@localhost class-finder]$ more .classpath 
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMTyp
e/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/main/scala">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/scala">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>


pom.xml

[dave@localhost class-finder]$ more pom.xml 
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven
.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>scala</groupId>
    <artifactId>class-finder</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <scala.version>2.11.7</scala.version>
        <scala.version.tools>2.11</scala.version.tools>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <!-- this is so we don't end with a compile error in maven-compiler-plugin -->       
                        <phase>process-sources</phase>                    
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <mainSourceDir>${project.build.sourceDirectory}/../java</mainSourceDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/main/scala</source>
                </sources>
            </configuration>
        </execution>
        <execution>
            <id>add-test-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-test-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/test/scala</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>
 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>dave.MainClass</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
        </plugin>


        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalacheck</groupId>
            <artifactId>scalacheck_${scala.version.tools}</artifactId>
            <version>1.11.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.version.tools}</artifactId>
            <version>2.2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


Run mvn package 

Open project in Eclipse IDE



Add launcher for command line
<build>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
      <launchers>
        <launcher>
          <id>foo</id>
          <mainClass>dave.App</mainClass>
          <!-- args are optional -->
          <args>
            <arg>arg1</arg>
          </args>
          <!-- jvmArgs are optional -->
          <jvmArgs>
            <jvmArg>-Xmx128m</jvmArg>
            <jvmArg>-Djava.library.path=...</jvmArg>
          </jvmArgs>
        </launcher>
        <!-- you could define other launcher -->
      </launchers>
    </configuration>


Run project  from command line


mvn scala:run

[INFO] launcher 'foo' selected => dave.App
Hello World!
concat arguments = arg1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------


Known errors

http://scala-ide.org/docs/current-user-doc/faq/index.html#Know_Issue

Add m2e-scalahttp://alchim31.free.fr/m2e-scala/update-site/

If you see errors in using prototype modify the pom.xml

[INFO] /home/dave/git/scala/class-finder/src/main/scala:-1: info: compiling
[INFO] Compiling 1 source files to /home/dave/git/scala/class-finder/target/classes at 1447218248818
[ERROR] scalac error: bad option: '-make:transitive'


see here http://stackoverflow.com/questions/12812458/getting-started-with-scala-scalatest-and-maven

Try to change versions in pom.xml or  change options for scala-maven-plugin

https://github.com/davidB/scala-maven-plugin
  

https://github.com/scala/scala-module-dependency-sample/blob/master/maven-sample/pom.xml


Error related to versions of Scala artifacts - change the repository configuration
[ERROR] Failed to execute goal on project class-finder: Could not resolve dependencies for project scala:class-finder:jar:1.0-SNAPSHOT: Could not find artifact org.scalaz.stream:scalaz-stream_2.11:jar:0.7a in jboss-earlyaccess-repository (http://maven.repository.redhat.com/earlyaccess/all/) -> [Help 1]

Weblogic 12.2.1 - Java EE 7 installation

$
0
0

Java EE 7 - Tested Configurations,  Oracle Weblogic Server 12.2.1

http://www.oracle.com/technetwork/java/javaee/overview/oracleweblogic1211-2769862.html

Oracle WebLogic Server (WLS) 12cR2 (12.2.1) Installation Guide

https://oracle-base.com/articles/12c/weblogic-installation-on-oracle-linux-6-and-7-1221

Using 64 bit Java SE 8
[dave@localhost app]$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Running generic installer
[dave@localhost app]$ java -jar fmw_12.2.1.0.0_wls.jar 
Launcher log file is /tmp/OraInstall2016-01-08_07-28-44AM/launcher2016-01-08_07-28-44AM.log.


Checking requirements
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz. Actual 2900.000 MHz Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Checking swap space: must be greater than 512 MB. Actual 3855 MB Passed
Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)
Checking temp space: must be greater than 300 MB. Actual 1123 MB Passed


Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2016-01-08_07-28-44AM


Select installation home












Create domain
[dave@localhost bin]$ pwd
/app/weblogic-12.2.1/oracle_common/common/bin
[dave@localhost bin]$ ./config.sh

Start created domain
[dave@localhost bin]$ pwd
/app/domains/base_domain/bin
[dave@localhost bin]$ ./startWebLogic.sh


Admin server log
[dave@localhost bin]$ ./startWebLogic.sh 
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000
.
CLASSPATH=/usr/java/jdk1.8.0_66/lib/tools.jar:/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic.jar:/home/app/weblogic-12.2.1/wlserver/../oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b3/lib/ant-contrib.jar:/home/app/weblogic-12.2.1/wlserver/modules/features/oracle.wls.common.nodemanager.jar:/home/app/weblogic-12.2.1/wlserver/../oracle_common/modules/com.oracle.cie.config-wls-online_8.2.0.0.jar::/home/app/weblogic-12.2.1/wlserver/common/derby/lib/derbynet.jar:/home/app/weblogic-12.2.1/wlserver/common/derby/lib/derbyclient.jar:/home/app/weblogic-12.2.1/wlserver/common/derby/lib/derby.jar:.:/app/antlr-4.4-complete.jar:
.
PATH=/app/domains/base_domain/bin:/home/app/weblogic-12.2.1/wlserver/server/bin:/home/app/weblogic-12.2.1/wlserver/../oracle_common/modules/org.apache.ant_1.9.2/bin:/usr/java/jdk1.8.0_66/jre/bin:/usr/java/jdk1.8.0_66/bin:/usr/java/jdk1.8.0_66/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/dave/.local/bin:/home/dave/bin
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
Starting WLS with line:
/usr/java/jdk1.8.0_66/bin/java -server -Xms256m -Xmx512m -XX:CompileThreshold=8000 -Dweblogic.Name=AdminServer -Djava.security.policy=/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic.policy -Xverify:none -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/home/app/weblogic-12.2.1/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/home/app/weblogic-12.2.1/wlserver/server -Dweblogic.home=/home/app/weblogic-12.2.1/wlserver/server weblogic.Server
<Jan 8, 2016 8:00:47 AM CET> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Jan 8, 2016 8:00:47 AM CET> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Jan 8, 2016 8:00:48 AM CET> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.66-b17 from Oracle Corporation.>
<Jan 8, 2016 8:00:48 AM CET> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.>
<Jan 8, 2016 8:00:49 AM CET> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.0.0 Tue Oct 6 10:05:47 PDT 2015 1721936>
<Jan 8, 2016 8:00:51 AM CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<Jan 8, 2016 8:00:51 AM CET> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<Jan 8, 2016 8:00:51 AM CET> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.>
<Jan 8, 2016 8:00:53 AM CET> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=2056123022
Current log file=/home/app/domains/base_domain/servers/AdminServer/logs/AdminServer.log
Rotation dir=/home/app/domains/base_domain/servers/AdminServer/logs
is opened. All server side log events will be written to this file.>
<Jan 8, 2016 8:00:53 AM CET> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm>
<Jan 8, 2016 8:00:56 AM CET> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm>
<Jan 8, 2016 8:00:57 AM CET> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm>
<Jan 8, 2016 8:01:05 AM CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<Jan 8, 2016 8:01:05 AM CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<Jan 8, 2016 8:01:05 AM CET> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.>
<Jan 8, 2016 8:01:05 AM CET> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.>
<Jan 8, 2016 8:01:06 AM CET> <Warning> <Server> <BEA-002611> <The hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 192.168.0.102:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 192.168.122.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in development mode.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 192.168.0.102:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 192.168.122.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<Jan 8, 2016 8:01:06 AM CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.>

Using Maven on Weblogic 12.2.1 with Java EE7

$
0
0
Release notes Weblogic 12.2.1
/whatsnew.htm#NOTES107

The weblogic-maven-plugin plug-in delivered in WebLogic Server 11g Release 1 is deprecated as of release 12.1.2. Oracle recommends that you instead use the WebLogic Server Maven plug-in introduced in version 12.1.2. See "Using the WebLogic Development Maven Plug-in" in Developing Applications for Oracle WebLogic Server for complete documentation.


Configuring the WebLogic Maven Plug-In

Change directory to Maven plugin in WLS12.2.1 installation 
Install the Oracle Maven sync plug-in


[dave@localhost weblogic-12.2.1]$ find . -name   oracle*maven-*.jar
./oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.2.1/oracle-maven-sync-12.2.1.jar
[dave@localhost weblogic-12.2.1]$ cd ./oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.2.1
[dave@localhost 12.2.1]$ mvn install:install-file -DpomFile=oracle-maven-sync-12.2.1.pom -Dfile=oracle-maven-sync-12.2.1.jar


Install Oracle Maven jars into local repository


mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=/app/weblogic-12.2.1/

Validate Maven artifact are properly installed
mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=12.2.1-0-0

Name: weblogic-maven-plugin
Description: The Oracle WebLogic Server 12.2.1 Maven plugin
Group Id: com.oracle.weblogic
Artifact Id: weblogic-maven-plugin
Version: 12.2.1-0-0
Goal Prefix: weblogic

This plugin has 23 goals:

weblogic:appc
  Description: This goal is a wrapper for the weblogic.appc compiler.

weblogic:create-domain
  Description: Create a domain for WebLogic Server using the default domain
    template. For more complex domain creation use the WLST goal. Note:
    Starting in WLS 12.2.1, there is a single unified version of WLST that
    automatically includes the WLST environment from all products in the
    ORACLE_HOME.

weblogic:deploy
  Description: Deploys an application to WebLogic Server (supports all
    formats WAR, JAR, RAR, EAR, etc.)

weblogic:distribute-app
  Description: Prepares deployment files for deployment by copying deployment
    files to target servers and validating them.

weblogic:install
  Description: Installs WebLogic Server

weblogic:list-apps
  Description: Lists the deployment names for applications and stand-alone
    modules deployed distributed, or installed to the domain

weblogic:purge-tasks
  Description: Flushes out retired deployment tasks

weblogic:redeploy
  Description: Redeploys a running application or part of a running
    application

weblogic:remove-domain
  Description: This class provides basic capabilities to remove a domain
    directory.

weblogic:start-app
  Description: Starts an application

weblogic:start-server
  Description: Starts WebLogic Server.

weblogic:stop-app
  Description: Stops an application

weblogic:stop-server
  Description: This goals run a stop script to stop WebLogic Server.

weblogic:undeploy
  Description: Stops the deployment unit and removes staged files from target
    servers

weblogic:uninstall
  Description: Uninstalls WebLogic Server

weblogic:update-app
  Description: Updates an application's deployment plan by redistributing the
    plan files and reconfiguring the application based on the new plan
    contents.

weblogic:wlst
  Description: This goal is a wrapper for the WLST scripting tool.
    Note: Starting in WLS 12.2.1, there is a single unified version of WLST
    that automatically includes the WLST environment from all products in the
    ORACLE_HOME.

weblogic:wlst-client
  Description: WLST wrapper for Maven that does not require a server install
    for WLST online commands.

weblogic:ws-clientgen
  Description: A Maven goal to generate client web service artifacts from a
    WSDL Note the differences between clientgen Ant task and Maven goal:
    clientgen goal only generates JAXWS web service artifacts, while Ant task
    has JAXRPC as the default. At the moment there is no way to direct
    clientgen goal to also compile and package generated artifacts.
  Deprecated. No reason given

weblogic:ws-jwsc
  Description: This goal builds a JAX-WS web service, generates source code,
    data binding artifacts, deployment descriptors, and so on into an output
    directory.
  Deprecated. No reason given

weblogic:ws-wsdlc
  Description: This goal generates, from an existing WSDL file, a set of
    artifacts that together provide a partial Java implementation of the Web
    Service described by the WSDL file.
  Deprecated. No reason given

weblogic:wsgen
  Description: Reads a JAX-WS service endpoint implementation class and
    generates all of the portable artifacts for a JAX-WS web service.

weblogic:wsimport
  Description: Parses wsdl and binding files and generates Java code needed
    to access it.

For more information, run 'mvn help:describe [...] -Ddetail'

Building Java EE Projects for WebLogic Server with Maven



 Create app from Maven archetype
[dave@localhost weblogic]$ mvn archetype:generate -DarchetypeGroupId=com.oracle.weblogic.archetype -DarchetypeArtifactId=basic-webapp -DarchetypeVersion=12.2.1-0-0 -DgroupId=dave -DartifactId=dave-basic-webapp-project -Dversion=1.0-SNAPSHOT

[INFO] Using property: groupId = dave
[INFO] Using property: artifactId = dave-basic-webapp-project
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = dave
Confirm properties configuration:
groupId: dave
artifactId: dave-basic-webapp-project
version: 1.0-SNAPSHOT
package: dave
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: basic-webapp:12.2.1-0-0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-basic-webapp-project
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: dave
[INFO] Parameter: packageInPathFormat, Value: dave
[INFO] Parameter: package, Value: dave
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-basic-webapp-project
[INFO] project created from Archetype in dir: /home/dave/git/weblogic/dave-basic-webapp-project
[dave@localhost weblogic]$ find
.
./dave-basic-webapp-project
./dave-basic-webapp-project/pom.xml
./dave-basic-webapp-project/src
./dave-basic-webapp-project/src/main
./dave-basic-webapp-project/src/main/webapp
./dave-basic-webapp-project/src/main/webapp/css
./dave-basic-webapp-project/src/main/webapp/css/bootstrap.css
./dave-basic-webapp-project/src/main/webapp/index.xhtml
./dave-basic-webapp-project/src/main/webapp/WEB-INF
./dave-basic-webapp-project/src/main/webapp/WEB-INF/web.xml
./dave-basic-webapp-project/src/main/webapp/WEB-INF/beans.xml
./dave-basic-webapp-project/src/main/webapp/template.xhtml
./dave-basic-webapp-project/src/main/java
./dave-basic-webapp-project/src/main/java/dave
./dave-basic-webapp-project/src/main/java/dave/AccountBean.java


 Main pom.xml
[dave@localhost dave-basic-webapp-project]$ more pom.xml 
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>dave</groupId>
  <artifactId>dave-basic-webapp-project</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>basicWebapp</name>
[dave@localhost dave-basic-webapp-project]$ more pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>dave</groupId>
  <artifactId>dave-basic-webapp-project</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>basicWebapp</name>
 
  <parent>
    <groupId>com.oracle.weblogic.archetype</groupId>
    <artifactId>wls-common</artifactId>
    <version>12.2.1-0-0</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-web-api</artifactId>
      <version>6.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>basicWebapp</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <version>12.2.1-0-0</version>
        <!--
        You can find and redefine the following variables in the parent pom file arccording to your environment.
 
        oracleMiddlewareHome
        oracleServerUrl
        oracleUsername
        oraclePassword
        oracleServerName
        -->
        <configuration>
          <middlewareHome>${oracleMiddlewareHome}</middlewareHome>
        </configuration>
        <executions>
          <!--Deploy the application to the server-->
          <execution>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
            <configuration>
              <!--The admin URL where the app is deployed. Here use the plugin's default value t3://localhost:7001-->
              <!--adminurl>${oracleServerUrl}</adminurl-->
              <user>${oracleUsername}</user>
              <password>${oraclePassword}</password>
              <!--The location of the file or directory to be deployed-->
              <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
              <!--The target servers where the application is deployed. Here use the plugin's default value AdminServer-->
              <!--targets>${oracleServerName}</targets-->
              <verbose>true</verbose>
              <name>${project.build.finalName}</name>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>



mvn compile

mvn package



mvn package


INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webapp-project] in [/home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/dave/git/weblogic/dave-basic-webapp-project/src/main/webapp]
[INFO] Webapp assembled in [69 msecs]
[INFO] Building war: /home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp.war
[INFO] WEB-INF/web.xml already added, skipping




Edit  in pom.xml ( or settings.xml ) weblogic username and password to be able to deploy
ERROR] Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.2.1-0-0:deploy (default) on project dave-basic-webapp-project: org.apache.maven.plugin.MojoExecutionException: user/password or userConfigFile/userKeyFile must be specified

To deploy the deployment archive using Maven, use the following command:

mvn pre-integration-test


[INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webapp-project] in [/home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/dave/git/weblogic/dave-basic-webapp-project/src/main/webapp]
[INFO] Webapp assembled in [31 msecs]
[INFO] Building war: /home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:deploy (default) @ dave-basic-webapp-project ---
[INFO] Command flags are: -noexit -deploy -username weblogic -password ******* -name basicWebapp -source /home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp.war -verbose -adminurl t3://localhost:7001
weblogic.Deployer invoked with options:  -noexit -deploy -username weblogic -name basicWebapp -source /home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp.war -verbose -adminurl t3://localhost:7001
<Jan 17, 2016 12:52:54 PM CET> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, basicWebapp [archive: /home/dave/git/weblogic/dave-basic-webapp-project/target/basicWebapp.war], to configured targets.>
Task 0 initiated: [Deployer:149026]deploy application basicWebapp on AdminServer.
Task 0 completed: [Deployer:149026]deploy application basicWebapp on AdminServer.
Target state: deploy completed on Server AdminServer


Start Weblogic console http://localhost:7001/console

Check the the WebApp Context Root: in Deployments

Start application in the browser using http://localhost:7001/basicWebapp/


If you Maven repository issues add artifacts into local Maven repository - see the HOWTO here for details http://middlewaremagic.com/weblogic/?p=8294

[dave@localhost 12.2.1]$ export M2_REPO=/home/dave/.m2/repository
[dave@localhost 12.2.1]$ mvn deploy:deploy-file -DpomFile=oracle-maven-sync-12.2.1.pom -Dfile=oracle-maven-sync-12.2.1.jar -Durl=file://${M2_REPO}

dave@localhost 12.2.1]$ mvn com.oracle.maven:oracle-maven-sync:12.2.1-0-0:push -Doracle-maven-sync.oracleHome=$MW_HOME -DtestingOnly=false

mvn archetype:crawl -Dcatalog=$HOME/.m2/archetype-catalog.xml




Using Maven to create EJB project on Weblogic 12.2.1

$
0
0
First setup Maven for Oracle Weblogic plugin - http://danielveselka.blogspot.com/2016/01/using-maven-on-weblogic-1221-with-java.html 

Building Java EE Projects for WebLogic Server with Maven

http://docs.oracle.com/middleware/1221/core/MAVEN/weblogic_maven.htm#MAVEN8803

Create project from archetype
[dave@localhost weblogic]$ mvn archetype:generate -DarchetypeGroupId=com.oracle.weblogic.archetype -DarchetypeArtifactId=basic-webapp-ejb -DarchetypeVersion=12.2.1-0-0 -DgroupId=dave -DartifactId=dave-basic-webapp-ejb-project -Dversion=1.0-SNAPSHOT



[INFO] Generating project in Interactive mode
[INFO] Archetype repository missing. Using the one from [com.oracle.weblogic.archetype:basic-webapp-ejb:12.2.1-0-0] found in catalog local
[INFO] Using property: groupId = dave
[INFO] Using property: artifactId = dave-basic-webapp-ejb-project
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = dave
Confirm properties configuration:
groupId: dave
artifactId: dave-basic-webapp-ejb-project
version: 1.0-SNAPSHOT
package: dave
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: basic-webapp-ejb:12.2.1-0-0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-basic-webapp-ejb-project
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: dave
[INFO] Parameter: packageInPathFormat, Value: dave
[INFO] Parameter: package, Value: dave
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-basic-webapp-ejb-project
[INFO] project created from Archetype in dir: /home/dave/git/weblogic/dave-basic-webapp-ejb-project



[dave@localhost weblogic]$ find
.
./dave-basic-webapp-ejb-project
./dave-basic-webapp-ejb-project/pom.xml
./dave-basic-webapp-ejb-project/src
./dave-basic-webapp-ejb-project/src/main
./dave-basic-webapp-ejb-project/src/main/webapp
./dave-basic-webapp-ejb-project/src/main/webapp/css
./dave-basic-webapp-ejb-project/src/main/webapp/css/bootstrap.css
./dave-basic-webapp-ejb-project/src/main/webapp/index.xhtml
./dave-basic-webapp-ejb-project/src/main/webapp/WEB-INF
./dave-basic-webapp-ejb-project/src/main/webapp/WEB-INF/web.xml
./dave-basic-webapp-ejb-project/src/main/webapp/WEB-INF/beans.xml
./dave-basic-webapp-ejb-project/src/main/webapp/template.xhtml
./dave-basic-webapp-ejb-project/src/main/resources
./dave-basic-webapp-ejb-project/src/main/resources/META-INF
./dave-basic-webapp-ejb-project/src/main/resources/META-INF/persistence.xml
./dave-basic-webapp-ejb-project/src/main/java
./dave-basic-webapp-ejb-project/src/main/java/dave
./dave-basic-webapp-ejb-project/src/main/java/dave/entity
./dave-basic-webapp-ejb-project/src/main/java/dave/entity/Account.java
./dave-basic-webapp-ejb-project/src/main/java/dave/service
./dave-basic-webapp-ejb-project/src/main/java/dave/service/AccountManagerImpl.java
./dave-basic-webapp-ejb-project/src/main/java/dave/service/AccountManager.java
./dave-basic-webapp-ejb-project/src/main/java/dave/service/AccountBean.java
./dave-basic-webapp-ejb-project/src/main/java/dave/interceptor
./dave-basic-webapp-ejb-project/src/main/java/dave/interceptor/OnDeposit.java
./dave-basic-webapp-ejb-project/src/main/java/dave/interceptor/LogInterceptor.java
./dave-basic-webapp-ejb-project/src/main/scripts
./dave-basic-webapp-project
./dave-basic-webapp-project/pom.xml
./dave-basic-webapp-project/src
./dave-basic-webapp-project/src/main
./dave-basic-webapp-project/src/main/webapp
./dave-basic-webapp-project/src/main/webapp/css
./dave-basic-webapp-project/src/main/webapp/css/bootstrap.css
./dave-basic-webapp-project/src/main/webapp/index.xhtml
./dave-basic-webapp-project/src/main/webapp/WEB-INF
./dave-basic-webapp-project/src/main/webapp/WEB-INF/web.xml
./dave-basic-webapp-project/src/main/webapp/WEB-INF/beans.xml
./dave-basic-webapp-project/src/main/webapp/template.xhtml
./dave-basic-webapp-project/src/main/java
./dave-basic-webapp-project/src/main/java/dave
./dave-basic-webapp-project/src/main/java/dave/AccountBean.java



Start Weblogic console using http://localhost:7001/console/

Check what is the Context Root in Deployments section:  /basicWebappEjb

Connect to application using http://localhost:7001/basicWebappEjb/

Create Java EE7 project from JBoss Wildfly Maven archetype

$
0
0
JBoss Wildfly Maven plugin
https://docs.jboss.org/wildfly/plugins/maven/latest/index.html 

http://mvnrepository.com/artifact/org.wildfly.archetype/wildfly-javaee7-webapp-ear-archetype/8.2.0.Final

First try with Adam Bien's Minimalistic pom.xml
http://www.adam-bien.com/roller/abien/entry/setting_up_java_ee_7

[dave@localhost wildfly]$ mvn archetype:generate -Dfilter=com.airhacks:javaee7-essentials-archetype


Define value for property 'groupId': : dave
Define value for property 'artifactId': : dave-java-ee7-minimal
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  dave: :
Confirm properties configuration:
groupId: dave
artifactId: dave-java-ee7-minimal
version: 1.0-SNAPSHOT
package: dave
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: javaee7-essentials-archetype:1.3
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-java-ee7-minimal
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: dave
[INFO] Parameter: packageInPathFormat, Value: dave
[INFO] Parameter: package, Value: dave
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-java-ee7-minimal
[INFO] project created from Archetype in dir: /home/dave/git/wildfly/dave-java-ee7-minimal


Files created from Maven  archetype

[dave@localhost wildfly]$ find
.
./dave-java-ee7-minimal
./dave-java-ee7-minimal/pom.xml
./dave-java-ee7-minimal/src
./dave-java-ee7-minimal/src/main
./dave-java-ee7-minimal/src/main/webapp
./dave-java-ee7-minimal/src/main/webapp/WEB-INF
./dave-java-ee7-minimal/src/main/webapp/WEB-INF/beans.xml
./dave-java-ee7-minimal/src/main/resources
./dave-java-ee7-minimal/src/main/java
./dave-java-ee7-minimal/src/main/java/com
./dave-java-ee7-minimal/src/main/java/com/airhacks
./dave-java-ee7-minimal/src/main/java/com/airhacks/JAXRSConfiguration.java


Generated pom.xml


[dave@localhost dave-java-ee7-minimal]$ more pom.xml 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>dave</groupId>
    <artifactId>dave-java-ee7-minimal</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>dave-java-ee7-minimal</finalName>
    </build>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>
</project>


Using Wildfly Maven archetype
https://docs.jboss.org/wildfly/plugins/maven/latest/index.html

[dave@localhost wildfly]$ mvn archetype:generate -Dfilter=wildfly-javaee7-webapp-ear-archetype


1: remote -> org.wildfly.archetype:wildfly-javaee7-webapp-ear-archetype (An archetype that generates a starter Java EE 7 webapp project for JBoss Wildfly. The project is an EAR, with an EJB-JAR and WAR)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :
Choose archetype:
1: remote -> org.wildfly.archetype:wildfly-javaee7-webapp-ear-archetype (An archetype that generates a starter Java EE 7 webapp project for JBoss Wildfly. The project is an EAR, with an EJB-JAR and WAR)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose org.wildfly.archetype:wildfly-javaee7-webapp-ear-archetype version:
1: 8.1.0.Final
2: 8.2.0.Final
Choose a number: 2: 2


Define value for property 'groupId': : dave
Define value for property 'artifactId': : dave-java-ee7-wildfly-full
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  dave: :
Confirm properties configuration:
groupId: dave
artifactId: dave-java-ee7-wildfly-full
version: 1.0-SNAPSHOT
package: dave
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: wildfly-javaee7-webapp-ear-archetype:8.2.0.Final
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-java-ee7-wildfly-full
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: dave
[INFO] Parameter: packageInPathFormat, Value: dave
[INFO] Parameter: package, Value: dave
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: dave
[INFO] Parameter: artifactId, Value: dave-java-ee7-wildfly-full
[INFO] Parent element not overwritten in /home/dave/git/wildfly/dave-java-ee7-wildfly-full/dave-java-ee7-wildfly-full-ejb/pom.xml
[INFO] Parent element not overwritten in /home/dave/git/wildfly/dave-java-ee7-wildfly-full/dave-java-ee7-wildfly-full-web/pom.xml
[WARNING] CP Don't override file /home/dave/git/wildfly/dave-java-ee7-wildfly-full/dave-java-ee7-wildfly-full-web/src/main/webapp/WEB-INF/templates/default.xhtml
[INFO] Parent element not overwritten in /home/dave/git/wildfly/dave-java-ee7-wildfly-full/dave-java-ee7-wildfly-full-ear/pom.xml
[INFO] project created from Archetype in dir: /home/dave/git/wildfly/dave-java-ee7-wildfly-full


[dave@localhost dave-java-ee7-wildfly-full]$ find
.
./pom.xml
./README.md
./dave-java-ee7-wildfly-full-ear
./dave-java-ee7-wildfly-full-ear/pom.xml
./dave-java-ee7-wildfly-full-ear/src
./dave-java-ee7-wildfly-full-ear/src/main
./dave-java-ee7-wildfly-full-ear/src/main/application
./dave-java-ee7-wildfly-full-ear/src/main/application/META-INF
./dave-java-ee7-wildfly-full-ear/src/main/application/META-INF/dave-java-ee7-wildfly-full-ds.xml
./dave-java-ee7-wildfly-full-ejb
./dave-java-ee7-wildfly-full-ejb/pom.xml
./dave-java-ee7-wildfly-full-ejb/src
./dave-java-ee7-wildfly-full-ejb/src/main
./dave-java-ee7-wildfly-full-ejb/src/main/resources
./dave-java-ee7-wildfly-full-ejb/src/main/resources/import.sql
./dave-java-ee7-wildfly-full-ejb/src/main/resources/META-INF
./dave-java-ee7-wildfly-full-ejb/src/main/resources/META-INF/persistence.xml
./dave-java-ee7-wildfly-full-ejb/src/main/resources/META-INF/beans.xml
./dave-java-ee7-wildfly-full-ejb/src/main/java
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/model
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/model/Member.java
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/service
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/service/MemberRegistration.java
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/data
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/data/MemberListProducer.java
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/data/MemberRepository.java
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/util
./dave-java-ee7-wildfly-full-ejb/src/main/java/dave/util/Resources.java
./dave-java-ee7-wildfly-full-ejb/src/test
./dave-java-ee7-wildfly-full-ejb/src/test/resources
./dave-java-ee7-wildfly-full-ejb/src/test/resources/arquillian.xml
./dave-java-ee7-wildfly-full-ejb/src/test/resources/META-INF
./dave-java-ee7-wildfly-full-ejb/src/test/resources/META-INF/test-persistence.xml
./dave-java-ee7-wildfly-full-ejb/src/test/resources/test-ds.xml
./dave-java-ee7-wildfly-full-ejb/src/test/java
./dave-java-ee7-wildfly-full-ejb/src/test/java/dave
./dave-java-ee7-wildfly-full-ejb/src/test/java/dave/test
./dave-java-ee7-wildfly-full-ejb/src/test/java/dave/test/MemberRegistrationTest.java
./dave-java-ee7-wildfly-full-web
./dave-java-ee7-wildfly-full-web/pom.xml
./dave-java-ee7-wildfly-full-web/src
./dave-java-ee7-wildfly-full-web/src/main
./dave-java-ee7-wildfly-full-web/src/main/webapp
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/css
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/css/screen.css
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/gfx
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/gfx/asidebkg.png
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/gfx/dualbrand_logo.png
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/gfx/bkg-blkheader.png
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/gfx/wildfly_400x130.jpg
./dave-java-ee7-wildfly-full-web/src/main/webapp/resources/gfx/headerbkg.png
./dave-java-ee7-wildfly-full-web/src/main/webapp/index.xhtml
./dave-java-ee7-wildfly-full-web/src/main/webapp/index.html
./dave-java-ee7-wildfly-full-web/src/main/webapp/WEB-INF
./dave-java-ee7-wildfly-full-web/src/main/webapp/WEB-INF/templates
./dave-java-ee7-wildfly-full-web/src/main/webapp/WEB-INF/templates/default.xhtml
./dave-java-ee7-wildfly-full-web/src/main/webapp/WEB-INF/faces-config.xml
./dave-java-ee7-wildfly-full-web/src/main/webapp/WEB-INF/beans.xml
./dave-java-ee7-wildfly-full-web/src/main/java
./dave-java-ee7-wildfly-full-web/src/main/java/dave
./dave-java-ee7-wildfly-full-web/src/main/java/dave/controller
./dave-java-ee7-wildfly-full-web/src/main/java/dave/controller/MemberController.java
./dave-java-ee7-wildfly-full-web/src/main/java/dave/util
./dave-java-ee7-wildfly-full-web/src/main/java/dave/util/WebResources.java
./dave-java-ee7-wildfly-full-web/src/main/java/dave/rest
./dave-java-ee7-wildfly-full-web/src/main/java/dave/rest/MemberResourceRESTService.java
./dave-java-ee7-wildfly-full-web/src/main/java/dave/rest/JaxRsActivator.java
./dave-java-ee7-wildfly-full-web/src/test
./dave-java-ee7-wildfly-full-web/src/test/java


Generated pom.xml
[dave@localhost dave-java-ee7-wildfly-full]$ more pom.xml 
<?xml version="1.0" encoding="UTF-8"?>
<!--
    JBoss, Home of Professional Open Source
    Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <name>dave-java-ee7-wildfly-full</name>
    <modelVersion>4.0.0</modelVersion>
    <groupId>dave</groupId>
    <artifactId>dave-java-ee7-wildfly-full</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <url>http://wildfly.org</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <distribution>repo</distribution>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>
    <modules>
        <module>dave-java-ee7-wildfly-full-ejb</module>
        <module>dave-java-ee7-wildfly-full-web</module>
        <module>dave-java-ee7-wildfly-full-ear</module>
    </modules>

    <properties>
        <!-- Explicitly declaring the source encoding eliminates the following
            message: -->
        <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
            resources, i.e. build is platform dependent! -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- JBoss dependency versions -->
       
        <version.wildfly.maven.plugin>1.0.2.Final</version.wildfly.maven.plugin>

        <!-- Define the version of the JBoss BOMs we want to import to specify tested stacks. -->
        <version.jboss.bom>8.2.1.Final</version.jboss.bom>
        <version.wildfly>9.0.0.Alpha1</version.wildfly>


        <!-- other plugin versions -->
        <version.compiler.plugin>3.1</version.compiler.plugin>
        <version.ear.plugin>2.10</version.ear.plugin>
        <version.ejb.plugin>2.3</version.ejb.plugin>
        <version.surefire.plugin>2.16</version.surefire.plugin>
        <version.war.plugin>2.5</version.war.plugin>

        <!-- maven-compiler-plugin -->
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>
    </properties>

    <dependencyManagement>
        <dependencies>

            <!-- Define the version of the EJB jar so that we don't need
                to repeat ourselves in every module -->
            <dependency>
                <groupId>dave</groupId>
                <artifactId>dave-java-ee7-wildfly-full-ejb</artifactId>
                <version>${project.version}</version>
                <type>ejb</type>
            </dependency>
           
            <!-- Define the version of the WAR so that we don't need to repeat
                ourselves in every module -->
            <dependency>
                <groupId>dave</groupId>
                <artifactId>dave-java-ee7-wildfly-full-web</artifactId>
                <version>${project.version}</version>
                <type>war</type>
                <scope>compile</scope>
            </dependency>

            <!-- JBoss distributes a complete set of Java EE 7 APIs including
                a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or
                a collection) of artifacts. We use this here so that we always get the correct
                versions of artifacts. Here we use the jboss-javaee-7.0-with-tools stack
                (you can read this as the JBoss stack of the Java EE 7 APIs, with some extras
                tools for your project, such as Arquillian for testing) and the jboss-javaee-7.0-with-hibernate
                stack you can read this as the JBoss stack of the Java EE 7 APIs, with extras
                from the Hibernate family of projects) -->
            <dependency>
                <groupId>org.wildfly.bom</groupId>
                <artifactId>jboss-javaee-7.0-with-tools</artifactId>
                <version>${version.jboss.bom}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.wildfly.bom</groupId>
                <artifactId>jboss-javaee-7.0-with-hibernate</artifactId>
                <version>${version.jboss.bom}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!-- The WildFly plugin deploys your ear to a local JBoss
                    AS container -->
                <!-- Due to Maven's lack of intelligence with EARs we need
                    to configure the wildfly maven plugin to skip deployment for all modules.
                    We then enable it specifically in the ear module. -->
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>${version.wildfly.maven.plugin}</version>
                    <inherited>true</inherited>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>


Download latest Wildfly AS here http://wildfly.org/downloads/

Deploy application to Wildfly using wildfly:deploy

mvn clean package wildfly:deploy


Access application using URL http://localhost:8080/dave-java-ee7-wildfly-full-web.


Openshift - deploy Java EE7 application onto Wildlfy10

$
0
0
OpenShift  Wildfly  https://developers.openshift.com/en/wildfly-getting-started.html

 Create OpenShift account https://openshift.redhat.com/app/account/new?then=%2Fapp%2Faccount

Install RedHat RHC  client tools  https://developers.openshift.com/en/managing-client-tools.html


sudo yum install rubygems
rhc setup

Create application via web console or using RHC tools

Write down admin password to access cloud via SSH

Open application URL in browser http://ee7full-testjavaee.rhcloud.com/




[dave@localhost ee7full.git]$ rhc apps
ee7full @ http://ee7full-testjavaee.rhcloud.com/ (uuid: 56d97e36454545636454540026f)
---------------------------------------------------------------------------------
  Domain:          testjavaee
  Created:         Mar 04  1:23 PM
  Gears:           1 (defaults to small)
  Git URL:         ssh://5645454545367a00026f@ee7full-testjavaee.rhcloud.com/~/git/ee7full.git/
  Initial Git URL: https://github.com/dveselka/wildfly/#master
  SSH:             5645454545367a00026f@ee7full-testjavaee.rhcloud.com
  Deployment:      auto (on git push)

  jboss-wildfly-10 (WildFly Application Server 10)
  ------------------------------------------------
    From:    https://raw.github.com/openshift-cartridges/openshift-wildfly-cartridge/wildfly-10/metadata/manifest.yml
    Website: http://www.wildfly.org
    Gears:   1 small

You have access to 1 application.
[dave@localhost ee7full.git]$


Initial source code is taken from existing GitHub code https://github.com/dveselka/wildfly


Clone Git Repository

git clone ssh://56d93434343445456f@ee7full-testjavaee.rhcloud.com/~/git/ee7full.git/


Forward ports to local host https://developers.openshift.com/en/managing-port-forwarding.html

[dave@localhost openshift]$ rhc port-forward -a ee7full
Checking available ports ... done
Forwarding ports ...

To connect to a service running on OpenShift, use the Local address

Service Local               OpenShift
------- -------------- ---- -----------------
java    127.0.0.1:3528  =>  127.5.77.129:3528
java    127.0.0.1:3529  =>  127.5.77.129:3529
java    127.0.0.1:8080  =>  127.5.37.129:8080
java    127.0.0.1:9990  =>  127.5.77.129:9990

Press CTRL-C to terminate port forwarding



Deploy application using Maven deploy plugin

dave@localhost dave-java-ee7-wildfly-full]$ pwd
/home/dave/openshift/ee7full.git/dave-java-ee7-wildfly-full
[dave@localhost dave-java-ee7-wildfly-full]$ mvn clean package wildfly:deploy


[INFO] --- wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) @ dave-java-ee7-wildfly-full-ear ---
Mar 08, 2016 7:49:14 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.2.Final
Mar 08, 2016 7:49:14 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final
Mar 08, 2016 7:49:14 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.3.Final
Authenticating against security realm: ManagementRealm
Username:


Check application server logs

2016-03-08 01:52:43,915 INFO  [org.jboss.as.repository] (management-handler-thread - 5) WFLYDR0001: Content added at location /var/lib/openshift/56d9454545450026f/wildfly/standalone/data/content/62/75d7af5656565656573/content
2016-03-08 01:52:43,934 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "dave-java-ee7-wildfly-full-ear.ear" (runtime-name: "dave-java-ee7-wildfly-full-ear.ear")
2016-03-08 01:52:44,090 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0207: Starting subdeployment (runtime-name: "dave-java-ee7-wildfly-full-ejb.jar")
2016-03-08 01:52:44,091 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "dave-java-ee7-wildfly-full-web.war")
2



Access application via browser using public URL  http://ee7full-testjavaee.rhcloud.com/dave-java-ee7-wildfly-full-web/




Scala - setup environment - sbt, Scala IDE

$
0
0
Download sbt http://www.scala-sbt.org/download.html


Configure https proxy
 export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=webproxy -Dhttp.proxyPort=8080"  


Change sbt repository root
 export _JAVA_OPTIONS='-Duser.home=/d/vesedan/sbt-repository'  


Start sbt
 $ sbt  
 Getting org.scala-sbt sbt 0.13.11 ... 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.11/jars/sbt.jar ... 
     [SUCCESSFUL ] org.scala-sbt#sbt;0.13.11!sbt.jar (2209ms) 
 downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.6/scala-library-2.10.6.jar ... 
     [SUCCESSFUL ] org.scala-lang#scala-library;2.10.6!scala-library.jar (36565ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.11/jars/main.jar ... 
     [SUCCESSFUL ] org.scala-sbt#main;0.13.11!main.jar (14438ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.11/jars/compiler-interface.jar ... 
     [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.11!compiler-interface.jar (3732ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.11/jars/actions.jar ... 
     [SUCCESSFUL ] org.scala-sbt#actions;0.13.11!actions.jar (4983ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.11/jars/main-settings.jar ... 
     [SUCCESSFUL ] org.scala-sbt#main-settings;0.13.11!main-settings.jar (189535ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/interface/0.13.11/jars/interface.jar ... 
     [SUCCESSFUL ] org.scala-sbt#interface;0.13.11!interface.jar (2385ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.11/jars/io.jar ... 
     [SUCCESSFUL ] org.scala-sbt#io;0.13.11!io.jar (3836ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.11/jars/ivy.jar ... 
     [SUCCESSFUL ] org.scala-sbt#ivy;0.13.11!ivy.jar (10631ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logging/0.13.11/jars/logging.jar ... 
     [SUCCESSFUL ] org.scala-sbt#logging;0.13.11!logging.jar (2493ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logic/0.13.11/jars/logic.jar ... 
     [SUCCESSFUL ] org.scala-sbt#logic;0.13.11!logic.jar (2893ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/process/0.13.11/jars/process.jar ... 
     [SUCCESSFUL ] org.scala-sbt#process;0.13.11!process.jar (3226ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/run/0.13.11/jars/run.jar ... 
     [SUCCESSFUL ] org.scala-sbt#run;0.13.11!run.jar (4793ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.13.11/jars/command.jar ... 
     [SUCCESSFUL ] org.scala-sbt#command;0.13.11!command.jar (3569ms) 
 downloading https://repo1.maven.org/maven2/org/scala-sbt/launcher-interface/1.0.0-M1/launcher-interface-1.0.0-M1.jar ... 
     [SUCCESSFUL ] org.scala-sbt#launcher-interface;1.0.0-M1!launcher-interface.jar (265ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classpath/0.13.11/jars/classpath.jar ... 
     [SUCCESSFUL ] org.scala-sbt#classpath;0.13.11!classpath.jar (2508ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.13.11/jars/completion.jar ... 
     [SUCCESSFUL ] org.scala-sbt#completion;0.13.11!completion.jar (4228ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/api/0.13.11/jars/api.jar ... 
     [SUCCESSFUL ] org.scala-sbt#api;0.13.11!api.jar (6932ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-integration/0.13.11/jars/compiler-integration.jar ... 
     [SUCCESSFUL ] org.scala-sbt#compiler-integration;0.13.11!compiler-integration.jar (2715ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-ivy-integration/0.13.11/jars/compiler-ivy-integration.jar ... 
     [SUCCESSFUL ] org.scala-sbt#compiler-ivy-integration;0.13.11!compiler-ivy-integration.jar (2659ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/relation/0.13.11/jars/relation.jar ... 
     [SUCCESSFUL ] org.scala-sbt#relation;0.13.11!relation.jar (2618ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/task-system/0.13.11/jars/task-system.jar ... 
     [SUCCESSFUL ] org.scala-sbt#task-system;0.13.11!task-system.jar (2604ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tasks/0.13.11/jars/tasks.jar ... 
     [SUCCESSFUL ] org.scala-sbt#tasks;0.13.11!tasks.jar (3010ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tracking/0.13.11/jars/tracking.jar ... 
     [SUCCESSFUL ] org.scala-sbt#tracking;0.13.11!tracking.jar (2193ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/testing/0.13.11/jars/testing.jar ... 
     [SUCCESSFUL ] org.scala-sbt#testing;0.13.11!testing.jar (3076ms) 
 downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.6/scala-compiler-2.10.6.jar ... 
     [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.6!scala-compiler.jar (100258ms) 
 downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.6/scala-reflect-2.10.6.jar ... 
     [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.6!scala-reflect.jar (10966ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/control/0.13.11/jars/control.jar ... 
     [SUCCESSFUL ] org.scala-sbt#control;0.13.11!control.jar (2203ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.13.11/jars/collections.jar ... 
     [SUCCESSFUL ] org.scala-sbt#collections;0.13.11!collections.jar (4384ms) 
 downloading https://repo1.maven.org/maven2/jline/jline/2.13/jline-2.13.jar ... 
     [SUCCESSFUL ] jline#jline;2.13!jline.jar (1690ms) 
 downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar ... 
     [SUCCESSFUL ] org.fusesource.jansi#jansi;1.11!jansi.jar (1058ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classfile/0.13.11/jars/classfile.jar ... 
     [SUCCESSFUL ] org.scala-sbt#classfile;0.13.11!classfile.jar (2419ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.11/jars/incremental-compiler.jar ... 
     [SUCCESSFUL ] org.scala-sbt#incremental-compiler;0.13.11!incremental-compiler.jar (4280ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compile/0.13.11/jars/compile.jar ... 
     [SUCCESSFUL ] org.scala-sbt#compile;0.13.11!compile.jar (3685ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/persist/0.13.11/jars/persist.jar ... 
     [SUCCESSFUL ] org.scala-sbt#persist;0.13.11!persist.jar (2781ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbinary/sbinary_2.10/0.4.2/jars/sbinary_2.10.jar ... 
     [SUCCESSFUL ] org.scala-tools.sbinary#sbinary_2.10;0.4.2!sbinary_2.10.jar (2939ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cross/0.13.11/jars/cross.jar ... 
     [SUCCESSFUL ] org.scala-sbt#cross;0.13.11!cross.jar (2050ms) 
 downloading https://repo1.maven.org/maven2/org/scala-sbt/ivy/ivy/2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a/ivy-2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a.jar ... 
     [SUCCESSFUL ] org.scala-sbt.ivy#ivy;2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a!ivy.jar (5077ms) 
 downloading https://repo1.maven.org/maven2/com/jcraft/jsch/0.1.46/jsch-0.1.46.jar ... 
     [SUCCESSFUL ] com.jcraft#jsch;0.1.46!jsch.jar (1399ms) 
 downloading https://repo1.maven.org/maven2/org/scala-sbt/serialization_2.10/0.1.2/serialization_2.10-0.1.2.jar ... 
     [SUCCESSFUL ] org.scala-sbt#serialization_2.10;0.1.2!serialization_2.10.jar (2002ms) 
 downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-pickling_2.10/0.10.1/scala-pickling_2.10-0.10.1.jar ... 
     [SUCCESSFUL ] org.scala-lang.modules#scala-pickling_2.10;0.10.1!scala-pickling_2.10.jar (2997ms) 
 downloading https://repo1.maven.org/maven2/org/json4s/json4s-core_2.10/3.2.10/json4s-core_2.10-3.2.10.jar ... 
     [SUCCESSFUL ] org.json4s#json4s-core_2.10;3.2.10!json4s-core_2.10.jar (2953ms) 
 downloading https://repo1.maven.org/maven2/org/spire-math/jawn-parser_2.10/0.6.0/jawn-parser_2.10-0.6.0.jar ... 
     [SUCCESSFUL ] org.spire-math#jawn-parser_2.10;0.6.0!jawn-parser_2.10.jar (699ms) 
 downloading https://repo1.maven.org/maven2/org/spire-math/json4s-support_2.10/0.6.0/json4s-support_2.10-0.6.0.jar ... 
     [SUCCESSFUL ] org.spire-math#json4s-support_2.10;0.6.0!json4s-support_2.10.jar (122ms) 
 downloading https://repo1.maven.org/maven2/org/scalamacros/quasiquotes_2.10/2.0.1/quasiquotes_2.10-2.0.1.jar ... 
     [SUCCESSFUL ] org.scalamacros#quasiquotes_2.10;2.0.1!quasiquotes_2.10.jar (2490ms) 
 downloading https://repo1.maven.org/maven2/org/json4s/json4s-ast_2.10/3.2.10/json4s-ast_2.10-3.2.10.jar ... 
     [SUCCESSFUL ] org.json4s#json4s-ast_2.10;3.2.10!json4s-ast_2.10.jar (774ms) 
 downloading https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.6/paranamer-2.6.jar ... 
     [SUCCESSFUL ] com.thoughtworks.paranamer#paranamer;2.6!paranamer.jar (764ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cache/0.13.11/jars/cache.jar ... 
     [SUCCESSFUL ] org.scala-sbt#cache;0.13.11!cache.jar (2837ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/test-agent/0.13.11/jars/test-agent.jar ... 
     [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.11!test-agent.jar (2668ms) 
 downloading https://repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar ... 
     [SUCCESSFUL ] org.scala-sbt#test-interface;1.0!test-interface.jar (634ms) 
 downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/apply-macro/0.13.11/jars/apply-macro.jar ... 
     [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.11!apply-macro.jar (2501ms) 
 :: retrieving :: org.scala-sbt#boot-app 
     confs: [default] 
     49 artifacts copied, 0 already retrieved (17330kB/137ms) 
 Getting Scala 2.10.6 (for sbt)... 
 downloading https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.6/jline-2.10.6.jar ... 
     [SUCCESSFUL ] org.scala-lang#jline;2.10.6!jline.jar (1016ms) 
 downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ... 
     [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (1034ms) 
 :: retrieving :: org.scala-sbt#boot-scala 
     confs: [default] 
     5 artifacts copied, 0 already retrieved (24494kB/62ms) 
 [info] Set current project to sbt (in build file:/D:/vesedan/sbt/) 


Start Scala console
> console  
 [info] Updating {file:/D:/vesedan/sbt/}sbt... 
 [info] Resolving org.fusesource.jansi#jansi;1.4 ... 
 [info] Done updating. 
 [info] 'compiler-interface' not yet compiled for Scala 2.10.6. Compiling... 
 [info]  Compilation completed in 16.541 s 
 [info] Starting scala interpreter... 
 [info] 
 Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_74). 
 Type in expressions to have them evaluated. 
 Type :help for more information. 
 scala> 
 scala> 
 scala> println("Hi!") 
 Hi!
 scala> 

Download  Scala IDE
 http://scala-ide.org/download/sdk.html

Deploy Java application from GitHub to AWS

$
0
0
Create AWS free account

Getting started :
https://aws.amazon.com/free/

Create AWS account




Create own Linux instance
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html


Connect to AWS Linux instance via ssh

[dave@localhost aws]$ chmod 400 dave_amazon.pem
[dave@localhost aws]$ ssh -i "dave_amazon.pem" ec2-user@ec2-11-123-765-44.us-west-2.compute.amazonaws.com


       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2016.03-release-notes/
8 package(s) needed for security, out of 17 available
Run "sudo yum update" to apply all updates.


Install AWS tools on Fedora

https://fedoramagazine.org/aws-tools-fedora/

[root@localhost ~]# dnf install  awscli
Dependencies resolved.
=================================================================================================
 Package                  Arch         Version                               Repository     Size
=================================================================================================
Installing:
 awscli                   noarch       1.10.45-1.fc23                        updates       868 k
 python3-botocore         noarch       1.4.35-1.fc23                         updates       1.8 M
 python3-colorama         noarch       0.3.2-2.fc23                          fedora         29 k
 python3-docutils         noarch       0.12-0.3.20140510svn7747.fc23         fedora        1.5 M
 python3-jmespath         noarch       0.9.0-1.fc23                          updates        43 k
 python3-pyasn1           noarch       0.1.8-1.fc23                          fedora        108 k
 python3-rsa              noarch       3.4.1-1.fc23                          updates        72 k
 python3-s3transfer       noarch       0.0.1-2.fc23                          updates        29 k

Transaction Summary
=================================================================================================
Install  8 Packages

Total download size: 4.5 M
Installed size: 27 M
Is this ok [y/N]:
Paste your text here.

  

[dave@localhost aws]$ aws --version
aws-cli/1.10.45 Python/3.4.3 Linux/4.5.7-200.fc23.x86_64 botocore/1.4.35

 Add AWS IAM access keys

[dave@localhost aws]$ aws configure

Check running instances 

[dave@localhost aws]$ aws ec2 describe-instances 
{
    "Reservations": [
        {
            "Instances": [
                {
                    "PublicDnsName":

Integrating AWS CodeDeploy with GitHub

https://docs.aws.amazon.com/codedeploy/latest/userguide/github-integ.html


Setup roles in IAM
https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-setup.html



Amazon AWS Java samples
https://github.com/aws/aws-sdk-java/tree/master/src/samples



Create GitHub repository with sample application
https://github.com/dveselka/aws-java-sample

User guide GitHub - AWS integration
https://docs.aws.amazon.com/codedeploy/latest/userguide/github-integ-tutorial.html 

Create application - see tutorial page
  Step 5: Deploy the Application to the Instance


Connect with GitHub


Deploy AWS sample Linux
https://github.com/dveselka/aws-sample-linux


Check AWS CodeDeploy console

Deploy fails with HEALTH_CONSTRAINTS

It is necessary to install CodeDeploy on instance
Follow this tutorial :

Install or reinstall the AWS CodeDeploy agent for Amazon Linux or RHEL

https://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent-install.html#how-to-run-agent-install-linux

[ec2-user@ip-172-31-21-129 ~]$ wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install
--2016-08-07 13:45:20--  https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install
Resolving aws-codedeploy-eu-central-1.s3.amazonaws.com (aws-codedeploy-eu-central-1.s3.amazonaws.com)... 54.231.193.44
Connecting to aws-codedeploy-eu-central-1.s3.amazonaws.com (aws-codedeploy-eu-central-1.s3.amazonaws.com)|54.231.193.44|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13359 (13K) []
Saving to: ‘install’

install                    100%[======================================>]  13.05K  78.6KB/s    in 0.2s   

2016-08-07 13:45:21 (78.6 KB/s) - ‘install’ saved [13359/13359]


Check installation success
[ec2-user@ip-172-31-21-129 ~]$ sudo service codedeploy-agent status
The AWS CodeDeploy agent is running as PID 2660



Sample app Linux
https://github.com/awslabs/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux

Sample Tomcat application on GitHub
https://github.com/awslabs/aws-codedeploy-sample-tomcat


You can also download sample app from Amazon S3
[dave@localhost aws]$ aws s3 cp s3://aws-codedeploy-eu-central-1/samples/latest/SampleApp_Linux.zip . --region eu-central-1
download: s3://aws-codedeploy-eu-central-1/samples/latest/SampleApp_Linux.zip to ./SampleApp_Linux.zip

[dave@localhost aws]$ unzip -l SampleApp_Linux.zip 
Archive:  SampleApp_Linux.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       34  11-03-2014 22:42   scripts/install_dependencies
       33  11-03-2014 22:43   scripts/start_server
      105  11-03-2014 22:43   scripts/stop_server
      359  11-03-2014 22:42   appspec.yml
      717  11-03-2014 22:42   index.html
    10884  11-03-2014 22:42   LICENSE.txt
---------                     -------
    12132                     6 files

AWS IAM setup for CodeDeploy

$
0
0

Create new IAM user using AWS console


https://console.aws.amazon.com/iam/home#users

Create new user awsdave



Download user credentials into file


 

Create new policies using AWS console


 Create new custom policy CodeDeploy and
EC2CodeDeploy

 


Create new roles using AWS console

 https://console.aws.amazon.com/iam/home#roles

Create roles and assign policy as described in AWS tutorial video
https://www.youtube.com/watch?v=qZa5JXmsWZs&list=LLl1AVDEQMsLIiTYI5M-v0ow&index=1



Create role CodeDeploy
Create role EC2CodeDeploy


Edit trust relationship for the created Role if needed



Launch EC2 instance 

 

Select EC2 instance IAM role EC2CodeDeploy



Policy CodeDeploy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "autoscaling:PutLifecycleHook",
                "autoscaling:DeleteLifecycleHook",
                "autoscaling:RecordLifecycleActionHeartbeat",
                "autoscaling:CompleteLifecycleAction",
                "autoscaling:DescribeAutoscalingGroups",
                "autoscaling:PutInstanceInStandby",
                "autoscaling:PutInstanceInService",
                "autoscaling:DescribeLifecycleHooks",
                "ec2:Describe*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}

Trust Relationship


{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "codedeploy.us-east-1.amazonaws.com",
          "codedeploy.us-west-2.amazonaws.com",
          "codedeploy.ap-northeast-2.amazonaws.com",
          "codedeploy.ap-southeast-2.amazonaws.com",
          "codedeploy.ap-southeast-1.amazonaws.com",
          "codedeploy.us-west-1.amazonaws.com",
          "codedeploy.eu-west-1.amazonaws.com",
          "codedeploy.ap-south-1.amazonaws.com",
          "codedeploy.eu-central-1.amazonaws.com",
          "codedeploy.ap-northeast-1.amazonaws.com",
          "codedeploy.sa-east-1.amazonaws.com"
        ]
      },
      "Action": "sts:AssumeRole"
    }
  ]
}



Install and configure Docker on Fedora

$
0
0
Installation guide for Fedora

https://docs.docker.com/engine/installation/linux/fedora/

Install Docker using DNF

Enable docker service and start it

[root@localhost ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.


[root@localhost ~]# systemctl start docker
[root@localhost ~]# ps -aef |grep docker
root      6785     1  2 10:32 ?        00:00:00 /usr/bin/dockerd
root      6796  6785  0 10:32 ?        00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --runtime docker-runc

Run the hello world

[root@localhost ~]# docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

Create group docker and add own user 

[root@localhost ~]# usermod -aG docker dave

It is necessary to reboot to get rights as non-root user

[dave@localhost docker]$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
Paste your text here.

Run Ubuntu image

[dave@localhost docker]$ docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
cad964aed91d: Pull complete
3a80a22fea63: Pull complete
50de990d7957: Pull complete
61e032b8f2cb: Pull complete
9f03ce1741bf: Pull complete
Digest: sha256:28d4c5234db8d5a634d5e621c363d900f8f241240ee0a6a978784c978fe9c737
Status: Downloaded newer image for ubuntu:latest
root@e0fdce56f046:/# hostname
e0fdce56f046
root@e0fdce56f046:/# more /etc/issue
Ubuntu 16.04.1 LTS \n \l

root@e0fdce56f046:/#

Running processes in hosting Fedora system

[root@localhost ~]# ps -aef |grep docker
root      1732     1  1 13:09 ?        00:00:08 /usr/bin/dockerd
root      1901  1732  0 13:09 ?        00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --runtime docker-runc
dave      3643  3343  0 13:15 pts/0    00:00:00 docker run -it ubuntu bash
root      3855  1901  0 13:15 ?        00:00:00 docker-containerd-shim e0fdce56f046997246242db8c1ad224337dc4915f3ee497c8ae66e321c1f445f /var/run/docker/libcontainerd/e0fdce56f046997246242db8c1ad224337dc4915f3ee497c8ae66e321c1f445f docker-runc
[root@localhost ~]#

List containers
[root@localhost ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
e0fdce56f046        ubuntu              "bash"              5 minutes ago       Up 5 minutes                                   furious_heisenberg
04899e84663d        hello-world         "/hello"            9 minutes ago       Exited (0) 9 minutes ago                       big_newton

Create own image
 ( using tutorial https://docs.docker.com/engine/getstarted/step_four/ )

[dave@localhost docker]$ cat Dockerfile 
FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay

[dave@localhost docker]$ docker build -t docker-whale .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM docker/whalesay:latest
---> 6b362a9f73eb
Step 2 : RUN apt-get -y update && apt-get install -y fortunes
---> Running in a2501bfa86f4
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get:2 http://archive.ubuntu.com trusty-security InRelease [65.9 kB]
Hit http://archive.ubuntu.com trusty Release.gpg
Hit http://archive.ubuntu.com trusty Release
Get:3 http://archive.ubuntu.com trusty-updates/main Sources [474 kB]
Get:4 http://archive.ubuntu.com trusty-updates/restricted Sources [5247 B]
Get:5 http://archive.ubuntu.com trusty-updates/universe Sources [209 kB]
Get:6 http://archive.ubuntu.com trusty-updates/main amd64 Packages [1125 kB]
Get:7 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [23.5 kB]
Get:8 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [485 kB]
Get:9 http://archive.ubuntu.com trusty-security/main Sources [153 kB]
Get:10 http://archive.ubuntu.com trusty-security/restricted Sources [3944 B]
Get:11 http://archive.ubuntu.com trusty-security/universe Sources [51.3 kB]
Get:12 http://archive.ubuntu.com trusty-security/main amd64 Packages [662 kB]
Get:13 http://archive.ubuntu.com trusty-security/restricted amd64 Packages [20.2 kB]
Get:14 http://archive.ubuntu.com trusty-security/universe amd64 Packages [180 kB]
Hit http://archive.ubuntu.com trusty/main Sources
Hit http://archive.ubuntu.com trusty/restricted Sources
Hit http://archive.ubuntu.com trusty/universe Sources
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Fetched 3525 kB in 3s (1060 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
fortune-mod fortunes-min librecode0
Suggested packages:
x11-utils bsdmainutils
The following NEW packages will be installed:
fortune-mod fortunes fortunes-min librecode0
0 upgraded, 4 newly installed, 0 to remove and 87 not upgraded.
Need to get 1961 kB of archives.
After this operation, 4817 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main librecode0 amd64 3.6-21 [771 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/universe fortune-mod amd64 1:1.99.1-7 [39.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe fortunes-min all 1:1.99.1-7 [61.8 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/universe fortunes all 1:1.99.1-7 [1089 kB]
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Fetched 1961 kB in 0s (2729 kB/s)
Selecting previously unselected package librecode0:amd64.
(Reading database ... 13116 files and directories currently installed.)
Preparing to unpack .../librecode0_3.6-21_amd64.deb ...
Unpacking librecode0:amd64 (3.6-21) ...
Selecting previously unselected package fortune-mod.
Preparing to unpack .../fortune-mod_1%3a1.99.1-7_amd64.deb ...
Unpacking fortune-mod (1:1.99.1-7) ...
Selecting previously unselected package fortunes-min.
Preparing to unpack .../fortunes-min_1%3a1.99.1-7_all.deb ...
Unpacking fortunes-min (1:1.99.1-7) ...
Selecting previously unselected package fortunes.
Preparing to unpack .../fortunes_1%3a1.99.1-7_all.deb ...
Unpacking fortunes (1:1.99.1-7) ...
Setting up librecode0:amd64 (3.6-21) ...
Setting up fortune-mod (1:1.99.1-7) ...
Setting up fortunes-min (1:1.99.1-7) ...
Setting up fortunes (1:1.99.1-7) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
---> d32c0f1dd6fd
Removing intermediate container a2501bfa86f4
Step 3 : CMD /usr/games/fortune -a | cowsay
---> Running in 4be6a9e302e6
---> 04c2ee13ff82
Removing intermediate container 4be6a9e302e6
Successfully built 04c2ee13ff82


Run own image

[dave@localhost docker]$ docker run docker-whale
______________________________________
/ Now Denial: \
| |
| To tell oneself that the only time |
| worth living in is the past and that |
| the only time that may ever be |
| interesting again is the future. |
| |
| -- Douglas Coupland, "Generation X: |
| Tales for an Accelerated |
| |
\ Culture" /
--------------------------------------
\
\
\
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/

Install Citrix receiver on Fedora

$
0
0
Install Citrix Receiver

[root@linux ~]# dnf info ICAClient
Last metadata expiration check: 1:56:02 ago on Tue Oct 11 14:24:35 2016.
Installed Packages
Name        : ICAClient
Arch        : x86_64
Epoch       : 0
Version     : 13.4.0.10109380
Release     : 0
Size        : 45 M
Repo        : @System
From repo   : @commandline
Summary     : Citrix Receiver for Linux
URL         : http://www.citrix.com/
License     : Commercial
Description : Citrix Receiver lets you access your enterprise files, applications, and
            : desktops from your favorite device wherever you are. Just ask your IT
            : department how to get started.


If you see SSL error on connection attemt
https://newspaint.wordpress.com/2015/10/05/linux-citrix-receiver-ssl-error-addtrust-external-ca-root/

Extract  AddTrustExternalCARoot from Firefox -> Preferences -> Advanced -> Certificates -> CA certs ->
Export CA cert AddTrustExternalCARoot to disk

Or download CA certificate from Comodo
https://support.comodo.com/index.php?/Knowledgebase/Article/View/853/74/addtrustexternalcaroot

Copy CA certificate into Citrix installation

[root@linux ~]# cp AddTrustExternalCARoot.crt /opt/Citrix/ICAClient/keystore/cacerts/


Use Google Chrome to connect

Run Arquillian test on JBoss EAP 7/ Wildfly 10 using Arquillian Chameleon Container

$
0
0

Arqullian

http://arquillian.org/guides/getting_started/

Arquillian Chameleon Container

 https://github.com/arquillian/arquillian-container-chameleon

 http://discuss.arquillian.org/t/proxy-container-for-all-jboss-as-jboss-eap-wildfly/124/7

 Add Maven dependency ( check for latest version )

<dependency>
<groupId>org.arquillian.container</groupId>
<artifactId>arquillian-container-chameleon</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>

Add container configuration into arquillian.xml file

<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<container qualifier="chameleon" default="true">
<configuration>
<property name="chameleonTarget">jboss eap:7.0.1:remote</property>
<property name="managementAddress">localhost</property>
<property name="managementPort">9990</property>
<property name="username">${jboss.admin.user}</property>
<property name="password">${jboss.admin.password}!</property>
</configuration>
</container>

</arquillian>


Add Maven dependencies in multi-module project using shrinkwrap-resolver-impl-maven http://stackoverflow.com/questions/13001371/adding-all-maven-dependencies-to-arquillian

https://github.com/shrinkwrap/resolver


Add Chameleon container dependency ( using runTests profile )

<profile>
<id>runTests</id>
<activation>
<property>
<name>runTests</name>
<value>true</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.arquillian.container</groupId>
<artifactId>arquillian-container-chameleon</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>

Run the single test using Maven command line

$ mvn clean install -PrunTests  -Dtest=ArqTestCase

Install Java EE7 application using JBoss Wildfly Docker image

$
0
0

Docker and WildFly Part 1 - Deployment via Docker volumes 

 
Docker and WildFly Part 2 - Deployment over management API


https://github.com/goldmann/wildfly-docker-deployment-example

Download JBoss Wildfly image
https://hub.docker.com/r/jboss/wildfly/


[dave@localhost wildfly]$ docker run -it jboss/wildfly
Unable to find image 'jboss/wildfly:latest' locally
latest: Pulling from jboss/wildfly

8d30e94188e7: Pull complete
183bb107e46a: Pull complete
9ea1527ac190: Pull complete
d632efeddd98: Pull complete
11af01a2d795: Pull complete
Digest: sha256:2bed1e7a68245509de5837435b6250491efe61a86533f5ce6bf94927814076fb
Status: Downloaded newer image for jboss/wildfly:latest
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /opt/jboss/wildfly

JAVA: /usr/lib/jvm/java/bin/java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================


Use port redirect to see Wildfly running in the browser

[dave@localhost wildfly]$ docker run -it -p 8080:8080 jboss/wildfly 

Wildfly home page
Add access to console using own Dockerfile

[dave@localhost wildfly]$ more Dockerfile 
FROM jboss/wildfly:latest

USER jboss
RUN /opt/jboss/wildfly/bin/add-user.sh admin MY_PASSWORD_TO_ACCESS --silent
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]


Build the Docker image

[dave@localhost wildfly]$ docker build --tag=wildfly-mgmt .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM jboss/wildfly:latest
---> 4c99bd2cd264
Step 2 : USER jboss
---> Running in de10054221e5
---> f3b3e54e823b
Removing intermediate container de10054221e5
Step 3 : RUN /opt/jboss/wildfly/bin/add-user.sh admin MY_PASSWORD_TO_ACCESS --silent
---> Running in 9af7cd245555
---> 5a29ccf7bef0
Removing intermediate container 9af7cd245555
Step 4 : CMD /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
---> Running in 642784343b49
---> 3ea63bcef45a
Removing intermediate container 642784343b49
Successfully built 3ea63bcef45a


Start with port 8080 and 9990 redirected

[dave@localhost wildfly]$ docker run -it -p 8080:8080 -p 9990:9990  wildfly-mgmt

Check the console access via browser on 9990


Deploy Java EE7 app using Maven

Source code for the application GitHub https://github.com/dveselka/wildfly/tree/master/dave-java-ee7-wildfly-full

[dave@localhost dave-java-ee7-wildfly-full]$  mvn clean package wildfly:deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] dave-java-ee7-wildfly-full
[INFO] dave-java-ee7-wildfly-full: EJB Module
[INFO] dave-java-ee7-wildfly-full: WAR Module
[INFO] dave-java-ee7-wildfly-full: EAR Module
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dave-java-ee7-wildfly-full 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dave-java-ee7-wildfly-full ---
[INFO]
[INFO] >>> wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) > package @ dave-java-ee7-wildfly-full >>>
[INFO]
[INFO] <<< wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) < package @ dave-java-ee7-wildfly-full <<<
[INFO]
[INFO] --- wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) @ dave-java-ee7-wildfly-full ---

Deployment in Docker Widlfy

05:32:38,366 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 4639ms - Started 331 of 577 services (393 services are lazy, passive or on-demand)
05:43:49,778 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /opt/jboss/wildfly/standalone/data/content/a1/58abbd7beeb79e23f10486bbefb72f55dc5368/content
05:43:49,861 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "dave-java-ee7-wildfly-full-ear.ear" (runtime-name: "dave-java-ee7-wildfly-full-ear.ear")
05:43:50,006 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0207: Starting subdeployment (runtime-name: "dave-java-ee7-wildfly-full-web.war")
05:43:50,006 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0207: Starting subdeployment (runtime-name: "dave-java-ee7-wildfly-full-ejb.jar")
05:43:50,168 WARN [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.
05:43:50,620 INFO [org.jboss.as.jpa] (MSC service thread 1-5) WFLYJPA0002: Read persistence.xml for primary
05:43:50,900 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/dave-java-ee7-wildfly-fullDS]
05:43:50,966 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 69) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'dave-java-ee7-wildfly-full-ear.ear/dave-java-ee7-wildfly-full-ejb.jar#primary'
05:43:50,977 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment dave-java-ee7-wildfly-full-ear.ear
05:43:51,095 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 69) HHH000204: Processing PersistenceUnitInfo [
name: primary
...]
05:43:51,494 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.2.4.Final
05:43:51,653 INFO [org.hibernate.Version] (ServerService Thread Pool -- 69) HHH000412: Hibernate Core {5.0.10.Final}
05:43:51,655 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 69) HHH000206: hibernate.properties not found
05:43:51,664 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 69) HHH000021: Bytecode provider name : javassist
05:43:51,864 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 69) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
05:43:52,082 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment dave-java-ee7-wildfly-full-ejb.jar
05:43:52,090 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0003: Processing weld deployment dave-java-ee7-wildfly-full-web.war
05:43:52,120 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-1) WFLYEJB0473: JNDI bindings for session bean named 'MemberRegistration' in deployment unit 'subdeployment "dave-java-ee7-wildfly-full-ejb.jar" of deployment "dave-java-ee7-wildfly-full-ear.ear"' are as follows:

java:global/dave-java-ee7-wildfly-full-ear/dave-java-ee7-wildfly-full-ejb/MemberRegistration!dave.service.MemberRegistration
java:app/dave-java-ee7-wildfly-full-ejb/MemberRegistration!dave.service.MemberRegistration
java:module/MemberRegistration!dave.service.MemberRegistration
java:global/dave-java-ee7-wildfly-full-ear/dave-java-ee7-wildfly-full-ejb/MemberRegistration
java:app/dave-java-ee7-wildfly-full-ejb/MemberRegistration
java:module/MemberRegistration


Check the application in the browser


Run Docker JBoss Wildfly image on AWS ECS

$
0
0
Install Docker on AWS ECS
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html


       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2016.09-release-notes/
[ec2-user@ip-172-31-31-199 ~]$ sudo yum update -y
Loaded plugins: priorities, update-motd, upgrade-helper
No packages marked for update
[ec2-user@ip-172-31-31-199 ~]$  sudo yum install -y docker
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:1.11.2-1.6.amzn1 will be installed
--> Processing Dependency: xfsprogs for package: docker-1.11.2-1.6.amzn1.x86_64
--> Running transaction check
---> Package xfsprogs.x86_64 0:3.2.2-2.20.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch          Version                   Repository        Size
================================================================================
Installing:
 docker          x86_64        1.11.2-1.6.amzn1          amzn-main         17 M
Installing for dependencies:
 xfsprogs        x86_64        3.2.2-2.20.amzn1          amzn-main        1.7 M

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 18 M
Installed size: 59 M
Downloading packages:
(1/2): docker-1.11.2-1.6.amzn1.x86_64.rpm                |  17 MB     00:00    
(2/2): xfsprogs-3.2.2-2.20.amzn1.x86_64.rpm              | 1.7 MB     00:00    
--------------------------------------------------------------------------------
Total                                               21 MB/s |  18 MB  00:00    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xfsprogs-3.2.2-2.20.amzn1.x86_64                             1/2
  Installing : docker-1.11.2-1.6.amzn1.x86_64                                                        2/2
  Verifying  : docker-1.11.2-1.6.amzn1.x86_64                                                        1/2
  Verifying  : xfsprogs-3.2.2-2.20.amzn1.x86_64                                                      2/2

Installed:
  docker.x86_64 0:1.11.2-1.6.amzn1                                                                      

Dependency Installed:
  xfsprogs.x86_64 0:3.2.2-2.20.amzn1                                                                    

Complete!
[ec2-user@ip-172-31-31-199 ~]$ sudo service docker start
Starting cgconfig service:                                 [  OK  ]
Starting docker:    .                                  [  OK  ]
[ec2-user@ip-172-31-31-199 ~]$ sudo usermod -a -G docker ec2-user
[ec2-user@ip-172-31-31-199 ~]$

Verify Docker status

[ec2-user@ip-172-31-31-199 ~]$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.11.2
Storage Driver: devicemapper
Pool Name: docker-202:1-394626-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 7.223 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.93-RHEL7 (2015-01-28)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge
Kernel Version: 4.4.23-31.54.amzn1.x86_64
Operating System: Amazon Linux AMI 2016.09
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 995.4 MiB
Name: ip-172-31-31-199
ID: IEGJ:BLTG:7DGR:PNN7:SDZS:3M7H:L6LR:CB3M:52IV:SG2R:O3KF:NZPI
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
[ec2-user@ip-172-31-31-199 ~]$


Run JBoss Wildfly Docker image

[ec2-user@ip-172-31-31-199 ~]$ docker run -it -p 8080:8080 jboss/wildfly 
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /opt/jboss/wildfly

JAVA: /usr/lib/jvm/java/bin/java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

21:14:22,924 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
21:14:23,279 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
21:14:23,368 INFO [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting


List Docker processes

[ec2-user@ip-172-31-31-199 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0a5959e5cd9e jboss/wildfly "/opt/jboss/wildfly/b" 9 minutes ago Up 9 minutes 0.0.0.0:8080->8080/tcp adoring_allen


Connect to Wildfly with links browser from other shell

Install links and connect to http:localhost:8080



[ec2-user@ip-172-31-31-199 ~]$ yum install links

[ec2-user@ip-172-31-31-199 ~]$ links http://localhost:8080




Weblogic wlfullclient.jar deprecated

$
0
0
Since Weblogic 12.1.3 wlfullclient.jar is deprecated https://docs.oracle.com/middleware/1213/wls/SACLT/t3.htm#SACLT130

The WebLogic full client, wlfullclient.jar, is deprecated as of WebLogic Server 12.1.3 and may be removed in a future release. Oracle recommends using the WebLogic Thin T3 client or other appropriate client depending on your environment. For more information on WebLogic client types, see WebLogic Server Client Types and Features.


Using https://jarscan.com/ we can found which jars are required to compile/run Weblogic applications


[dave@localhost lib]$ java -jar /home/dave/Downloads/jarscan.jar -class weblogic.application.ApplicationLifecycleListener
 
=========================
JarScan
written by Geoff Yaworski
gyaworski@hotmail.com
Version 2.0
=========================
 
 
Looking for class(es): [weblogic.application.ApplicationLifecycleListener]
 
Processed 223 directories containing 1139 files
found 127 libraries under the directory: /home/app/weblogic-12.2.1/wlserver/server/lib
 
1) spring-console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/spring-console.jar]
2) diagnostics-console-extension.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/diagnostics-console-extension.jar]
3) spring-console-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/spring-console-l10n.jar]
4) weblogic-sca-console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/weblogic-sca-console.jar]
5) diagnostics-console-extension-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/diagnostics-console-extension-l10n.jar]
6) coherence.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/coherence.jar]
7) core-partition-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-partition-l10n.jar]
8) wtc.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/wtc.jar]
9) core-connector.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-connector.jar]
10) jolt-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/jolt-l10n.jar]
11) jolt.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/jolt.jar]
12) core-ejb.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-ejb.jar]
13) core-jms.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-jms.jar]
14) core-partition.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-partition.jar]
15) coherence-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/coherence-l10n.jar]
16) wtc-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/wtc-l10n.jar]
17) weblogic-sca-console-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/weblogic-sca-console-l10n.jar]
18) weblogic-spring.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic-spring.jar]
19) wljmsclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wljmsclient.jar]
20) wljmxclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wljmxclient.jar]
21) wlconnector.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlconnector.jar]
22) wldeploy.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wldeploy.jar]
23) debugpatch-agent.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/debugpatch-agent.jar]
24) wls-api.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wls-api.jar]
25) osgi.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/osgi.jar]
26) wlthint3client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlthint3client.jar]
27) Eclipse-Installer.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/Eclipse-Installer.jar]
28) api.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/api.jar]
29) weblogic-launcher.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic-launcher.jar]
30) pcl2.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/pcl2.jar]
31) diagnostics-image-binding.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/diagnostics-image-binding.jar]
32) diagnostics-binding.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/diagnostics-binding.jar]
33) weblogic-domain-binding.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/weblogic-domain-binding.jar]
34) weblogic-domain-binding-compatibility.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/weblogic-domain-binding-compatibility.jar]
35) wlw-langx.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlw-langx.jar]
36) wlnmclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlnmclient.jar]
37) wl-j2ee-client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wl-j2ee-client.jar]
38) wlfullclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlfullclient.jar]
39) jrmpclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/jrmpclient.jar]
40) wlsafclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlsafclient.jar]
41) console-zh_CN.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-zh_CN.jar]
42) l10n_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/l10n_taglib.jar]
43) portlet-container.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/portlet-container.jar]
44) console-pt_BR.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-pt_BR.jar]
45) standard.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/standard.jar]
46) console-it.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-it.jar]
47) console-de.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-de.jar]
48) netui-adapter.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/netui-adapter.jar]
49) wldfclient-min.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/wldfclient-min.jar]
50) netuix_common_web.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/netuix_common_web.jar]
51) console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console.jar]
52) beehive-netui-tags.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/beehive-netui-tags.jar]
53) skeleton_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/skeleton_taglib.jar]
54) beehive-netui-core.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/beehive-netui-core.jar]
55) prefs-spi.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/prefs-spi.jar]
56) console-zh_TW.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-zh_TW.jar]
57) beehive-controls.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/beehive-controls.jar]
58) console-ja.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-ja.jar]
59) render_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/render_taglib.jar]
60) console-fr.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-fr.jar]
61) struts.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/struts.jar]
62) console-ko.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-ko.jar]
63) struts-adapter.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/struts-adapter.jar]
64) netuix_servlet.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/netuix_servlet.jar]
65) console-es.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-es.jar]
66) client_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/client_taglib.jar]
67) console-help-html-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/virtualdirectory/console-help-html-l10n.jar]
68) console-help-html.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/virtualdirectory/console-help-html.jar]
69) l10n_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/l10n_taglib.jar]
70) portlet-container.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/portlet-container.jar]
71) standard.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/standard.jar]
72) netuix_common_web.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/netuix_common_web.jar]
73) console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/console.jar]
74) beehive-netui-tags.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/beehive-netui-tags.jar]
75) skeleton_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/skeleton_taglib.jar]
76) beehive-netui-core.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/beehive-netui-core.jar]
77) prefs-spi.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/prefs-spi.jar]
78) render_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/render_taglib.jar]
79) struts.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/struts.jar]
80) jh.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/jh.jar]
81) struts-adapter.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/struts-adapter.jar]
82) netuix_servlet.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/netuix_servlet.jar]
83) netuix_common.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/netuix_common.jar]
84) commons-codec-1.3.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-codec-1.3.jar]
85) wsrp-common.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/wsrp-common.jar]
86) jakarta-oro.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/jakarta-oro.jar]
87) netuix_system.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/netuix_system.jar]
88) commons-fileupload.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-fileupload.jar]
89) standard.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/standard.jar]
90) jstl.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/jstl.jar]
91) wsrp-client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/wsrp-client.jar]
92) p13n_system.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/p13n_system.jar]
93) commons-logging-1.0.4.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-logging-1.0.4.jar]
94) com.bea.core.process_5.4.0.0.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/com.bea.core.process_5.4.0.0.jar]
95) p13n-schemas.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/p13n-schemas.jar]
96) commons-io-2.4.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-io-2.4.jar]
97) netuix_schemas.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/netuix_schemas.jar]
98) log4j-1.2.8.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/log4j-1.2.8.jar]
99) commons-digester.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-digester.jar]
100) struts.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/struts.jar]
101) p13n_common.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/p13n_common.jar]
102) commons-beanutils.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-beanutils.jar]
103) commons-validator-1.4.1.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-validator-1.4.1.jar]
104) wlw-system.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/wlw-system.jar]
105) wlclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlclient.jar]
106) jcom.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/jcom.jar]
107) wlsaft3client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlsaft3client.jar]
108) wlUserConfigCompatibility.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/compatibility/wlUserConfigCompatibility.jar]
109) wllog4j.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wllog4j.jar]
110) org.apache.felix.org.apache.felix.main.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/org.apache.felix.org.apache.felix.main.jar]
111) bea_wls_remote_deployer.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/bea_wls_remote_deployer.jar]
112) mejb.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mejb.jar]
113) weblogic.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic.jar]
114) saml2-security-providers.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/saml2-security-providers.jar]
115) wlManagementMBean.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/wlManagementMBean.jar]
116) xacml-security-providers.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/xacml-security-providers.jar]
117) system-password-validator-provider.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/system-password-validator-provider.jar]
118) wlManagementImplSource.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/wlManagementImplSource.jar]
119) wls-security-providers.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/wls-security-providers.jar]
120) wls-api-part.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wls-api-part.jar]
121) weblogic-L10N.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic-L10N.jar]
122) sslj.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/sslj.jar]
123) javax.javaee-api.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/javax.javaee-api.jar]
124) cryptoj.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/cryptoj.jar]
125) diagnostics-agent.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/diagnostics-agent.jar]
126) jcmFIPS.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/jcmFIPS.jar]
127) wljarbuilder.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wljarbuilder.jar]
 
searching these jarfiles now ....
 
===============================================
Found: weblogic.application.ApplicationLifecycleListener
Class: weblogic.application.ApplicationLifecycleListener
Package: weblogic.application
Library Name: wls-api.jar
Library Path: /home/app/weblogic-12.2.1/wlserver/server/lib/wls-api.jar
===============================================
 
===============================================
Found: weblogic.application.ApplicationLifecycleListener
Class: weblogic.application.ApplicationLifecycleListener
Package: weblogic.application
Library Name: wlfullclient.jar
Library Path: /home/app/weblogic-12.2.1/wlserver/server/lib/wlfullclient.jar
===============================================
 
===============================================
Found: weblogic.application.ApplicationLifecycleListener
Class: weblogic.application.ApplicationLifecycleListener
Package: weblogic.application
Library Name: wls-api-part.jar
Library Path: /home/app/weblogic-12.2.1/wlserver/server/lib/wls-api-part.jar
===============================================
 
Search took: 2633 milliseconds.


Weblogic 12.2 1 - implement WebService using Maven Archetype

$
0
0
Java EE7 web service tutorial
https://docs.oracle.com/javaee/7/tutorial/jaxws.htm

Here is description  for basic webservice implementation in Weblogic 12.2.1 docs
https://docs.oracle.com/middleware/12211/lcm/MAVEN/weblogic_maven.htm#MAVEN8785

Requires configuration of Oracle Maven repository on local host - see here http://danielveselka.blogspot.cz/2016/01/using-maven-on-weblogic-1221-with-java.html

Use Maven  archetype to generate application

mvn archetype:generate -DarchetypeGroupId=com.oracle.weblogic.archetype -DarchetypeArtifactId=basic-webservice -DarchetypeVersion=12.2.1-0-0 -DgroupId=org.dave -DartifactId=dave-basic-webservice-project  -Dversion=1.0-SNAPSHOT


[INFO] Archetype repository missing. Using the one from [com.oracle.weblogic.archetype:basic-webservice:12.2.1-0-0] found in catalog local
[INFO] Using property: groupId = org.dave
[INFO] Using property: artifactId = dave-basic-webservice-project
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = org.dave
Confirm properties configuration:
groupId: org.dave
artifactId: dave-basic-webservice-project
version: 1.0-SNAPSHOT
package: org.dave

Run mvn compile

META-INF/application.xml

<?xml version='1.0' encoding='UTF-8'?>
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5">
  <display-name>target</display-name>
  <module>
    <web>
      <web-uri>SayHello</web-uri>
      <context-root>basicWebservice</context-root>
    </web>
  </module>
</application>


Run mvn package

[dave@localhost dave-basic-webservice-project]$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building basicWebservice 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dave-basic-webservice-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dave/git/weblogic/dave-basic-webservice-project/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ dave-basic-webservice-project ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:ws-jwsc (default) @ dave-basic-webservice-project ---
EarFile] Application File : /home/dave/git/weblogic/dave-basic-webservice-project/target/META-INF/application.xml
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dave-basic-webservice-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dave/git/weblogic/dave-basic-webservice-project/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ dave-basic-webservice-project ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dave-basic-webservice-project ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ dave-basic-webservice-project ---
[INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webservice-project] in [/home/dave/git/weblogic/dave-basic-webservice-project/target/generated-dave-basic-webservice-project]
[INFO] Processing war project
[INFO] Webapp assembled in [76 msecs]
[INFO] Building war: /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS


Run mvn preintegration-test

INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webservice-project] in [/home/dave/git/weblogic/dave-basic-webservice-project/target/generated-dave-basic-webservice-project]
[INFO] Processing war project
[INFO] Webapp assembled in [206 msecs]
[INFO] Building war: /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:deploy (deployApp) @ dave-basic-webservice-project ---
[INFO] Command flags are: -noexit -deploy -username weblogic -password ******* -name basicWebservice -source /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war -verbose -adminurl t3://localhost:7001
weblogic.Deployer invoked with options: -noexit -deploy -username weblogic -name basicWebservice -source /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war -verbose -adminurl t3://localhost:7001
<Sep 17, 2017 11:48:26 AM CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, basicWebservice [archive: /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war], to configured targets.>
Task 0 initiated: [Deployer:149026]deploy application basicWebservice on AdminServer.
Task 0 completed: [Deployer:149026]deploy application basicWebservice on AdminServer.
Target state: deploy completed on Server AdminServer

Target Assignments:
+ basicWebservice AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS


Test the application http://localhost:7001/basicWebservice/SayHello

Endpoint     Information
Service Name: {http://example.org}SayHello
Port Name: {http://example.org}SayHelloPort

Address: http://localhost:7001/basicWebservice/SayHello
WSDL: http://localhost:7001/basicWebservice/SayHello?wsdlTest
Implementation class: org.dave.SayHello

WSDL  http://localhost:7001/basicWebservice/SayHello?wsdl

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --><!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://example.org" name="SayHello">
<types>
<xsd:schema>
<xsd:import namespace="http://example.org" schemaLocation="http://localhost:7001/basicWebservice/SayHello?xsd=1"/>
</xsd:schema>
</types>
<message name="sayHello">
<part name="parameters" element="tns:sayHello"/>
</message>
<message name="sayHelloResponse">
<part name="parameters" element="tns:sayHelloResponse"/>
</message>
<portType name="SayHello">
<operation name="sayHello">
<input wsam:Action="http://example.org/SayHello/sayHelloRequest" message="tns:sayHello"/>
<output wsam:Action="http://example.org/SayHello/sayHelloResponse" message="tns:sayHelloResponse"/>
</operation>
</portType>
<binding name="SayHelloPortBinding" type="tns:SayHello">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="sayHello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="SayHello">
<port name="SayHelloPort" binding="tns:SayHelloPortBinding">
<soap:address location="http://localhost:7001/basicWebservice/SayHello"/>
</port>
</service>
</definitions>

Test using browser client
http://localhost:7001/ws_utc/?wsdlUrl=http://localhost:7001/basicWebservice/SayHello?wsdl

Weblogic 12.2.1 - build webservice using jwsc Ant task

$
0
0
We want to test Ant jwsc task on Weblogic 12.2.1 server 

This blog is used to start project
https://www.igorkromin.net/index.php/2015/04/28/an-example-build-system-using-jwsc-and-wldeploy-weblogic-tasks/

Another blog https://gerardnico.com/wiki/weblogic/web_service

Weblogic documetation for  weblogic.wsee.tools.anttasks.JwscTask
 http://docs.oracle.com/middleware/1221/wls/WSGET/jax-ws-setenv.htm#WSGET136


Project structure

dave@localhost jwsc-ant-webservice]$ ls -R1
.:
build
build-base.xml
build.properties
build.xml
dist
lib
src

./build:
META-INF
WsExample.war

./build/META-INF:
application.xml
weblogic-application.xml

./dist:
WsExample.ear

./lib:

./src:
org

./src/org:
dave

./src/org/dave:
SayHello.java


Webservice source code  ( from Weblogic Maven  sample ) - see here http://danielveselka.blogspot.cz/2017/09/weblogic-122-1-implement-webservice.html

[dave@localhost jwsc-ant-webservice]$ more ../dave-basic-webservice-project/src/main/java/org/dave/SayHello.java 
package org.dave;

// Import the standard JWS annotation interfaces

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

// Standard JWS annotation that specifies that the name of the Web Service is
// "Simple" and the targetNamespace used in the generated WSDL is
// "http://example.org"
@WebService(name="SayHello", targetNamespace="http://example.org", serviceName = "SayHello")

// Standard JWS annotation that specifies the mapping of the service onto the
// SOAP message protocol.
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
             use=SOAPBinding.Use.LITERAL,
             parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)

/**
 * This JWS file forms the basis of a simple WebLogic Web Service with a
 * single operation: sayHello
 *
 * @author Copyright (c) 1999,2013, Oracle and/or its affiliates. All rights reserved.
 */

public class SayHello {

  // Required constructor

  public SayHello() {}

  // Standard JWS annotation that specifies that the method should be exposed
  // as a public operation.  Because the annotation does not include the
  // member-value "operationName", the public name of the operation is the
  // same as the method name: sayHello.

  @WebMethod()
  public String sayHello(String message) {
    System.out.println("sayHello:" + message);
    return "Here is the message: '" + message + "'";
  }
}

Compilation requires multiple jars or Weblogic installation reference in libs.dir

[dave@localhost jwsc-ant-webservice]$ more build.properties 
# WLS details
wls.adminurl=t3://localhost:7001
wls.targets=AdminServer
wls.user=weblogic
wls.passwd=SOME_PASSWORD
# Directories
libs.dir=/app/weblogic-12.2.1/wlserver/server/lib
build.dir=build
dist.dir=dist
src.dir=src
# WS details
ws.name=WsExample
ws.context=wsexample
ws.jwsfile=org/dave/SayHello.java
ws.keepgenerated=yes


Deploy webservice

[dave@localhost jwsc-ant-webservice]$ ant -p
Buildfile: /home/dave/git/weblogic/jwsc-ant-webservice/build.xml

Main targets:

Other targets:

 all
 build-fail
 build-service
 clean
 deploy-service
 init
Default target: all
[dave@localhost jwsc-ant-webservice]$ ant deploy-service
Buildfile: /home/dave/git/weblogic/jwsc-ant-webservice/build.xml

init:

build-service:
     [jwsc] warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
     [jwsc] JWS: processing module WsExample
     [jwsc] Parsing source files
     [jwsc] Parsing source files
     [jwsc] 1 JWS files being processed for module WsExample
     [jwsc] JWS: /home/dave/git/weblogic/jwsc-ant-webservice/src/org/dave/SayHello.java Validated.
     [jwsc] Processing 1 JAX-WS web services...
     [jwsc] Compiling 3 source files to /tmp/_9ddhhq
     [jwsc] Deleting existing module outputFile /home/dave/git/weblogic/jwsc-ant-webservice/build/WsExample.war
     [jwsc] Building jar: /home/dave/git/weblogic/jwsc-ant-webservice/build/WsExample.war
     [jwsc] Created JWS deployment outputFile: /home/dave/git/weblogic/jwsc-ant-webservice/build/WsExample.war
     [jwsc] [EarFile] Application File : /home/dave/git/weblogic/jwsc-ant-webservice/build/META-INF/application.xml
[AntUtil.deleteDir] Deleting directory /tmp/_9ddhhq
      [ear] Building ear: /home/dave/git/weblogic/jwsc-ant-webservice/dist/WsExample.ear

deploy-service:
 [wldeploy] weblogic.Deployer -noexit -name WsExample -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -password ******** -undeploy
 [wldeploy] weblogic.Deployer invoked with options:  -noexit -name WsExample -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -undeploy
 [wldeploy] <Sep 17, 2017 12:46:48 PM CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating undeploy operation for application, WsExample [archive: null], to AdminServer .>



Test webservice using  http://localhost:7001/wsexample/SayHello


Endpoint     Information
Service Name:    {http://example.org}SayHello
Port Name:    {http://example.org}SayHelloPort
   
Address:    http://localhost:7001/wsexample/SayHello
WSDL:    http://localhost:7001/wsexample/SayHello?wsdlTest
Implementation class:    org.dave.SayHello


WSDL  http://localhost:7001/wsexample/SayHello?wsdl

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --><!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://example.org" name="SayHello">
<types>
<xsd:schema>
<xsd:import namespace="http://example.org" schemaLocation="http://localhost:7001/wsexample/SayHello?xsd=1"/>
</xsd:schema>
</types>
<message name="sayHello">
<part name="parameters" element="tns:sayHello"/>
</message>
<message name="sayHelloResponse">
<part name="parameters" element="tns:sayHelloResponse"/>
</message>
<portType name="SayHello">
<operation name="sayHello">
<input wsam:Action="http://example.org/SayHello/sayHelloRequest" message="tns:sayHello"/>
<output wsam:Action="http://example.org/SayHello/sayHelloResponse" message="tns:sayHelloResponse"/>
</operation>
</portType>
<binding name="SayHelloPortBinding" type="tns:SayHello">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="sayHello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="SayHello">
<port name="SayHelloPort" binding="tns:SayHelloPortBinding">
<soap:address location="http://localhost:7001/wsexample/SayHello"/>
</port>
</service>
</definitions>

Test result:

request
    request-1505645963920

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header/>
    <soap:Body>
        <ns1:sayHello xmlns:ns1="http://example.org">
            <arg0>dave</arg0>
        </ns1:sayHello>
    </soap:Body>
</soap:Envelope>



response:

    response-1505645964157

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns0:sayHelloResponse xmlns:ns0="http://example.org">
            <return>Here is the message: 'dave'</return>
        </ns0:sayHelloResponse>
    </S:Body>
</S:Envelope>





Build Weblogic Docker image

$
0
0
Oracle Docker image repository https://github.com/oracle/docker-images


Weblogic image https://github.com/oracle/docker-images/tree/master/OracleWebLogic


1. Build Java image

Download latest Java 8 JRE

dave@localhost docker-images]$ ls -1 ./OracleJava/java-8
build.sh
Dockerfile
server-jre-8u131-linux-x64.tar.gz.download
server-jre-8u144-linux-x64.tar.gz



2. Build Weblogic 12.2.1.2 image

Download Weblogic 12.2.1 installer  http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html

[dave@localhost docker-images]$ ls -1 ./OracleWebLogic/dockerfiles/
12.1.3
12.2.1
12.2.1.1
12.2.1.2
buildDockerImage.sh
[dave@localhost docker-images]$ ls -1 ./OracleWebLogic/dockerfiles/12.2.1.2
Checksum.developer
Checksum.generic
container-scripts
Dockerfile.developer
Dockerfile.generic
fmw_12.2.1.2.0_wls_Disk1_1of1.zip
fmw_12.2.1.2.0_wls_Disk1_1of1.zip.download
fmw_12.2.1.2.0_wls_quick_Disk1_1of1.zip.download
install.file
oraInst.loc
README.md


Run script
./OracleWebLogic/dockerfiles/buildDockerImage.sh -v 12.2.1.2 -g

[dave@localhost dockerfiles]$ ./buildDockerImage.sh -v 12.2.1.2 -g
Checking if required packages are present and valid...
fmw_12.2.1.2.0_wls_Disk1_1of1.zip: OK
md5sum: WARNING: 1 line is improperly formatted
=====================
Building image 'oracle/weblogic:12.2.1.2-generic' ...
Sending build context to Docker daemon  829.6MB
Step 1/13 : FROM oracle/serverjre:8
 ---> 51c243388334
Step 2/13 : MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
 ---> Running in 3cc123fdaa4f
Removing intermediate container 3cc123fdaa4f
 ---> 092fff463648
Step 3/13 : ENV ORACLE_HOME=/u01/oracle     USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom"     SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh     PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
 ---> Running in 04c6eea7844c
Removing intermediate container 04c6eea7844c
 ---> 0a29fe157ea7
Step 4/13 : RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
 ---> Running in 33d5472a0320
Removing intermediate container 33d5472a0320
 ---> 289030b6953d
Step 5/13 : COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
 ---> d21b12b16163
Step 6/13 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}     ADMIN_PORT="${ADMIN_PORT:-7001}"     ADMIN_USERNAME="${ADMIN_USERNAME:-weblogic}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMIN_PASSWORD="${ADMIN_PASSWORD:-""}"
 ---> Running in f83a3bad5d97
Removing intermediate container f83a3bad5d97
 ---> 6bb5a3073c44
Step 7/13 : ENV FMW_PKG=fmw_12.2.1.2.0_wls_Disk1_1of1.zip     FMW_JAR=fmw_12.2.1.2.0_wls.jar
 ---> Running in 4e716494a790
Removing intermediate container 4e716494a790
 ---> 76fdd9a2493d
Step 8/13 : COPY $FMW_PKG install.file oraInst.loc /u01/
 ---> 1407f6c45390
Step 9/13 : RUN  chown oracle:oracle -R /u01 &&      chmod +xr $SCRIPT_FILE
 ---> Running in 0c24be9827e6
Removing intermediate container 0c24be9827e6
 ---> 5eaf260ec2af
Step 10/13 : USER oracle
 ---> Running in a069a933c070
Removing intermediate container a069a933c070
 ---> 0fa1e8c0908c
Step 11/13 : RUN cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - &&     $JAVA_HOME/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server"&&     rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
 ---> Running in 9ff357945a0c
/
Launcher log file is /tmp/OraInstall2017-10-15_01-59-00PM/launcher2017-10-15_01-59-00PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2494.393 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 3855 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 7520 MB    Passed


Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-10-15_01-59-00PM
Log: /tmp/OraInstall2017-10-15_01-59-00PM/install2017-10-15_01-59-00PM.log
Setting ORACLE_HOME to /u01/oracle
Setting INSTALL_TYPE to WebLogic Server
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Validations are disabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.2.0 completed successfully.
Logs successfully copied to /u01/oracle/.inventory/logs.
Removing intermediate container 9ff357945a0c
 ---> 6a5a31abe912
Step 12/13 : WORKDIR ${ORACLE_HOME}
Removing intermediate container 0d6b38ee3a57
 ---> a5172a9ffdf3
Step 13/13 : CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]
 ---> Running in bdfedddc7b2e
Removing intermediate container bdfedddc7b2e
 ---> 692cfcc733f2
Successfully built 692cfcc733f2
Successfully tagged oracle/weblogic:12.2.1.2-generic

  WebLogic Docker Image for 'generic' version 12.2.1.2 is ready to be extended:
   
    --> oracle/weblogic:12.2.1.2-generic

  Build completed in 981 seconds.



List Docker images
[dave@localhost dockerfiles]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
oracle/weblogic     12.2.1.2-generic    692cfcc733f2        2 minutes ago       2.77GB
oracle/serverjre    8                   51c243388334        About an hour ago   269MB
oraclelinux         7-slim              c0feb50f7527        2 months ago        118MB
wildfly-mgmt        latest              3ea63bcef45a        11 months ago       583MB
docker-whale        latest              04c2ee13ff82        12 months ago       256MB
ubuntu              latest              c73a085dc378        12 months ago       127MB
jboss/wildfly       latest              4c99bd2cd264        13 months ago       583MB
hello-world         latest              c54a2cc56cbb        15 months ago       1.85kB
docker/whalesay     latest              6b362a9f73eb        2 years ago         247MB


Build Weblogic domain image

Go to dir
/home/dave/docker/docker-images/OracleWebLogic/samples/12212-domain

Run
docker build -t 12212-domain .

[dave@localhost 12212-domain]$ docker build -t 12212-domain .
Sending build context to Docker daemon   29.7kB
Step 1/10 : FROM oracle/weblogic:12.2.1.2-generic
 ---> 692cfcc733f2
Step 2/10 : MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
 ---> Running in b6c764bf4555
 ---> c42ce3fb8dc0
Step 3/10 : ENV ADMIN_HOST="wlsadmin"     NM_PORT="5556"     MS_PORT="8001"     DEBUG_PORT="8453"     ORACLE_HOME=/u01/oracle     SCRIPT_FILE=/u01/oracle/createAndStartWLSDomain.sh     CONFIG_JVM_ARGS="-Dweblogic.security.SSL.ignoreHostnameVerification=true"      PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}/bin:/u01/oracle
 ---> Running in 2a8fc02da8bf
 ---> b10912a412d6
Step 4/10 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     PRE_DOMAIN_HOME=/u01/oracle/user_projects/domains     ADMIN_PORT="${ADMIN_PORT:-7001}"      ADMIN_USERNAME="${ADMIN_USERNAME:-weblogic}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMIN_PASSWORD="${ADMIN_PASSWORD:-weblogic123}"     CLUSTER_NAME="${CLUSTER_NAME:-DockerCluster}"     DEBUG_FLAG=true     PRODUCTION_MODE=dev
 ---> Running in 0a8c04cdceb4
 ---> 98988294cf7c
Step 5/10 : COPY container-scripts/* /u01/oracle/
 ---> 6552e8159b31
Step 6/10 : RUN mkdir -p $PRE_DOMAIN_HOME &&     chmod a+xr $PRE_DOMAIN_HOME &&     chown oracle:oracle -R $PRE_DOMAIN_HOME
 ---> Running in d98390d3d688
 ---> 7344002fdbc5
Step 7/10 : EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT
 ---> Running in 4b5af2a7a1f7
 ---> b76eba7d94a0
Step 8/10 : USER oracle
 ---> Running in 41d00ab1aff6
 ---> 201878e35274
Step 9/10 : WORKDIR $ORACLE_HOME
 ---> d763bf1840a0
Step 10/10 : CMD ["/u01/oracle/createAndStartWLSDomain.sh"]
 ---> Running in 3782f7fc5ba1
 ---> 187bd2277dd8
Removing intermediate container 4b5af2a7a1f7
Removing intermediate container 41d00ab1aff6
Removing intermediate container 48eef663f19a
Removing intermediate container 3782f7fc5ba1
Removing intermediate container b6c764bf4555
Removing intermediate container 2a8fc02da8bf
Removing intermediate container 0a8c04cdceb4
Removing intermediate container d98390d3d688
Successfully built 187bd2277dd8
Successfully tagged 12212-domain:latest
[dave@localhost 12212-domain]$


List Docker images
[dave@localhost dockerfiles]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
12212-domain        latest              187bd2277dd8        2 minutes ago       2.77GB
oracle/weblogic     12.2.1.2-generic    692cfcc733f2        11 minutes ago      2.77GB
oracle/serverjre    8                   51c243388334        About an hour ago   269MB
oraclelinux         7-slim              c0feb50f7527        2 months ago        118MB
wildfly-mgmt        latest              3ea63bcef45a        11 months ago       583MB


Run the domain image
[dave@localhost dockerfiles]$ docker run -d --name=wlsadmin -p 7001:7001 12212-domain
dd00fa33169ac3c4fbed8df3374632766ce4601694f8434c48b8d8814f9b12f0
[dave@localhost dockerfiles]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                  NAMES
dd00fa33169a        12212-domain        "/u01/oracle/creat..."   30 seconds ago      Up 25 seconds       5556/tcp, 8001/tcp, 8453/tcp, 0.0.0.0:7001->7001/tcp   wlsadmin


Wait for start and then check the Weblogic console via http://localhost:7001/console

Viewing all 181 articles
Browse latest View live