NetTalk Central

Author Topic: The page cannot be found  (Read 7079 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
The page cannot be found
« on: September 06, 2011, 04:32:17 AM »

Adding a menu item and using the drop dropdown to select a procedure to call results in this error.

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

The proc I am calling is a netwebform.
I have other netwebforms that work perfectly and seemed to have been added in the axact same way

What is strange is that only the error message is in the html page returned, no header or footer.
Where can I check what conditions will generate only the error page.

thanks

Johan


Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: The page cannot be found
« Reply #1 on: September 06, 2011, 05:35:12 AM »
Johan,

I'm not sure what could cause this, but maybe here's a way to investigate the source.

In the generated source code for the menu procedure, you will find a line like this one:

packet = clip(packet) & '<div class="nt-menu-item"><a href="'&p_web._MakeUrl('MyFormProc?' & clip(''))&'">'&p_web.Translate('My Form')&'</a>&#160;</div>'

where the procedure name is MyFormProcedure and the menu item reads "My Form". When the menu is displayed on the page, look for this line in the html and see if it actually is generated to call MyFormProc. It should be something like this:

<div class="nt-menu-item"><a href="MyFormProc?">My Form</a>&#160;</div>

This will be similar to the URL http://127.0.0.1:88/MyFormProc? - so you can compare which one works.

Thys

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: The page cannot be found
« Reply #2 on: September 06, 2011, 05:48:43 AM »
I'm guessing the procedure you are calling is a NetWebSource, not a NetWebForm - that's not allowed.

cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: The page cannot be found
« Reply #3 on: September 07, 2011, 01:33:30 AM »

Hi Bruce and Thys

thanks for replies.

Bruce, no, it's def a webform.
Thys, yes I have checked that, below my code from the menu.

    ! End of "Before Menu Item"
        packet = clip(packet) & '<li>'
          packet = clip(packet) & '<a href="'&p_web._MakeUrl('NewShipment2?' & clip(''))&'">'&p_web.Translate('Test')&'</a>'
        packet = clip(packet) & '</li>'
    ! Start of "After Menu Item"

I have inserted a message() in the webform in the Init embed.
It does not popup, so somehow the webserver and menu code redirects to the error page without getting close to the form.

This is the trace, the line that is interesting is : [2420] [NetDLL] [2] CallBackWindowClientCallBack() : Attention. Received a message that isn't in one of our queues. p_wMsg = 49480
Is this correct or does it point to an error?

[2420] [Net] [1] NetWebServer.Process - End Process
[2420] [Net] [1] NetWebServer.TakeEvent - End TakeEvent
[2420] [NetDLL] [2] CallBackWindowClientCallBack() :  Count=1 p_wMsg = 49480 wParam = 0 (lParam = 0) = Loc:WSAGetSelect.Err = 0 & Loc:WSAGetSelect.Event = 0. p_hWnd = 1442816
[2420] [NetDLL] [2] CallBackWindowClientCallBack() : Attention. Received a message that isn't in one of our queues. p_wMsg = 49480
[2420] [Net] [3] _NetAll._LoggingSetup - Initialisation
[2420] [NetDLL] [2] CallBackWindowClientCallBack() : End of Function - will call Return (CallWindowProc...)
[2420] [NetDLL] [2] CallBackWindowClientCallBack() : End of Function - will Return Call to ClientSavedProc
[2420] [NetDLL] [2] CallBackWindowClientCallBack() : loc:ret = 0
[2420] [netTrace][thread=3] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[NewShipment2]

any ideas appreciated
this has me well and truly stumped, not that it takes a lot to stump me,
on or off the field. <g>

Johan






JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: The page cannot be found
« Reply #4 on: September 07, 2011, 01:41:17 AM »


Nope, just checked the same line comes up in a normal operation,

I have only switched on the error log now, and this comes up.

[3336] [netTrace][thread=3] UpdateCustomers End
[3336] [netTrace][thread=3] UpdateCustomers End
[3336] [netTrace][thread=3] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[BrowseShipment]
[3336] [Net] [3] NetWebServer.CloseServerConnection - Error. Could not find data connection in the DataConnection queue
[3336] [Net] [3] NetSimple._CallErrorTrap - Error = -34 = Unable to Close connection : Could not find connected client in Simple Connect Client or Server Function = NetSimple.CloseServerConnection Server =  Port = 88
[3336] [Net] [3] NetSimple.ErrorTrap - <no display> Error = -34 = Unable to Close connection : Could not find connected client in Simple Connect Client or Server Function =
NetSimple.CloseServerConnection Server =  Port = 88

Seems to possible be a data connection error.
Will be checking datadll settings etc...
It's a postgres db and a new table.

Johan

 




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: The page cannot be found
« Reply #5 on: September 07, 2011, 09:49:33 PM »
The key is this line;

SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[BrowseShipment]

so
a) Check if the procedure is called BrowseShipment
b) the WebHandler procedure is the one that ultimately calls BrowseShipment, so if you want to trace what's happening
look in there. (specifically in the _SendFile method)

cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: The page cannot be found
« Reply #6 on: September 08, 2011, 10:05:42 PM »


Hi Bruce

What would generate the wfw_a_in.clw file?

This file is included() in the Webhandler code in quite a few places and I saw it had references to some of my procedures.
I did a cleanup of all clw, map, exp, lib etc...files and did a new clean global compile in an effort to make sure that I have all the correct source files etc..

This file does not get re-generated.

thanks

Johan


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: The page cannot be found
« Reply #7 on: September 09, 2011, 12:01:28 AM »
The name doesn't ring a bell.

But it does raise the question - is this a Multi-app system?
Is BrowseShipment in the same app as the WebHandler. (you only have one WebHandler right?)

cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: The page cannot be found
« Reply #8 on: September 09, 2011, 08:34:25 AM »

Hi Bruce

Yes it's multi dll,
1 data app  (wfdata.app)
1 dll           (wfwa.app)
1 exe with one webhandler   (wfwserv.app)

Each app only has 3-4 procedures

I checked another project and it seems as if the include file code is in the webhandler source, not using the includes
So perhaps there is a setting somewhere that generates this code into an include file?
If I delete the include file and do a global compile, nothing re-generates it and it moans about the missing include file.

Should I start from scratch with the apps?
Not ideal but can be done.

Would be nice to know how this happened in case it happens again and further down the project.


Below is the code from Webhandler source

####################################################################################################
p_web._SendFile PROCEDURE(string p_FileName,Long p_header=NET:SendHeader)

! Start of "NetTalk Method Data Section"
! [Priority 1500]

loc:parent  string(250)
loc:done        Long
loc:filename    string(255)
! [Priority 6500]

! End of "NetTalk Method Data Section"

  CODE
  ! Start of "NetTalk Method Executable Code Section"
  ! [Priority 1500]

 
    loc:parent = Lower(self.GetValue('_ParentProc'))
    loc:filename = SELF.GetPageName(Lower(p_FileName))
 
    Include('wfw_a_ni.clw','_SendFile')
  ! [Priority 3040]

    do CaseStart:wfwserv
    If loc:Done then Return.
 
    Include('wfw_a_ni.clw','_SendFileCase')
  ! [Priority 4000]

  ! Parent Call
  PARENT._SendFile(p_FileName,p_header)
  ! [Priority 7500]
  ! End of "NetTalk Method Executable Code Section"

####################################################################################################

This is the code from the include file
####################################################################################################

  Section('_SendFile')

  Section('_SendFileCase')
  do CaseStart:wfw_a
  If loc:Done then Return.

  Section('_SendFileRoutines')
CaseStart:wfw_a  routine
  do Case:BrowseCompany
  do Case:UpdateCompany

! - -  - - - - - - - - - - - - - -
Case:BrowseCompany  Routine
  Case loc:filename !SELF.GetPageName(Lower(p_FileName))
  of 'browsecompany'
  orof 'browsecompany' & '_' & loc:parent
  orof 'browsecompany' & '_' & loc:parent
    Self.MakePage('BrowseCompany',Net:Web:Browse,0,'Browse Customers',,)
    loc:Done = 1 ; Exit
  End ! Case
! - -  - - - - - - - - - - - - - -
Case:UpdateCompany  Routine
  Case loc:filename !SELF.GetPageName(Lower(p_FileName))
  of 'updatecompany'
    Self.MakePage('UpdateCompany',Net:Web:Form,0,'Update Customer',,)
    loc:Done = 1 ; Exit
  of self._nocolon('updatecompany_tab_0')
    UpdateCompany(self,Net:Web:Div)
    self._Sendfooter(5)
    loc:Done = 1 ; Exit
  of self._nocolon('updatecompany_cpy:cpy_name_value')
    UpdateCompany(self,Net:Web:Div)
    self._Sendfooter(9)
    loc:Done = 1 ; Exit
  of self._nocolon('updatecompany_cpy:cpy_adr1_value')
    UpdateCompany(self,Net:Web:Div)
    self._Sendfooter(9)
    loc:Done = 1 ; Exit
  of self._nocolon('updatecompany_cpy:cpy_adr2_value')
    UpdateCompany(self,Net:Web:Div)
    self._Sendfooter(9)
    loc:Done = 1 ; Exit
  of self._nocolon('updatecompany_cpy:cpy_adr3_value')
    UpdateCompany(self,Net:Web:Div)
    self._Sendfooter(9)
    loc:Done = 1 ; Exit
  End ! Case
  Section('ProcessTag')
  loc:tag = Choose(Instring('?',loc:tag) > 0,sub(loc:tag,1,Instring('?',loc:tag)-1),loc:tag)
  Case loc:tag
    of 'browsecompany'
      browsecompany(Self)
    of 'pagefootertag'
      pagefootertag(Self)
    of 'pageheadertag'
      pageheadertag(Self)
    of 'updatecompany'
      updatecompany(Self)
  End
  Section('CallFormA')
    If Band(p_Stage, NET:WEB:StagePost + NET:WEB:StageValidate + NET:WEB:Cancel)
      case lower(self.formsettings.proc)
      Of 'updatecompany'
         ReturnValue = UpdateCompany(Self,p_stage)
         RETURN ReturnValue
      End
    Else
      case lower(SELF.PageName)
        Of 'updatecompany'
             ReturnValue = UpdateCompany(Self,p_stage)
           RETURN ReturnValue
      End
    End
  Section('CallFormB')
    If p_File &= company
       ReturnValue = UpdateCompany(Self,p_stage)
       RETURN ReturnValue
    End
  Section('CallFormC')
  Section('ProcessYear')

####################################################################################################



JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: The page cannot be found (solved)
« Reply #9 on: September 10, 2011, 08:37:51 PM »


Hi Bruce

Spent the last hour tracing the code back through the template.

Found that the the 'multi dll tab'  list was the culprit, along with me of course <g>
It's still early in the project and I made the 'wise' decision to rename my apps to make more sense, and the 'external app containing web procedures' list was
pointing to the old app name and it was including the old incorrect file.

Reason why the name was invalid and page not found

regards

Johan


 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: The page cannot be found
« Reply #10 on: September 10, 2011, 11:03:23 PM »
cool - well done Johan.

cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: The page cannot be found
« Reply #11 on: September 11, 2011, 03:52:43 AM »


Hi Bruce,

thanks, now I have a clean compile, but it does not find 'index.htm'

'localhost:88'  gives the 'Page not found error' now.

Back to the drawing board or should I say into the source code. <g>


thanks

Johan