creating a new table

For those who ventured too far - just hope they know their way back :)

Moderator: neilg

creating a new table

Postby hema » Mon May 02, 2005 9:31 pm

Hi,

I created a new table based on this step-by-step guide: http://hemsidor.torget.se/users/m/Murphy/compiere

When I save the records, I see the followings in my trace:

M_Table.getPO: (id) - Class not found for X_Friends [11]
MTable.dataSave: X_Friends - No Persistent Object [11]

Can anyone explain to me what do they mean please?

Thank you very much,
Hema
hema
Regular
 
Posts: 81
Joined: Wed Aug 25, 2004 5:21 pm

Postby red1 » Mon May 02, 2005 9:46 pm

Hi Hema,
1) This may mean that u did not introduce a System Element into your new Field. U can check other Compiere Field to see how its done.

2) U may need to run GenerateModel.class to recreate the Get and Set methods in the X_'Table' class.

This is quite a common topic so u can refer to more info already explained previously in sourceforge forums.

red1
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby hema » Wed May 04, 2005 10:54 pm

Hi Red1,

thank you for your help. I understand that I need to run GenerateModel.class. I tried to do it but I am not successful.
What I did was:

Firstly I tried to compile the GenerateModel.java using command prompt and I got lots of errors.

Then, I tried to run the already provided GenerateModel.class and followed the example given in the main procedure of GenerateModel.java. I executed the following path in command prompt:
java GenerateModel.class C:\Compiere\compiere-all\extend\src\compiere\model\ compiere.model 'U','A'
This didn't work too.

Am I doing it correctly?

Thank you very much,
Hema
hema
Regular
 
Posts: 81
Joined: Wed Aug 25, 2004 5:21 pm

Postby trifon » Thu May 05, 2005 8:20 pm

Hi Hema,

Try to execute this:

C:\Compiere\compiere-all\dbPort\build\java -cp
../../tools/lib/log4j.jar;../../looks/build/;../../interfaces/Interfaces.jar;../../lib/jboss.jar;../../lib/oracle.jar;../../lib/jPDF.jar;
org.compiere.util.GenerateModel
C:\Compiere\compiere-all\dbPort\src\org\compiere\model\
org.compiere.model 'U','A'

If you want to generate java files for Dictionary maintained tables just add 'D' after 'U','A'.

Regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby hema » Fri May 06, 2005 7:57 pm

Hi Trifon,

Thank you very much for your help. It worked and I can save data in my table.

Regards,
Hema
hema
Regular
 
Posts: 81
Joined: Wed Aug 25, 2004 5:21 pm

It didn't worked for me

Postby sunilverma » Tue Dec 13, 2005 5:50 pm

Hi
I executed the already provided GenerateModel.java and made the required changes in the main procedure of GenerateModel.java. It successfully created the .java files for the newly created tables.

I made the following changes in GenerateModel.java

String directory = "C:\\Compiere2.5.2e\\compiere-all\\dbPort\\src\\org\\compiere\\model\\";

String packageName = "org.compiere.model";

it created java file X_C_BPartner_Meeting.java

Which I Imported through eclipse into the package and rebuilt it ...

when I executed Compiere again .... I got the following error ...

-----------> MTable.dataSave: C_BPartner_Meeting - No Persistent Object [11]
15:09:33.827 MTable.dataSave: NonPO [11]
===========> MTable.saveError: SaveErrorRowNotFound - [11]

Please Help ....

Thanks in Advance ...

Regards

Sunil
sunilverma
 
Posts: 6
Joined: Mon Nov 14, 2005 6:33 pm
Location: Chandigarh

Postby red1 » Wed Dec 14, 2005 8:21 am

Ensure u did compile correctly and the java is in context and exist within the mentioned package. This shuld work. So now u have to troubleshoot why it still doesnt. As u have Eclipse, use it to trace the callling line. U usually can solve this problem entirely using Eclipse debug.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

creating new table

Postby max123 » Fri Feb 24, 2006 10:58 pm

Ciao

A have crated a new table called MasterJob and a new model X_MasterJob, by using generatemodel.class, that extend org.compiere.model.PO
the table have type DICTIONARY

Compiere is 2.5.2. compiled application

When i attempt to save data the result is

M_Table.getPO(): (rs) Class not found for MasterJob

I've deployed my jar file (containing the class X_MasterJob ) in jboss deploy but don't work

I've also used this jar as library for the compiere client but the result is the same.

:cry:

Any suggestion is appreciate !!

Tank you
max123
 
Posts: 1
Joined: Fri Feb 24, 2006 10:35 pm

Postby Mr_reggatta » Wed Mar 15, 2006 12:40 am

I have tried to follow the step-by-step tutorial at http://hemsidor.torget.se/users/m/Murphy/compiere/
to create the X_Friends table. Now i can see "Friends" in the Application Dictionary. Now i can open the window but i CAN'T create a new record!!!
I can see this errors:


*** 2006-03-15 10:50:08.626 Compiere Log (CLogConsole) ***
10:50:08.626 Compiere.startup: Compiere(r) Release 2.5.3a_2005-10-17 - Smart ERP & CRM - (c) 1999-2005 Compiere (r); Implementation: unknown - not supported
10:50:08.626 Compiere.startup: 53a - Java HotSpot(TM) Client VM 1.5.0_06-b05 - Windows 2000 5.0 Service Pack 4
10:50:09.378 Ini.loadProperties: C:\Documents and Settings\Andrew\Compiere.properties #33
-----------> CConnection.queryAppsServerInfo: jnp://reggattadeblanc:1099
- javax.naming.CommunicationException: Could not obtain connection to any of these urls: reggattadeblanc:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server reggattadeblanc:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server reggattadeblanc:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
- {java.naming.provider.url=jnp://reggattadeblanc:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, jnp.discoveryTimeout=5000, jnp.timeout=5000, java.naming.factory.url.pkgs=org.jboss.naming.client, jnp.sotimeout=5000}
===========> MLookupFactory.getLookup_TableDir: No Identifier records found: X_Friend_ID [12]
===========> MLookupFactory.getLookupInfo: No SQL - X_Friend_ID [12]
===========> MTable.open: SELECT First_Name,Last_Name,Phone_Number,Birthdate,X_Friend_ID,Created,CreatedBy,Updated,UpdatedBy FROM X_Friends WHERE X_Friends.AD_Client_ID=0 AND X_Friends.AD_Org_ID=0 ORDER BY Created [12]
java.sql.SQLException: ORA-00904: "X_FRIEND_ID": invalid identifier
; State=42000; ErrorCode=904
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:420)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:452)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2929)
at org.compiere.util.CPreparedStatement.executeQuery(CPreparedStatement.java:99)
at org.compiere.model.MTable$Loader.open(MTable.java:2885)
at org.compiere.model.MTable.open(MTable.java:492)
at org.compiere.model.MTab.query(MTab.java:514)
at org.compiere.grid.GridController.query(GridController.java:534)
at org.compiere.apps.APanel.stateChanged(APanel.java:1004)
at javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:290)
at javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:222)
at javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:116)
at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:50)


:roll: :roll: :roll:
Mr_reggatta
 
Posts: 24
Joined: Wed Mar 15, 2006 12:34 am
Location: Roma, Italy

Postby Mr_reggatta » Thu Mar 16, 2006 12:33 am

I've modified something...
now i can insert data from fields but after, if i try to find the data, i can see this error:
===========> MLookupFactory.getLookup_TableDir: Key does not end with '_ID': IsActive [11]
===========> MLookupFactory.getLookupInfo: No SQL - IsActive [11]
===========> MField.loadLookup: (IsActive) - No LookupInfo [11]
:roll: :roll: :roll:
Mr_reggatta
 
Posts: 24
Joined: Wed Mar 15, 2006 12:34 am
Location: Roma, Italy

Postby red1 » Thu Mar 16, 2006 12:10 pm

Compiere maintains a rule convention over the way to define ID keys. If u compare the table u created with any of Compiere's one, u will notice that the field that is referenced as "ID" must end in "_ID". Make it so, and that error shuld go away.

And also each table must have the following fields:

1) AD_Client_ID
2) AD_Org_ID
3) IsActive
4) Updated
5) UpdatedBy
6) Created
7) CreatedBy

FYI, in the Compilo project and the one by Robert Klein (see Contributors' Corner) are ideas supposed to elevate the hardships of extending Compiere and creating new tables.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby Mr_reggatta » Tue Apr 04, 2006 10:39 pm

thank you...
i have resolved...
thank you very much...
Mr_reggatta
 
Posts: 24
Joined: Wed Mar 15, 2006 12:34 am
Location: Roma, Italy

Copy table structure one to another

Postby neilg » Wed Apr 05, 2006 8:41 am

Also see the section on copying table structures in Compiere in the compiere survival guide. It copies the common fields and avoids labour of creating them (ad_client_id,etc). It is under the following section:

SQL and PL/SQL
1. Copy structure of data dictionary (AD) from one table to another (pl/sql, Oracle)


The site is http://www.knowledgesuccess.com

Then you must just create your custom fields. This is for when creating many tables and avoids common mistakes.
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm

Postby Mariam » Mon May 22, 2006 5:06 pm

Hi All,
I also used the step by step giude on this link
http://hemsidor.torget.se/users/m/Murphy/compiere/

I followed every single detail, I'm finally able to see my Window Name in the tree, but i can't open it...
The progress bar is growing to reach about 90% then it just stops, and nothing opens.

I understand that many have tried the same giude, and i wish someone could help.

Have a great time,
Mariam
I am a Maker.. Not a Taker.
Life Makers (TM)
Mariam
 
Posts: 10
Joined: Sun Apr 30, 2006 3:07 pm
Location: Egypt

Postby Mr_reggatta » Mon May 22, 2006 5:14 pm

Can you see some error messages?
Mr_reggatta
 
Posts: 24
Joined: Wed Mar 15, 2006 12:34 am
Location: Roma, Italy

Set the trace level

Postby neilg » Mon May 22, 2006 5:38 pm

Hi,

Under preferences set the trace level to FINE, or something quite high. Also let us know what compiere version you are using. Then make sure you start compiere from the commandline so you can see the trace output. Let us know what errors are occurring.

Cheers Neill

Mariam wrote:Hi All,
I also used the step by step giude on this link
http://hemsidor.torget.se/users/m/Murphy/compiere/

I followed every single detail, I'm finally able to see my Window Name in the tree, but i can't open it...
The progress bar is growing to reach about 90% then it just stops, and nothing opens.

I understand that many have tried the same giude, and i wish someone could help.

Have a great time,
Mariam
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm

Postby Mariam » Wed May 24, 2006 3:26 pm

Hi All,
Thanks for your help
Well, First i'm using Compiere 2.5.3c
Secondly.. in the matter of fact i don't know how to start Compiere from the commandline :oops:
I run it using eclipse.
I'll be glad if someone could help in that.
Thanks in advance,
I am a Maker.. Not a Taker.
Life Makers (TM)
Mariam
 
Posts: 10
Joined: Sun Apr 30, 2006 3:07 pm
Location: Egypt

Postby red1 » Wed May 24, 2006 4:09 pm

In Eclipse u select RUN and follow thru to find your Compiere project's main class - org.compiere.compiere

U have to be a developer to be using Eclipse. If u re not, and u wish to run Compiere from commandline, u shuld follow setup instructions from www.compiere.org.

In desktop when u have setup normally, u will find the compiere shortcut to run <d>:\Compiere2\RUN_Compiere2.bat
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia


Return to Strictly Technical

Who is online

Users browsing this forum: No registered users and 1 guest

cron