Tag Archives: maven

Running Appfuse demo ‘tutorial-jsf’

Appfuse JSF war didn’t work. It drove me crazy !!

I wanted the working versions of http://demo.appfuse.org/ . But i couldn’t get through.

Then I found http://code.google.com/p/appfuse-demos/ . I downloaded the ‘appfuse-demos-2.0.2.tar.gz’ . I was working on windows XP. I extracted the files through WinRAR and found different demo apps as shown in the live demo are organized in different folders. They are…

helloworld
struts2-crud
tutorial-hibernate
tutorial-ibatis
tutorial-jpa
tutorial-jsf
tutorial-service
tutorial-spring
tutorial-struts2
tutorial-tapestry
I chose ‘tutorial-jsf’. It is combined with JSF-Spring-Hibernate-ACEGI. All the things, that I was looking for.
I use Eclipse 3.4.2 as my working IDE. So I headed for http://appfuse.org/display/APF/Eclipse to make it work in my workbanch.
I extracted the ‘tutorial-jsf’ folder from ‘appfuse-demos-2.0.2.tar.gz’ and got into that folder through command prompt.
It is not a eclipse project. So, I had make it in such a way that I can Import it in my eclipse workspace and develop it further.
I ran the command ‘ mvn eclipse:eclipse ‘ .
Maven downloaded hell a lot of dependencies and took pretty much time. After a while it was ready to Import in eclipse.
I launched Eclipse and went to File > Import > Existing Projects into Workspace (under the General category). Selected the ‘tutorial-jsf’ directory and Clicked Finish to complete the process.
Now, tutorial-jsf is finally is in my workspace.
Now all I need is to run it. I had tomcat 6 in my eclipse. But it was unable to run it. So i looked into the above mentioned tutorial and found that it will run in Jetty WebServer.
I ran the command ‘mvn jetty:run-war‘, in the ‘tutorial-jsf’ directory from the Command Prompt.
It took a while for running for the first time and finally it was running.
I loved to see its running in my machine.
Now, I need to find a way to run it in tomcat and make some changes.
Advertisements

Hunting for Appfuse War

I’m impressed with appfuse.

All I needed is the code in my working environment. But, the problem started that time. Maven was able to connect to its repository. But it failed to execute only one command. In the AppFuse QuickStart, I generated the maven command, that I have to execute from my working computer. I wanted a JSF project, so generated the command accordingly..

mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-jsf-archetype -DarchetypeVersion=2.1.0-M1 -DgroupId=com.mycompany -DartifactId=myproject

I was working on the internet behind a proxy. So, my maven wasn’t able to connect to its repo automatically. But, I configured it to connect to the internet, as i described it in my previous blog. But this time, I couldn’t execute the above command for unknown reason. It was showing connection timeout error.

So, I was looking for war, which is deploy able tomcat 6.

And I found it at http://www.jarvana.com/jarvana/inspect/org/appfuse/appfuse-jsf/2.0.2/appfuse-jsf-2.0.2.war

I have just got it. Lets see, whats in it.

Setting Proxy Information for maven

I was working on a J2EE app on my new work place.

I was doing the first thing for starting development… Building my frame work…

On my way I needed to connect maven repository through maven.

But I couldn’t. I was eating connection timeout error.

Suddenly I remembered, the network guys of my new workplace provided me proxy address n port and username – password to connect to the internet.

So i wanted maven to know that.

Then I googled for my problem and found some solution.

I was working on Windows XP and I installed maven in C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\

In C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\conf there is a file “settings.xml”

I found the bellow block

<proxies>
<!– proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
–>
</proxies>
I just replaced it with
<proxies>
<proxy>
<id>mavenconnecttointernet</id>
<active>true</active>
<protocol>http</protocol>
<username>myproxyusername</username>
<password>myproxypassword</password>
<host>myproxyipaddress</host>
<port>myproxyport</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
</proxies>
Then maven was able to connect to the repository.