1. Gabriele Roggia
  2. Report Editor
  3. Montag, November 23 2015, 05:17 PM
  4.  Abonnieren via E-Mail
I created a file with valentine study ( " .vsp " ) that interfaces with MySQL . The file is called by codide through a webapp created with XOJO . Compile it and I move into the cgi - bin XAMPP but when I call the file does not open by returning to an error as ever ? Help me please :( :(
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello, Gabriele

Have a few questions:

1. What OS do you use?
2. Web application is working when started from Xojo, right?
3. Is XAMPP located at the same computer, where you compile a web application?
Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
Hello, Sergey

1. Mac
2. Yes, When I launch the webapp from Xojo the application works perfectly.
3. XAMPP is locate at the same computer.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Checked CGI web apps earlier on OS X - they worked for me with built-in web server, haven't tried XAMPP yet for it.

Is a path to VSP file absolute or relative? Maybe it can't be accessed.
Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
dim f as FolderItem

f=GetFolderItem("";).Parent.Child("Reports";).Child("reports.vsp";)
mProject=new VProject(f)
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
XAMPP is kind of MAMP?

as I know MAMP keeps site in the
Applications /MAMAP/httpdocs/...

Your Web app is copied inside of such path?
Do you copy vsp there also?
Or it is packed inside of web app by Xojo?


2) You can try install VSERVER on THAT machine,
and put vsp into VServer/projects folder

and change a little code to work with vsp via VSERVER.
See Examples.

In this way .. you exclude trouble with "where is vsp?"


3) was you able locate which exactly LINE of your web app cause trouble?
May be using logs, prints, ... debugger,
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
I've just installed XAMPP + V4RB in clean environment on OS X 10.11 and get my Xojo Web app working in CGI mode without any problem:

1) Copied my files into cgi-bin folder:
/Application/XAMPP/xamppfiles/cgi-bin/

* test_cgi_local - it's an application folder
* Reports - folder which contains vsp file

2)
Important to change permissions, because in CGI mode web applications are started by apache.
Currently XAMPP runs apache as "daemon" user.

Execute these commands from Terminal.app to change permissions:
sudo chown -R daemon:staff Reports test_cgi_local
sudo chmod -R 755 Reports test_cgi_local


For testing (or if you don't know the user, etc) you can just allow everything to everyone on that folders:

sudo chmod -R 777 Reports test_cgi_local


3) Pointed browser to localhost/cgi-bin/test_cgi_local/testcgilocal.cgi

**********

So my question is - what error do you get and where do you see it?
In a case of an uncaught exception Xojo shows call stack right in the browser, so it is clearly visible, which method caused an error.
Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
Hi,
I did everything you told me the error I keep getting is this :



MakeNewReport:
mReport=app.mProject.MakeNewReport(3,App.mDataSource_MySql,"SELECT * FROM T1";)

App.mDataSource:
mDataSource_MySql="mysql://host='localhost', port=3306, dbname='database', user='userdb', timeout = 5, password = 'passworddb'".
Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
Hi,
I did everything you told me the error I keep getting is this :



MakeNewReport:
mReport=app.mProject.MakeNewReport(3,App.mDataSource_MySql,"SELECT * FROM T1";)

App.mDataSource:
mDataSource_MySql="mysql://host='localhost', port=3306, dbname='database', user='userdb', timeout = 5, password = 'passworddb'".
Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
Unhandled VException
Message:

Stack:
_Z23throwValentineExceptionjRKN3fbl6StringE
_Z12ProceedErrorRN3fbl10xExceptionE
_Z35VProject_MakeNewReport_DataSource_1P16REALobjectStructiP16REALstringStructS2_
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello, Gabriele

Valentina plugin uses exceptions to notify the application, if something goes wrong.
Each exception has error number and description text.

It is necessary to catch an exception and handle it some way, so the application will be able to continue processing requests.

You can get exception message and show it to the user, if you just want to know, what's the problem:


Dim r As VReport
Try
r = prj.MakeNewReport( ...
Catch e As VException
MsgBox e.Message
End

Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
HI, Sergey
After various tests , I noticed that the problem occurs when I do I value mProject.

dim f as FolderItem
f=GetFolderItem("";).Parent.Child("Reports";).Child("reports.vsp";)
mProject=new VProject(f)
mProject.Open

I set the permissions as you suggested...
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello, Gabriele

Please try to surround suspicious block of code with Try...Catch, as I suggested before:


Try
mProject=new VProject(f)
mProject.Open
Catch e As VException
MsgBox e.Message
End


You should see the reason
Kommentar
There are no comments made yet.
Gabriele Roggia Akzeptierte Antwort
Hi,

error number 365829:
but not have a message...
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
This error means that file could not be opened.

Let's see, if Xojo can find this file. Can you try, for example:

dim f as FolderItem
f=GetFolderItem("").Parent.Child("Reports").Child("reports.vsp")
If f <> nil And f.Exists Then
MsgBox "Exists: " + f.Name
Else
MsgBox "File doesn't exist"
End If

Kommentar
There are no comments made yet.
  • Seite :
  • 1


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

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories