1. Stephan Schröpel
  2. PowerBuilder
  3. Monday, 28 November 2022 16:31 PM UTC

Hi

Reading a XML File using PBDOM of PB2022 all works fine in IDE 32 or 64.

But when I download and install via client deployment (64), I get the Message "Error calling method of a pbni object" just after reading the file.

I checked the version of pbdom220.pbd to be the same in the library list. In PB2021 all runs fine with pbdom210.pbd 

What's the difference? 

I checked the migrating instructions for pbdom, but using pbdom220.pbd I only has to be included in the library list? 

Are there files missing?

 

Thank you

Stephan

John Fauss Accepted Answer Pending Moderation
  1. Monday, 28 November 2022 17:34 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Stephen -

PB 2022 was produced with a newer version of Visual Studio than previous versions. Have you distributed the newer Microsoft runtime files? Below is the updated information from the PB Help topic "runtime files":

These files will be present on the machine(s) where the PB IDE is installed, but may not be available on other machines.

Best regards, John

Comment
  1. Roland Smith
  2. Monday, 28 November 2022 17:55 PM UTC
Good idea, PBDOM.pbx for 2022 would require a different C++ runtime than under 2021.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 28 November 2022 17:37 PM UTC
  2. PowerBuilder
  3. # 2

Hi Stephan;

  You should no longer be using PBNI for things like this. Only the corresponding PBD file only. My guess is that there are some old PBDOM objects in one of your PB App's PBL's left over from an old PBX PBNI import. That could easily cause the issue that you described. Check your App's PBL'S & remove any PBDOM objects. Then proceed with the PBDOM220.pbd in the library list only approach.

HTH

Regards... Chris 

Comment
  1. Roland Smith
  2. Monday, 28 November 2022 17:53 PM UTC
If the PBX was imported into a 2021 PBL, the code would reference PBDOM.pbx which is the same name as under 2022. Since he reports it working in the IDE, it would be more likely missing or wrong PBDOM.pbx.
  1. Helpful 1
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 28 November 2022 17:49 PM UTC
  2. PowerBuilder
  3. # 3

PBDOM220.PBD contains PBNI objects which refer to C++ code located in PBDOM.pbx.

Comment
There are no comments made yet.
Stephan Schröpel Accepted Answer Pending Moderation
  1. Tuesday, 29 November 2022 13:17 PM UTC
  2. PowerBuilder
  3. # 4

Thank you all for your answers!

I checked all my pbls for using pbdom objects. I never imported a pbx file, pbdom220.pbd is in the library list  (the original from ..Powerbuilder 22.0\IDE path).Now all the Microsoft files on the list (Thank you John!) are now in the list of external files.

 Does PB DOM has to be checked in the list of runtime files? PB Help says: required for PBDOM.PBX So I unchecked it now.

I disabled all paths to prior installations and runtimes. 

I pushed pbdom220.pbd to the beginning of the library list, trying, if there was a difference 

After compiling and uploading the same issue and error message. But not while running in IDE 32/64.

 

generating an .EXE File and run it outsout IDE, I get an error "Reference to an invalid object" at  the first line of

CATCH ( PBDOM_Exception pbde )
   MessageBox( "PBDOM Exception", pbde.getMessage() )
CATCH ( PBXRuntimeError re )
   MessageBox( "PBNI Exception", re.getMessage() )
END TRY

Is there something missing?

Stephan

 

Comment
  1. Stephan Schröpel
  2. Friday, 9 December 2022 10:32 AM UTC
Hi Chris,

a big afford... but

- the software is running without problems in IDE 32 or 64 bit,

- the problem only occurs on cloud deployment. So there must be an issue with missing or wrong deployment files. the file list and configuration is the same as in PB2021 which is running. So maybe there are files missing?

- I'll make a try with an normal installer deployment. Or go back to PB2021

REgards

Stephan



-
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 9 December 2022 15:11 PM UTC
Hi Stephen;

Yes, if it works from the IDE it should work the same when deployed as either a PowerClient or PowerServer based App.

I suspect that it might be related to either missing external files, wrong PB runtime assigned n the IDE and/or PS Project or a mis-configured Cloud App Launcher (just my guess).

Make sure though that the PBDOM220.PBD is in your apps library list and that is it checked to be built as a PBD (even though it already is). in your PS Project.

Regards ... Chris
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 14 December 2022 15:50 PM UTC
Hi Stephan;

At this point, if you can create a simple reproducible test case PB App - then I would urge you to create a Support Ticket for this issue.

Regards ... Chris
  1. Helpful
There are no comments made yet.
Stephan Schröpel Accepted Answer Pending Moderation
  1. Monday, 5 December 2022 15:50 PM UTC
  2. PowerBuilder
  3. # 5

Still not running.... 

- PBDOM220.pbd from path Appeon\Powerbuilder 22.0\IDE is in the library list
- Envrironment path Variables first point to Version 22.0 Files (to make shure to get the right ones)

For testing

- inserted code for a log to a file while parsing document
- generating a client deployment package to upload on a new clean webserver (64 bit and later 32 bit, no difference, same behavior)
- executing deployment package, controlling pbdom220.pbd folder, c++ runtime files mentioned above exist

executing application 

opening a XML File for parsing

"Error Calling method of an pbni object" message 

 

In LOG FIle:

After
           lpdom_builder = CREATE BUILDER
it runs into

       Catch PBXRuntimeError

Running same out of IDE, all works fine (32 bit or 64 bit)

 

Can't find any old modules.... any ideas?

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 5 December 2022 23:32 PM UTC
  2. PowerBuilder
  3. # 6

Hi, just in case:

If you are using PFC classes, then - depending on which version of it - there might be pbdom objects copied into them. So that means you would have duplicate objects if you hook up the pbdom.pbd.

Depending on which library is listed first, one or the other would be used.

regards.

Comment
  1. Stephan Schröpel
  2. Wednesday, 7 December 2022 12:02 PM UTC
Hi Miguel

no, I don't use PFC

all handmade...



regards Stephan

  1. Helpful 1
There are no comments made yet.
Stephan Schröpel Accepted Answer Pending Moderation
  1. Tuesday, 13 December 2022 15:17 PM UTC
  2. PowerBuilder
  3. # 7

another try...
I just made a simple new project with one object containing simple Getfileselect and Calling fu_file_read_xml(ps_filename)

In library list only included pbdom220.pbd 

Same problem "PBNI_Exception": "Error calling method of a PBNI object". In IDE it runs without problems.

 

You can download and install this via https://tw8.thermis.de/TESTXML

There is a sample XML "Heiko 2017.XML" included. 

 

What is wrong?

Best regards 

Stephan

 

Code of fu_file_read_xml(ps_filename) as follows

PBDOM_Builder lpbdom_Builder
PBDOM_Document lpbdom_Doc
PBDOM_Object lpbdom_Obj[]
PBDOM_Element lpbdom_Element
PBDOM_Attribute lpbdom_Attribute

integer li_Counter, li_Max, li_count
string ls_Text, ls_parseErrors[], ls_name, ls_objectclass
string ls_version, ls_encoding, ls_standalone
long ll_ret
long ll_objectclass
boolean lb_parse
boolean lb_state




ll_ret = XMLParseFile(ps_filename) // adds .log add end


IF ll_ret = 0  THEN

	TRY

		lpbdom_Builder = CREATE PBDOM_BUILDER

	// Import File and generate XML
		lpbdom_Doc = lpbdom_Builder.BuildFromFile( ps_filename )
		lb_parse = lpbdom_Builder.GetParseErrors(ls_parseErrors)
		IF lb_parse THEN
			FOR li_count = 1 TO Upperbound(ls_parseErrors)
				MessageBox("ParseError",ls_parseErrors[li_count])
			NEXT
		END IF
		IF isValid (lpbdom_Doc) THEN
			lpbdom_Doc.getxmldeclaration (ls_version, ls_encoding, ls_standalone)
			IF lpbdom_Doc.HasChildren() THEN
				IF lpbdom_Doc.GetContent( lpbdom_Obj ) THEN
				// Get 1st Level data
					li_Max = UpperBound( lpbdom_Obj )
				   	FOR li_count = 1 TO li_max
						ls_objectclass = lpbdom_Obj[li_count].GetObjectClassString() 
						ll_objectclass = lpbdom_Obj[li_count].GetObjectClass()
						IF ll_objectclass = TPBDOM_ELEMENT THEN
							ls_name =  lpbdom_Obj[li_count].GetName()
							ls_Text =   lpbdom_Obj[li_count].GetText()
							lpbdom_Element = lpbdom_Obj[li_count]
							IF ls_name = "Road" THEN
								IF lpbdom_Element.HasAttributes() THEN
									lpbdom_Attribute = lpbdom_Element.getAttribute("Version")
									is_xml_version = lpbdom_Attribute.GetText()
									ii_road_version = integer(is_xml_version)
									MessageBox("Success","Version = " + string(ii_road_version))
								END IF
//								fu_parse_road(lpbdom_Element,ps_filename)
							END IF
						END IF
					NEXT
				END IF
			END IF
		END IF
		CATCH (PBDOM_Exception lpbdom_Except)
		 	MessageBox( "PBDOM_Exception", lpbdom_Except.GetMessage())
		CATCH (PBXRuntimeError re)
		 	MessageBox( "PBNI_Exception", re.GetMessage())
		END TRY
	

	
	DESTROY lpbdom_Builder
	lb_state = TRUE
ELSE
	lb_state = FALSE
END IF



RETURN lb_state
Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 13 December 2022 21:49 PM UTC
HI Stephan;

In your project's Library List, did you also check the PBDOM220.PBD as a PBD deployment as well? That does not seen intuitive but it's a requirement!

Regards ... Chris
  1. Helpful
  1. Stephan Schröpel
  2. Wednesday, 14 December 2022 08:30 AM UTC
Hi Chris

in the library list of client deployment there is no check for pbd. this is only in the library list of project deployment. I also made a project deployment. When I execute the generated testxml.exe, it is running without an error. Only running the client-deployment causes that error.



When I check the downloaded testxml in ..\AppData\Roaming\PBApps\Applications\tw8.thermis.de_TESTXML there is a folder pbdom.pbd, containing only 4 files:

pbdom_builder.udo

pbdom_document.udo

pbdom_exception.udo

_indexes.idx



all other pbdom_xxxx are not present. Is it because they are not used in the code-example (= optimized)?



best regards

Stephan

  1. Helpful
There are no comments made yet.
Stephan Schröpel Accepted Answer Pending Moderation
  1. Thursday, 26 January 2023 13:21 PM UTC
  2. PowerBuilder
  3. # 8

Hi Roland and Chris


I just found a difference from my 2022 to my PB2021 workspace:
In the Output/Default Window of the IDE there are tow entries which do not exist in 2021:

(See attached Screenshots)

maybe this causes my problems with PBDOM after deploying?

Where di they come from? I searched all informations about Output window in the IDE description of PB Help and Appeon Wwebsite, but didn't find any further informations.

Best regards 

Stephan

Attachments (2)
Comment
  1. Chris Pollach @Appeon
  2. Thursday, 26 January 2023 16:15 PM UTC
Hi Armeen;

FYI: If the PBDOM PBD is in your App's library list and checked off as *required* in the Library list - you do not need to define it in the external files. The PowerClient & PowerServer App deployment will handle it auto-magically. ;-)

Regards ... Chris
  1. Helpful 1
  1. Stephan Schröpel
  2. Thursday, 26 January 2023 16:55 PM UTC
Hi Armeen



no...

It is part of the library list. Should I?

Regards

Stephan
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 26 January 2023 18:05 PM UTC
Chris aid it is not necessary, but I was thinking just as troubleshooting step.
  1. Helpful
There are no comments made yet.
Alain Van den Abbeele Accepted Answer Pending Moderation
  1. Wednesday, 22 February 2023 07:54 AM UTC
  2. PowerBuilder
  3. # 9

We had the same problem when migrating from PB2019 to PB2022.

I traced it down to a new dependency on PBXerces.dll and xerces-c.dll .

Once we added these files to our application, it worked again.

Comment
  1. Andreas Mykonios
  2. Wednesday, 22 February 2023 09:56 AM UTC
Hi.

Well, this is documented here https://docs.appeon.com/pb2022/application_techniques/PowerBuilder_extensions.html. But I always thought that PBXerces.dll and xerces-c.dll are required to support xml in datawindows.

Andreas.
  1. Helpful
  1. Alain Van den Abbeele
  2. Wednesday, 22 February 2023 11:08 AM UTC
This is not about datawindows, but about a change in dependencies using PBDOM xml processing.

The xerces dll's were not necessary in PB 2019
  1. Helpful
  1. Andreas Mykonios
  2. Wednesday, 22 February 2023 12:19 PM UTC
I agree with you. What I mention is that I see in documentation that it's referenced for PB 2022 and also for PB 2019R3 this way (https://docs.appeon.com/pb2019r3/application_techniques/ch09s02.html#PowerBuilder_extensions). At that point it states that those files are required when using PowerBuilder Document Object Model. This is generic. In runtimes section (https://docs.appeon.com/pb2019r3/application_techniques/ch09s02.html#d0e24197) it is mentioned that PBXerces.dll, xerces-c_2_8.dll and xerces-depdom_2_8.dll are required for "XML support (for DataWindows\DataStores and Web DataWindow)"... I believe that documentation is not clear...

Andreas.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.