User:Sentmca

=Configuring Opentaps=

Setting up the port
opentapsHome/framework/base/config/offbiz-containers.xml: In that file find the tag named-'http-connector' in that get the tag 'port' and change the port number to what u want.

Note:the default ports are. http: 8080 https:8443.

Database creation
Inordert to run opentaps in our system we need a database created, we need to create database by manuly

Create a database in mysql sever

Example:

'create database opentaps default character set utf8 collate utf8_general_ci;'

Data Base configuragion
opentapsHome/framework/entity/config/entityengine.xml:

in  change localderby to 'localmysql'

Example: 

Under the localpostgres directive, change the “jdbc-uri” attribute to “jdbc:mysql://127.0.0.1/opentaps”.

Change userName and Password according to your local database.

gwt-configuration(Dissable)
This will bring a multilanguage support for framework, right now we don't need this , so we need to dissable it, other wise each time when we compile the application it will take more than 45 minutes.

opentapscommon/src/classes/common/org/opentaps/gwt/common/common.gwt.xml

remover the languages except english which is named 'en'

OR

opentapsHome/build.xml

Find with-keyword: “build” in the line:  Then remove ‘gwt’ Example: 

change ot- 

Issues Faced
JAVA_HOME not pointing to JDK: BUILD FAILED /home/lucas/irccat/build.xml:22: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"

Get the Sun JDK sudo apt-get install sun-java6-jdk then run /********* sudo update-alternatives --config java ***********/ and select the option that has the path /usr/lib/jvm/java-6-sun/jre/bin/java

Solution

sudo update-alternatives --config java

change the alter nate java which is listed

Note: Don’t use OpenJDK. opentaps will not build in OpenJDK. Use SunJDK.

If JAVA is not installed in your system:

Find Java Path sudo whereis java if not found go for next step.

Installing java

sudo apt-get install sun-java6-jdk sun-java6-bin sun-java6-jre

If problem presists like

E' package not found or it not an installation candidate. then add to repository.

Adding to Repository

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

Setting up java_home
cd ~ /-- getting into home sudo gedit .profile / opening the profile file which will efect only the user who logged in(careful wile editing ,, it may cause the operating syste to crash)

At the end of the file add the follwoing line:

export JAVA_HOME=”/usr/bin/java”

Ant run commands
sh ant clean-all sh ant build sh ant run-install sh ant run-install-seed sh ant run

Statrofbiz commands
./startofbiz.sh tail -f runtime/logs/console.log ./stopofbiz.sh

Compiling Single Component
java -jar ../../framework/base/lib/ant-launcher-1.7.1.jar

=Running Examples in opentaps=

Hello1
create a folder 'hello1' inside opentapsHome/hot-deploy

inside that folder create file ofbiz-components.xml and webapp folder.

Inside that folder our application will take place.

In applicationfolder ie, hello1 we will have WEB-INF directory, inside that we have web.xml, controller.xml.

The controller.xml is an important file for every application, we need to pay attantion while creating this file.

Issues:

In helo 1 application mostly you will recive the error,

' ftl texplate location is not found'.

Solution: need to add a handler tag in the controller.xml file in side the tag we have to give the template location of ftl.

Hello2
We are implementing the hello1 application,.

Just duplicate and rename the hello1 component

Here we are createing a common screen, and add the other screens as the body content of that component.

Issue

in hello2 the common issue is retriving data from a databse,

solution: 1. check the databse wether 'people' table has the data, if it's not then 2. give '” sh ant run-install-seed”. 3. check the correct syntax in the people.ftl file 4. and check the people.bsh file

Hello3
Here we are creating a service using java file, so we nee to build the component,

the java class files needs to put in the appropriate folder automatically

we nee a build.xml file,

for that we need to create a component using ant

use command sh ant create-component.

And give component-name, webappname, base permission.

Issue:

The most common issue is

' service invocation error'

solution: 1. check in controller.xml, wether the service is called correctoly 2. check src/org/ofbiz/Hello3Services.java 3. check sercicedef/services.xml file wether the path is given correctly 4. check Hello3Services.xml file

Issue

'Screen render error'

solution:

This will happen due to the database connection problem.

You can reduce this type of problem by using the database form your local system.

Issue: while building the application, you may receive a compilation error in Hello3Services.java file ie,. Type miss match error.

Solution GenericDelegator delegator=dctx.getDelegator; modify this line to GenericDelegator delegator=(GenericDelegator)dctx.getDelegator;