Posts in: January, 2015

Adempiere 3.6 Java Version Update

The following article describes how to make Adempiere 3.6.0 version work on systems with JAVA Versions greater than 7 .The following code Update will help you install Adempiere 3.6 on systems who currently doesn’t have JAVA 6 installed on them.

Do made the following changes in the Code and then build the Adempiere from Eclipse and use it on system which even have JAVA 7 installed on them. Once installed on systems with JAVA 7 we can also run the server on JAVA 7 systems and perform all the operations. We have tested this on system with JAVA 7 installed.

Do note that the system in which initially code is changed and build is made should have JAVA 6 installed. Once build is made from JAVA 6 system after the aforementioned code changes then that build can be deployed on JAVA 6 and upper versions.

 

The Code Changes are as follows:

  1. In Login.java find and replace the method isJavaOK() with the code

public static boolean isJavaOK (boolean isClient)

{

//            Java System version check

String jVersion = System.getProperty(“java.version”);

//AB

//                            if (jVersion.startsWith(“1.5.0”))

//                                            return true;

//                //vpj-cd e-evolution support to java 6

//                if (jVersion.startsWith(“1.6.0”))

//                                            return true;

//                //end

//                if (jVersion.startsWith(“1.7.0”))

//                                            return true;

//                if (jVersion.startsWith(“1.8.0”))

//                                            return true;

float v_JavaVersion=getJAVAVersion(jVersion);

if(v_JavaVersion>=1.6)

returntrue;

//AB

//  Warning

boolean ok = false;

//            if (jVersion.startsWith(“1.4”)

//                            || jVersion.startsWith(“1.5.1”))                //  later/earlier release

//                            ok = true;

 

//  Error Message

StringBuffer msg = new StringBuffer();

msg.append(System.getProperty(“java.vm.name”)).append(” – “).append(jVersion);

if (ok)

msg.append(“(untested)”);

msg.append(”  <>  1.5.0″);

//

if (isClient)

showMessageDialog(null, msg.toString(),

org.compiere.Adempiere.getName() + ” – Java Version Check”,

ok ? JOptionPane.WARNING_MESSAGE : JOptionPane.ERROR_MESSAGE);

else

log.severe(msg.toString());

return ok;

}   //  isJavaOK

 

2. Add the method at the end of the class Login.java

public static float getJAVAVersion(String jh)

{

int n=2,a=0;

for (int i = 0; i < jh.length(); i++)

{

if (jh.charAt(i) == ‘.’)

{

n–;

if (n == 0)

{

a=i;

}

}

}

return Float.parseFloat(jh.substring(0,a));

}

3. Replace the following code in test() method in ConfigVMSun.java

 

                public String test()

{

//            Java Home

File javaHome = new File (p_data.getJavaHome());

boolean pass = javaHome.exists();

String error = “Not found: Java Home”;

if (getPanel() != null)

signalOK(getPanel().okJavaHome, “ErrorJavaHome”,

pass, true, error);

if (!pass)

return error;

//            Look for tools.jar to make sure that it is not the JRE

File tools = new File (p_data.getJavaHome()

+ File.separator + “lib” + File.separator + “tools.jar”);

pass = tools.exists();

error = “Not found: Java SDK = ” + tools;

if (getPanel() != null)

signalOK(getPanel().okJavaHome, “ErrorJavaHome”,

pass, true, error);

if (!pass)

return error;

//

if (CLogMgt.isLevelFinest())

printProperties(System.getProperties(), “System”, true);

//

log.info(“OK: JavaHome=” + javaHome.getAbsolutePath());

setProperty(ConfigurationData.JAVA_HOME, javaHome.getAbsolutePath());

setProperty(ConfigurationData.JAVA_HOME, javaHome.getAbsolutePath());

//                            Java Version

//AB

//                                            final String VERSION = “1.5.0”;

//                                            final String VERSION2 = “1.6.0”; //            The real one

//                                            final String VERSION3 = “1.7.0”; //            The real one

//                                            final String VERSION4 = “1.8.0”; //            The real one

//                                            pass = false;

String jh = javaHome.getAbsolutePath();

String[] array=jh.split(“jdk”);

jh=array[1];

float v_JavaVerfrmHome=Login.getJAVAVersion(jh);                                                     //JAVA Home Check

if(v_JavaVerfrmHome>=1.6)

{

pass = true;

}

//                                            if (jh.indexOf(VERSION) != -1)   //            file name has version = assuming OK

//                                                            pass = true;

//                                            if (!pass && jh.indexOf(VERSION2) != -1)              //

//                                                            pass = true;

//

//                                            if (!pass && jh.indexOf(VERSION3) != -1)              //

//                                                            pass = true;

//                                            if (!pass && jh.indexOf(VERSION4) != -1)              //

//                                                            pass = true;

//AB

String thisJH = System.getProperty(“java.home”);

if (thisJH.indexOf(jh) != -1)         //            we are running the version currently

{

//AB

String thisJV = System.getProperty(“java.version”);

//                                                            pass = thisJV.indexOf(VERSION) != -1;

//                                                            if (!pass && thisJV.indexOf(VERSION2) != -1)

//                                                                            pass = true;

float v_JavaVersion=Login.getJAVAVersion(thisJV);            //JAVA Version Check

if(v_JavaVersion>=1.6)

{

pass = true;

}

if (pass)

log.info(“OK: Version=” + thisJV);

}

error = “Wrong Java Version: Should be equal to or more than 1.6”;

//AB

if (getPanel() != null)

signalOK(getPanel().okJavaHome, “ErrorJavaHome”,pass, true, error);

if (!pass)

return error;

//

setProperty(ConfigurationData.JAVA_TYPE, p_data.getJavaType());

return null;

}              //            test

 

4.  After the ConfigVMSun.java Import Login.java class

5.  That is All.

 

After the following changes we will be able to run the setup and login on system with JAVA 6 and above and run  server from it.

 

In case of any Queries do leave a comment and we will be happy to help!

 

 

 

 

-Adempiere Support { India Portal }

Read More

Enterprise 2.0 Window Customization Module

The customization values defined here overwrite/replace the default system definition if defined.

In this module we learn how to customize the windows of Adempiere and grant or revoke access of any user or any role to any Window or any Tab or to any field.

The Customization is up to such an extent that admin can restrict the excess of user to any tab in a Window and rest all tabs can behave normally with all the functioning possible.

image001

Using Window Customization Module:-

  1. Open Window Customization module in E2, and select either Role or User.

NOTE: You cannot select both Role and User in Window

  1. Select Window Name from dropdown and insert name in field and select if you want to impose any check on the Window level.
  1. The following tick boxes are same in Window  level and Tab level such that and the purpose for the tick boxes are also same in Tab Customization tab and will be explained earlier.
  1. Ticking any box will enable the following on the Window Level.

 

   

BUTTON

FUNCTION

  1. Restrict New
Restricts New Button in the selected Window
  1. Restrict Delete
Restricts Delete Button in the selected Window
  1. Restrict Save and Update
Restricts Save Button in the selected Window and even restricts auto save and auto update in E2
  1. Restrict Delete All
Restricts Delete All Button in the selected Window
  1. Restrict Report
Restricts Report Button in the selected Window
  1. Restrict Print
Restricts Print Button in the selected Window
  1. Restrict Export
Restricts Export Button in the selected Window

 

  1. Following is the Tab Customization Window in which we can select the tab which is related to the windows selected and select the tick box

image003

  1. If any tab level customization is needed then we can apply this in here and rest tabs on window go on unchanged.
  2. Following is the Field Customization Window in which we can select the Field which is related to the tab selected and select the tick box

image005

 

   

BUTTON

FUNCTION

  1. Hidden
Restricts Display of Field in the tabAnd makes it hidden
  1. Read Only
Makes Field Read Only in Tab and Window

 

  1. Select the field to be customized for the user and apply the corresponding check on the field.
  2. Once we save the record for the user or the Role the changes are applied instantaneously and opening a window after saving will reflect all the changes in the window.

 

The Exact Packout for the Window Customization and Code  Patch for the above functionality will be added soon. Please stay in touch.

 

 

 

          -Adempiere Support {India Portal}

Read More

Dashboard Management

Adempiere has very good mechanism to show a glimpse of overall enterprise performance at single location through dashboard concept. Using dashboard, user can see all the required information in one place. Following is the screenshot of the Dashboard:

image001

With the help of Dashboards, we can show the user whatever he wants from the System and hence can fulfil the user Requests about anything. For e.g. if a user want to know which are the new joined Business Partners we can make a Bar Chart and then we can completely scale the data as present.

Here it shows the Invoice Gross Revenue and Service Requests Status which on double click shows the respective menus and hence shows the data related to that performance parameter.

While we create the dialler for the process, which will show the status of the new added customers

image003

[divider]

Creating Dashboard in Adempiere

  1. In Order to create Dashboard Elements we need to follow the steps as mentioned below:
    1. Open the Performance Goal Window found in System Admin and enter the data as follows:

image005

Here enter Name of the Dashboard widget and color schema should be selected as “Green (50) – Yellow (100) – Red”.

  1. Select the Role and User if you want to specify this or restrict this dashboard modification to a particular user.
  2. Select the Measure from the Measure check box. If not defined we can define the Measure with the Performance Measure Window.

image007

  1. Select Measure Calculation and select the measure here.

image009

  1. Add SQL Query in the Performance Measure Calculation, which retrieves the data to be shown in the actual widget. i.e For e.g  if we want to view only the Number of Customers which are new then we need to use the SQL select query and this will select all the customers.
  2. Select the Measure Scope and Measure Display in the Window in point 1 and select the month and year in the Measure Window.
  3. Once you define the Measure Goal completely , the dial board will be visible .
  4. In Order to display the Grid with data in it , we need to create record in it which can be done as follows:

image011            5. Here add the Grid Name and Select the Goal and window to be linked with the Grid which will be                      displayed on the dashboard.

 

The Dashboard will be created hence, and we will get the desired dashboard widgets on the Dashboard. The look and feel can be changed once dialler is displayed.

 

 

 

 

 

-Adempiere Support {India Portal}

Read More

Window, Tab & Field – Adempiere

The Window Tab defines each window in the system. The default flag indicates that this window should be used as the default Zoom windows for the tables in this window.

Table Name: AD_Window

image001

Here we will define the new Window and create tabs later like the following:

Description : Tab definition within a window holds fields

Help : The Tab Tab defines each Tab within a Window. Each Tab contains a discrete selection of fields. Note that the display and read only logic is evaluated when loading the window.

Table Name  : AD_Tab

image003

  1. While defining TAB define the table, and create fields in the tab come to field sequence and arrange the sequence of fields.

Table Name  : AD_Field

image005

If we wanna change the name of fields we can  do it from here .

2. The Field Tab defines the Fields displayed within a tab. Changes made to the Field Tab become visible after restart due to caching. If the Sequence is negative, the record are ordered descending. Note that the name, description and help is automatically synchronized if centrally maintained.

Table Name  : AD_Field

image007

Points to Note in creating Window, Tab & Field

 

  1. Create Window , Tab & Field and then in Tab Window define the table allotted with the tab and then create Fields.
  2. ReArrange Fields from the Field Sequence and edit any fields if needed modification on the Window level.
  3. Edit the name of the fields and modify the spaces and Alignment of the field.

 

Points to Note in Defining Window, Tab & Field:

ERROR TYPE 1

  1. When u create window and tab and after performing all the processes trace back to the table and column and allocate the window in the table and column main tab such that we allocate the window to the Table

 

ERROR TYPE 2

 

  1. If we fail to define the window in the Table and Column level the following error will be displayed:

Window ID Invalid

And in case of Desktop Client the  Zoom is disabled.To enable the zoom in the existing tables select the window and allocate in the table

 

ERROR TYPE 3

  1. The Reference can be defined on 2 phases in Adempiere
  2. Table level
  3. Window Level

image009

 

  1. Here reference can be over rided that is defined in the table level, such  that we can use it to retrieve the values of table in extreme cases:
  2. For e.g we can see such an example of extreme case in which reference overwrite is helpful:

In case of Visitor Management we have defined doors which are used by the visitor for the entry and exit . We have used 2 columns for entry door and exit door and we need to show in both, the data stored in Door Master Entrance Door.

If we take 2 columns Entrance Door ID and Exit Door ID in the table and use Table Direct to retrieve the data then the data will be definitely retrieved but we will face errors while Model Class Generation as the complier will try to find the table Exit Door. Hence we need to modify the Reference Type set on the Table Level.

 

  1. For Such cases we need to override the reference and use in Window Tab and Field and select the reference as ‘Table’ and define the reference here.

 

 

ERROR TYPE 4

  1. While making a Tab Read Only we need to tick on the tick box on the Tab Field which is like this

image011

As Seen here we have 2 tick boxes Read Only and Insert Record on the Tab Level.

Now when we click on Read Only and save the record we will notice the fact that the insert

Record is automatically disabled and even if we uncheck the read only the Insert record still  remains disabled here .

Even if we open the window tab and field again and uncheck and check again the Insert Record remains disabled.

We need to manually tick the Insert Record again in order to make the record work such

the record insertion is enabled in the tab.
 

 

 

 

 

 

 

                                                                                                                                                                -Adempiere Support {India Portal}

Read More

INTEGRATING IREPORTS WITH ADEMPIERE

 

Integration with ADempiere was started by Trifon helped AlejandroJohannes and Heng Sin.

JasperReports is a powerful open source Java reporting tool that has the ability to deliver rich content onto the screen, to the printer or into PDF, HTML, XLS, CSV and XML files. JasperReports will allow you to generate wonderful reports, including reports with subreports into them.

Deploying IReport in Adempiere – Internal and External :-

  • External Report – These are those reports whose menus are created by us , and parameters are defined by us and when user clicks on it the parameters are passed on the report and the report is called. In Order to create and integrate such report performs the following steps.
  • Create the Report in the IReport tool or any JasperSoft Tool such that the report is being compiled and running on the IReport.
  • While defining the parameters make sure the name is same as DB Columns in table.
  • Once the report file is made segregate the report in the war file.
  • War file can be created in eclipse by creating a new project and then exporting it to WAR or importing already created war in eclipse so that the reports can be added in the project.
  • Once Reports are added in the WAR file u need to transfer this file to the right destination which is in ServerOssagho_2.0OssaghojbossserverAdempiereDeploy . And paste the War file here.
  • Once the War file is kept on the place, u need to create report process in the AD i.e on the front end.
  • In Order to create that , login  with the System Admin provision and go to Report and Process menu and click on new button.

image002

  • Enter the name and select the path of report in the AD tool such that the report  can be accessed

image004

  • Go to the Parameter tab and create Parameters such that  the names are similar to the parameters created in IReport. For Instance the parameter for Product is defined as follows:

image006

  • Here System Element is the DB column name, which is already in DB while the DB Column name will always be similar if anything is present in the System Element Field.
  • Reference used here is Search such that when the parameter appears we get a drop down of all the Products.
  • The Mandatory and Default Logic Fields are optional such that if the client wants any parameter to be mandatory or some default value to be passed in the parameter every time it is left empty.
  1. Once the Parameters are done you need to create the menu for the report and segregate the report in the AD menu. It can be done by clicking new button in Menu Window and then choosing “Report and Process” in Menu Tab .
  2. Once Menu is created you can move it to any Folder u want, or if detailed Segregation is needed, we can also create folders.
  3. Logout from System Admin and login Hero Admin mode and run the report after Inserting Parameters
  • Internal Report :- These are those reports which are applied internally and for whom menus are not created , they are just used for prints of orders, receipts and invoices or any window or any form in Adempiere.These reports can be applied on the window as follows:
  1. Create the Report in Ireport such that the report is created with just a single Parameter in Ireport i.e. Record ID.
  2. Here Record ID should be the ID that is automatically passed to the Report when we segregate it as Internal report
  3. Once the report is made you need to create a Report in Front End in Report & Process as follows:

image008

 

  • Here the Changes from the external report are
  1. Click on the Report checkbox , making it an Internal Report
  2. In the Classname you can optionally add “org.compiere.report.ReportStarter”.
  3. In Parameters tab we will not add any Parameters as the only parameter in the report is Record ID which will be automatically passed on to the Report.
  • Once we have added the Report in Report and Process we will now define it in the form we need to create such that AD knows which report is associated with which window.
  • As the above report is for Purchase Invoice Window we will Add it in the Purchase Invoice Window. This will be done as follows:
    1. Open Window Tab & Field and search for Invoice(Vendor) and open the first or the Main tab of the Window.

image010

  1. Here as shown in the Process field enter the report name which is created and save it.
  • Now the Internal Report will function on the click on Print Preview in the Desktop  Version and Print Button in Web UI Version.

 

Points to Note in while Integration of Reports:-

  • Parameters Name in IReport should be taken utmost care and the name should be same as the columns created in the DB. To make sure the name is same both you could use the help of E2 desktop or Web Version and login in System Admin and open Report & Processand open Parameters tab as shown below

image012

  • While Creating a Report with the List Parameters in It, make sure u define list as the reference as shown below.

image014

 

  • Create reference key such that it must contain the same Search key as parameters used in Report as shown in the screen below.

image016

  • Here we have used, N and Y as the Search key for sale and purchase such that we will pass these to IReports at Runtime.
  • Do keep in Mind as to not Insert DB Column in list Parameters even if it exists in Database as that will lead to non Running of report.

 

In Case of Report not working or Displaying Blank Pages following  are the Cases that can occur, Do check these Cases:

  • Check number of Parameters in I Report and Parameters in AD and match the Parameters.
  • Once parameters are same, you need to check that there are no spaces in the Parameter name in iReport, In Such Cases the Report will work in IReport but the same will not work in Adempiere .
  • Organization Parameter also needs to be always added in every Report as it is necessary.
  • For Debugging the Report do look at the Console and find out what exactly is the error.
  • For checking the Path copy the Path and Paste it onto Browser and see if data is retrieved, if we get error means path needs to be corrected.
  • Do make sure that the Server is switched On , else reports won’t work at all, this can be found out by using web UI.
  • Use 7 Zip for changing the report data, or adding data in already prepared WAR file, this saves the time and energy wasted while using Eclipse but this should only be used for quick changed and minor touch ups.
  • Open the WAR file with 7 Zip and double click on the Report you would like to edit
  • Edit the report and compile it and close it and make sure    you select the OK in the Reflect Changes box.

 

Exporting IReport to Excel in E2

POINTS TO REMEMBER

  1. When we create IReport in Jasper Reports and export it on click of Print Button of Adempiere E2 Client. Following are the points you need to keep in mind:-
    1. The Field Alignment should be always correct as shown below:

image018

 

  1. As shown above the following errors are in the above PF Contribution Register which need to be removed here:-
  •    Organization and PF Contribution Register are overlapping which results in mislap of the field in the Excel Export.
  • When u export such ireport to excel you will get the  following output.

image020

  •   As shown above the following excel export has skipped columns i.e A to Z are not in sequence and some fields are missing like Organization name due to the overlapping.

[divider]

In Order to remove these errors you need to incorporate the following changes while creating or editing the report

 

  • Do not overlap any fields on one another as this may lead to hiding of columns in excel. In order to check the point that no field overlaps one another select all the fields

image022

  • Keep all the fields in the same line and make sure that the fields on top and bottom also stay in the same line as follows:

image024

 

 

 

-By Adempiere Support {India Portal}

Read More

Application Packaging Enhancements – With Packout and Patch

Basic Introduction of PackIn and Pack Out

Pack In and Pack Out are the two features Adempiere provide so as to migrate objects from one Client to another. These modules can be ranging from a simple Reference Object to a Complete Module of the project which needs to be exported to the new client.

2 Pack runs with simple concept of export and import, where required data will be exported from source environment and it will be imported into target environment. In Adempiere, export of data is called ‘Packout’ and Import of data is called in ‘Pack in’. In this document often we will be using these words.

Here if we will take a look at the Pack out Module we will notice that on the main header tab we have fields for the name and other area as follows:-

pic1

Here as we can see we have the module name filled in the Header Tab and we define the path of the creation of Packout Module here.

We also define the Packout Version here , displaying what is the vesion of the module we are packing out.

Once Header line is created we need to create the detail line in the Packout tab as follows:

pic2

In this Pack out Module we have Provision to Pack Out the following objects:-

 

  1. Application or Module – Exports the complete module which is not present in the new Client
  2. Code Snipit – Exports the Code Snipit, Identifies the old code and replaces with the new code.
  3. Data – Exports the data in the tables such that we have the data in the new table of the Database.
  4. Dynamic Validation Rule – Exports the Dynamic Validation Rule of the Adempiere
  5. Entity Type – Exports the Entity Type to the new Client.
  6. File Code or Other – Exports File Code with Source Code and Target Directory and Source Directory
  7. Form – Exports the Form such as POS Form into some new Client which doesn’t has the POS form or any other form available.
  8. Import Format – Exports the Import Format of the Module which is used to import the Files in Adempiere.
  9. Message – Exports the Message from one client to another.
  10. Model Validator – Exports the Model Validator of the Adempiere such that new Model Validator is created in the new Client.
  11.  Print Format – Exports the Print Format of the Report from One Client to Another
  12. Process/Report – Exports the Report or Process from one Client to another.
  13. Reference – Exports the Reference from one Client to another.
  14. Report View – Exports the Report View from one Database to another or one client to another.
  15. Role – Exports the Complete Role from one DB to another
  16. Rule Engine Packout – New Export Added for Exporting the Rule Engine Rule from one DB to another, includes Callout too.
  17. SQL Statement – Exporting SQL statements based on the DB Type in the new DB from the old DB.
  18. Table – Exports the Table from one Module to another such that all the Columns are exported to the new Table.
  19. Window – Exports the Window in Adempiere such that all the Tabs and Fields are exported to the new DB and we get the new Window in the new Module
  20. Workbench – Exports the Workbench in Pack out Module such that new Workbench is created.
  21. Workflow – Exports the Workflow created and stored in the new DB.

 Enhancement in the Packout Module

As shown below following are the Modules that are available for Pack Out and we will study about the new module developed in deep:

pic3

The new added is the Rule Engine Packout added in the Package Details tab which will export the Rule Engine:

 

For Exporting we just need to select the corresponding rule and add in the detail tab and it will be exported.

pic4

 

 

Points to Remember while Pack Out and PackIn in Adempiere

  • While PackIn we need to check the Update System Application Dictionary Checkbox such that all the Dictionary elements are also created in the PackIn Stage.

 

  • While Exporting a Module we need to take care all the modules needed with that module are collaborated in the Packout Details Tab.

 

  • For e.g If there is a Callout used in the Document Management Module and we need to export the complete Module then that callout should also be added in the Packout else Incomplete Module will be Packed Out leading to non functioning of Module.

 

The Exact Packout for the enhancement and Code  Patch for the above functionality is given below. Please stay in touch.

Application Packaging Enhancements

For Using: Just PackIn the Packout after ticking Update System Application Dictionary also and Place the patch in patches folder and run setup or silent setup again and we will get the desired changes on our System.

 

 

                       -Adempiere Support {India Portal}

Read More

Tracing Errors in Adempiere and Correcting them!

[divider]

Errors in Setup

The following errors can be faced while Setup and given are the ways to correct them:

  • Application Server or Database Server is the name, URL or IP of your server PC.
  • JNP Port = 1099 error means that a previous service is running. Kill it. Also, since this is the first port that is tested, it could also mean that you have a mismatch between your host name (in the hosts file) and your actual IP address. Fix it in “/etc/hosts” (linux)
  • Database Port = 1521 error can be solved by restarting DB machine.
  • System & Database Passwords are those defined when you setup your Database.
  • Mail Server is optional. RUN_Setup can still finish without it.

[divider]

Java Home Error

The error faced when u click on Test

If you receive the following message:

image001

You should check your java environment variables. Check that the JAVA_HOME system environment variable points to the correct directory. Set the PATH in such case and if everything fails try to install JAVA again. The error should be removed in such case.

[divider]

Web Port Error

If you receive the following message from the installer:

image003

it is likely that you have some other web server running or, if you are using Linux, you need the appropriate privileges.

The default ports are: 80 for http connections and 443 for SSL connections. This message means that the user is not allowed to use the port, likely because it is already used by another application. Change the port to something else. Web Port 8088 and SSL 4443 are recommended. If you are using Linux, remember that ports under 1000 need root privileges. If you are using Oracle database, port 8080 might be used.

[divider]

JNP Port 1099 Error

Another possible error is Server Setup Error JNP Port (Not correct: JNP Port = 1099) OK

The JNP Port = 1099 error can be caused by another process which is already attached to that TCP port. Take a look what process is using this port and so you can take steps to stop it. It can also be caused by a mismatch between your IP address and the entry in your hosts file.

[divider]

JNP Name Not Found Exception

This error is usually related to a DNS problem. It is possible to complete the setup using IP addresses when installing with PostgreSQL. Make sure you have a working DNS environment or add an entry in /etc/hosts(linux) or %SystemRoot%/system32/drivers/etc/hosts(windows).

[divider]

Errors Faced in LinuX

  1. When deploying build on Linux and faced any unknown Exception like some java Jar missing in deployment , re install the JAVA as it is the only way out for the problems with the missing JAR’s .

Such Errors are faced due to discrepancy in JRE and JDK of Java, or only JRE is installed and hence error is coming. ReInstall the JAVA and such errors will be removed.

  1. In case of Software on Linux we need to take care that complete commands must be executed i.e rpm must be executed in case of Linux in rpm files and for further commands Google can be referred.
  2. In case of errors faced in the linux Distro stick to the community for genuine Solutions and remedies.
  3. Before Solving or searching for any error make sure that the environment is correct and all the PATH of the variables are correctly set. This can be achieved by the following commands:
    1. Find JAVA version by the following command in linux or windows

                  i.      java –version

  1. Make sure that the JAVA version is greater than or equal to 1.6.0.45 .
  2. If JAVA version is less than mentioned version , make sure that latest version of Java is installed on client system
  3. Once JAVA is installed if we are still getting the version as 1.5.0 or anything else less than 1.6 we need to do the following:

                            i.      IN WINDOWS

  1. Set the path for the latest version of JAVA by right clicking the My Computer and hence changing the variable.

                          ii.      IN LINUX

  1. Go into the directory of new installed JAVA

[root@localhost /]# cd usr/java/jdk1.6.0_45/

  1. Once u are in directory you need to run the following command

[root@localhost jdk1.6.0_45]# alternatives –config java

  1.  This will provide us with all the options of java installed, if the current java i.e the latest version of JAVA is not shown then do the following:

[root@localhost jdk1.6.0_45]# alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_45/bin/java 2

4.   This will give the following screen to us: Select the new version of JAVA here

[root@localhost jdk1.6.0_45]# alternatives –config java

There are 2 programs which provide ‘java’.

  Selection    Command

———————————————–

*+ 1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java

   2           /usr/java/jdk1.6.0_45/bin/java

 

Enter to keep the current selection[+], or type selection number: 2

 

  1. Run the following commands after wards to set the JAVA_HOME and PATH Variable

[root@localhost jdk1.6.0_45]# alternatives –install /usr/bin/jar jar /usr/java/jdk1.6.0_45/bin/jar 2

 

[root@localhost jdk1.6.0_45]# alternatives –install /usr/bin/javac javac /usr/java/jdk1.6.0_45/bin/javac 2

 

[root@localhost jdk1.6.0_45]# alternatives –set jar /usr/java/jdk1.6.0_45/bin/jar

 

 [root@localhost jdk1.6.0_45]# alternatives –set javac /usr/java/jdk1.6.0_45/bin/javac 

  1.   If we run java –version now we see the changes in the version and it will give 1.6.0.45.
  2.  In case of all the software which work on JAVA jar files , in case of any error first check the java version and environment variables.
  3. In Order to set Permgen Variable in linux we need to edit the run.sh file and run.conf file .In run.sh file we need to add the following line after the Ipv4 line.
  4. In order to find the IPv4 line , search IPv4 in run.sh file and add the following line after it.

JAVA_OPTS=”$JAVA_OPTS -XX:MaxPermSize=256m”

  1. Once the following line is added in the run.sh file then the Perm Size is increased to 256 MB, which prevents the Out of Memory: Permgen Space error.
  2. In case of Setup screen not shown while deploying build, the root cause of such error is invalid java home. Check the JAVA_HOME variable from the error console and correct it.
  3. Such Error can be found in the error console window, cut copy that path and try running on CMD to find the validity of the path.
  4. In such a case Export the JAVA_HOME again and correct the entry.
  5. Do close all the old Console Windows as they will show the old JAVA_HOME, in order to find out whether or not the JAVA_HOME is changed , open a new console and writeecho JAVA_HOME.
  6. While using the Linux Setup do note that in order to run the files, the specified command must be run to make the command run. For e.g.

sh ./<File Name or Process Name with extension>

  1. While running a JAR File like SyncMan , the following command will be used

Java –jar <Filename.jar>

  1. If faced access errors do make all the files executable in linux which can be done by the following command

chmod 0755 *.sh

 

 

 

 

 

                -Adempiere Support {India Portal}

Read More

Table & Field: Adempiere Customization

The Table and Column Window defines all tables with their columns

 

  • Table (header) definition – Note that the name of most tables is automatically syncronized.
  • Table Name  : AD_Table

image001

  • In Order to create a Table in AD, we need to follow the following steps:-
  1.   Create a table in DB
  2.   Define all the columns and keys (Primary And Foreign ) in DB
  3.   Once Table is declared and defined we need to go login in System Administrator and go to Table and Column and Create New Table
  4.  Keep the same name as in DB and click on Create Columns from DB.
  5.  Columns will be Created and we can check the columns in Columns Tab
  6.  If Columns are not visible do not click on create Columns again, just close the Window and open it again and columns will be present.
  7. The Columns created will be displayed in the columns window here and we need to define any table level references here such that the reference created automatically are overridden in the AD

[divider]

Column Window

Defines the columns of a table.

Note that the name of the column is automatically syncronized.

Table Name  : AD_Column

image003

The Column Window can perform the following things like:-

  • Making Column Mandatory
  • Setting Reference
  • Adding Callouts to field
  • Setting Display Logic and Default Logic and much more as we can see from the fields.

 

The System Element of the column is also defined here and we need to refer to the Table and Column as the Column System Element is set here.

Points to Note in Table & Column

ERROR TYPE 1:

  1. Table Direct used but values not Retrieving in the AD Window.

In Order to retrieve the values we need to select the Column as Identifier.  For the columns we need to show we can select  Identifier as such and it will be displayed in the drop down.

ERROR TYPE 2

  1. When u create window and tab and after performing all the processes trace back to the table and column and allocate the window in the table and column main tab such that we allocate the window to the Table

ERROR TYPE 3

  1. If we fail to define the window in the Table and Column level the following error will be displayed:

Window ID Invalid

And in case of Desktop Client the  Zoom is disabled.To enable the zoom in the existing tables select the window and allocate in the table

 

 

 

                                                                                                                                                                -Adempiere Support {India Portal}

Read More

Java Memory Allocation:Heap Space Error

Introduction and Reason:

image001

java.lang.OutOfMemoryError: Java heap space

Java applications are allowed to use a limited amount of memory. This limit is specified during application startup. To make things more complex, Java memory is separated into two different regions. These regions are called heap space and permgen:

image003

The size of those regions is set during the Java Virtual Machine (JVM) launch by specifying parameters such as -Xmx and -XX:MaxPermSize. If you do not explicitly set the sizes, platform-specific defaults will be used.

So – the “java.lang.OutOfMemoryError: Java heap space” error will be triggered when you try to add more data into the heap space area, but there is not enough room for it.

Note that there might be plenty of physical memory available, but if the heap size limit for this Java program has been hit, the “java.lang.OutOfMemoryError: Java heap space” error is thrown.

Cause of java.lang.OutOfMemoryError

There most common reason for the java.lang.OutOfMemoryError: Java heap space error is simple. You are trying to fit an XXL application into a S-sized Java heap space. That is – the application just requires more Java heap space to operate normally. Other causes for this OutOfMemoryError message are more problematic and are caused by a programming error:

  • Spikes in usage/data volume. The application was designed to handle a certain amount of users or a certain amount of data. Now, when the number of users or the volume of data suddenly spikes, the operation which functioned normally before the spike ceases to respond and triggers the java.lang.OutOfMemoryError: Java heap space error.
  • Memory leaks. A particular type of programming error will lead your application to constantly consume more memory. Every time the leaking functionality of the application is used it leaves some objects behind into the Java heap space. Over time the leaked objects consume all of the available Java heap space and trigger the already familiarjava.lang.OutOfMemoryError: Java heap space error.

 [divider]

The following points are worthy to note on this error:

  1. Once we achieve to the state of heap space error the system wont function further as no memeory is available for the functioning.
  2. The WebUI of Enterprise 2.0 wont even let you login in the client and the desktop client also .
  3. In Order to check the error we need to check the console that will tell us the error.
  4. Once we attain the error we have to close the server and restart it as there is no other way round.

Solution for java.lang.OutOfMemoryError

The first solution should be obvious – when you have ran out of a particular resource, you should increase the availability of such a resource. In our case: when your application does not have enough Java heap space memory to run properly, fixing it is as easy as altering your JVM launch configuration and adding (or increasing if present) the following:

-Xmx1024m

In order to increase the memory in Enterprise 2.0 you need to follow the following steps:

  1. Increase the Heap Space memory in E2, You have to change the Xmx variables in following files:
  2. Open in notepad and search Xmx and Edit.
  3. AdempiereEnv open in notepad and edit
  4. AdempiereEnv.properties

[divider]

These 2 files are placed in Ossagho folder when u extract the build.

  1. Run.bat – Right click and edit the file
  2. While editing the file keep the Xms and Xmx in proportion i.e if we double the mimimum we also have to double the maximum limit .
  3. The default values are Xms – 64M and Xmx – 512M , and we can increase them to any values till RAM supports changes.
  4. Some sample values which can be feeded are:

i.      Xms 128M                     Xmx 1024M

ii.      Xms 192M                     Xmx 1536M

  1. Once we change the values in both the files we need to run silentSetup of Adempiere which will reflect all the values in the E2 Server and all changes are enforced.
  2. Restart the server and we will notice that console shows updated Values.

 

 

                                                                                                                        -Adempiere Support {India Portal}

Read More

Creating Window GUI in Eclipse

WindowBuilder – is a powerful and easy to use bi-directional Java GUI Designer

WindowBuilder is composed of SWT Designer and Swing Designer and makes it very easy to create Java GUI applications without spending a lot of time writing code. Use the WYSIWYG visual designer and layout tools to create simple forms to complex windows; the Java code will be generated for you. Easily add controls using drag-and-drop, add event handlers to your controls, change various properties of controls using a property editor, internationalize your app and much more.

WindowBuilder is built as a plug-in to Eclipse and the various Eclipse-based IDEs (RAD, RSA, MyEclipse, JBuilder, etc.). The plug-in builds an abstract syntax tree (AST) to navigate the source code and uses GEF to display and manage the visual presentation.

Generated code doesn’t require any additional custom libraries to compile and run: all of the generated code can be used without having WindowBuilder Pro installed. WindowBuilder Pro can read and write almost any format and reverse-engineer most hand-written Java GUI code. It also supports free-form code editing (make changes anywhere…not just in special areas) and most user re-factorings (you can move, rename and subdivide methods without a problem).

image001

 

[divider]

 

How to Enable GUI  i.e  JFrame and JWindow :

In Order to enable the Window Builder in Eclipse we will do the following steps:-

  1. Go to the Following link : http://www.eclipse.org/windowbuilder/download.php
  2. Copy the appropriate update site link according to the version of Eclipse you are using and copy the link URL.
  3. Once you have the Link URL paste it in the Eclipse.
  4. For pasting the URL open the following in the Help Menu.

image003

 

 

5. Click the Install New Software in Eclipse , and paste the link as follows.

image005

 

6. Click on Add Button and paste the URL there , give a suitable name to the link and save the link.

7. Once u add the link select the link from the drop down and you will get the repositories ready to be downloaded.

image007

 

8. Check all features to be installed in the “Install” dialog

9. Click the “Next” button

10. Accept the license terms and allow the software to Install itself on the Eclipse.

11. Once the Installation Completes we are good to go with the window building, Eclipse will demand a restart of the IDE.

12. After Restarting the IDE , go to New u will notice the following

image009

13. A new entry will be added named Window Builder, Click on the Application Window here and a new Application                            Window

14. Click on the Application Window and click Finish to create a new GUI and provide the Swing App with a Name.

15. Click on the Design tab to note the Design and Source tab for the code

image011                    16. Choose the Absolute Layout before selecting any elements and then add labels or text fields by click and leave on                            the form.

17. For Testing click either on the GUI and select ‘Test/Preview’ to check GUI

18. If we want to run the code, right click on the code and select the run from Java Application.

19. The GUI will be running with the changes here.

 

 

 

 

 

 

                                                                                                                                                -Adempiere Support {India Portal}

 

 

Read More