Posts Tagged ‘WebLogic’

Maven + GWT
I needed to create a GWT project using maven again. The original post lacked some details. This time, I got it to work with a slightly different steps. First, I ran the following command:

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchtypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.4.0 -DarchetypeRepository=repo1.maven.org

Somehow, Maven didn’t pickup the group ID and artifact ID. So, I had to choose from one of the listed item.

Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 337
Choose org.codehaus.mojo:gwt-maven-plugin version: 
1: 1.1
2: 1.2
3: 2.1.0
4: 2.1.0-1
5: 2.4.0
Choose a number: 5: 5

Next, I defined the properties for my project.

Define value for property 'groupId': : com.my.app.package.name
Define value for property 'artifactId': : directoryNameForTheGeneratedProject
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  com.my.app.package.name
Define value for property 'module': : moduleName

Now I can run the generated module with the following command. This will bring up a console. All I have to do is copy the URL and then past it in the browser.

mvn gwt:run

Maven + Eclipse
Next, I followed the instructions on this page to run the following command within the project folder to enable support for Eclipse:

mvn eclipse:eclipse

Then, I use Eclipse to import existing project into workspace to open the project. Eclipse complained that the default directory for the project should be set to /PorjectFolder/src/main/webapp/WEB-INF/classes Since I want to use Maven to build, I ignore the error by right click on the error, choose quick fix, choose Do not use the WAR directory for ProjectName launching and deploying (this disables management of WEB-INF)

Maven + WebLogic
I noticed that the JRE libraries were referencing version Java SE 7 jars, I changed it to 6 so the project will be compatible with WebLogic 11g. For WebLogic 12c, see this post.

I followed the instructions to configure WebLogic 11g with Maven. The available commands for 11g are slightly different from 12c. They are are deploy, help, list-apps, redeploy, start-app, stop-app, undeploy, update-app. Once I completed the configuration, I was able to run mvn weblogic:list-apps command. Next, I ran mvn package to create the WAR file before attempted mvn weblogic:deploy. I was able to load the application in my browser! :)

While attempting to crate a domain on the command line, I encountered an error complaining about missing terminalio. A looked around the web led me to this tip on how to work around the issue by adding the following parameter:

-Dweblogic.management.allowPasswordEcho=true

Maven and WebLogic 12c

Posted: February 29, 2012 in howto, Technology
Tags: , ,

Today, I tried to use Maven with WebLogic 12c. The documentation for installation is straight forward. I was able to execute mvn wls:help without any difficulty.

However, using the WebLogic plugin wasn’t as easy. In order to run commands such as mvn wls:start-server, I needed to configure various parameters, such as middlewareHome, domainHOme, user, password, and name. Instead of specifying these parameters every time I run the command, I added the following config to pom.xml:

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
            com.oracle.weblogic:wls-dev:zip:12.1.1.0
        </artifactLocation>
        <middlewareHome>/export/apps/wls</middlewareHome>
        <domainHome>/export/apps/wlsdomains/d1</domainHome>
        <user>weblogic</user>
        <password>welcome1</password>
        <name>applicationName</name>
    </configuration>
 </plugin>

After that, I was able to run the following commands without manually entering additional parameters. :)

mvn wls:start-server
mvn wls:deploy
mvn wls:list-apps
mvn wls:undeploy
mvn wls:stop-server

Initially, I noticed the following error when attempting to deploy/undeploy the web app. This appears to go away after I restarted the server.

[ERROR] Unknown lifecycle phase "applicationName". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException

This howto helped me to create a GWT project using Maven. It even allows me to run the GWT project in development mode with Jetty, very sweet!

On the other hand, OEPE’s Weblogic plug-in doesn’t play nice with GWT based project. Looks like I’ll continue use Maven to build WAR files.

When I tried to add an Oracle WebLogic Server 12c as a new server runtime to a project in OEPE (Eclipse), OEPE refused to recognize the information I entered. Fortunately, Daniel G. told me that I have to select the wlserver folder first, then backspace a few times to remove wlserver from the path and type in the wlserver back to trigger the screen to fresh. The goal is to change the path using different ways to trigger a refresh action, which doesn’t get triggered when it supposed to. Once I was able to trigger the fresh action on wlserver folder, OEPE was able to recognize the server runtime installed in the folder. ;)

This definitely worth a bug on OEPE!