Post

1 follower Follow
0
Avatar

Apprenda Super Calculator

When I try to promote the super calculator tutorial, I get an error in staging results. An

unexpected error occurred during the staging process: An error occurred while

processing configuration basepath tokens..

Every thing else is fine.

Steven Chen

Please sign in to leave a comment.

59 comments

0
Avatar

Hi Steven,

What environment are you working against, ApprendaCloud or a local copy of Apprenda Express?

Have you looked at the Event Logs tab in the Developer Portal / SOC to see if there was a more descriptive error message recorded?

 

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Hello, I am using Apprenda Express. I did try to look in the event logs, but it didn't give me anything else.

Steven Chen 0 votes
0
Avatar

Can you confirm that the code runs locally?

Typically errors during staging happen due to misconfiguration. If it does run locally, investigate the sections of the configuration that are being local / live switched for possible syntax errors.

Bryan Gregorius 0 votes
0
Avatar

Hi Steve,

From within Visual Studio, verify the configuration by launching the service. To do this, right-click the project and choose Debug -> Start New Instance to launch the service with WCF Service Host.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Ok,

So when I run, I get an error in CalculatorserviceProxy.cs in the method GetCalculationAudits. I get an EndpointNotFoundException.

Steven Chen 0 votes
0
Avatar

Hi Steven,

Can you verify that the AppConfig/WebConfig files match exactly to what is specified in the tutorial? It appears as though  the Client and Service are having trouble communicating.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Hi Steven,

Did you already complete the tutorial or are you still working on it?

It's possible that you are in a stage in which you wont be able to test out your progress until you complete that section.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Yes, I did finish and I'm trying to promote it. However, I still doesn't work. I downloaded the sample but it also doesn't work as well. Perhaps there is a problem with Apprenda itself?

Steven Chen 0 votes
0
Avatar

Hi Steven,

I just downloaded the latest version of the Calculator demo and was able to deploy it without issues. Can you verify which Calculator Demo are you running (regular or SaaS), and that the version of the Application, Platform and SDK match?

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Great,

Could you verify that you have the Apprenda 4.5 SDK installed in your machine? If you are running a previous version, please make sure to uninstall it prior to installing the newer one. You can find the download file here: http://docs.apprenda.com/sites/default/files/4-5Apprenda%20SDK.zip

Once your SDK matches that of the Application, you can open your SQL instance and create a new Database called 'Calculator'. You can then generate a table using the ApplicationProvisioning_Script located in your solution. After that, modify the SQL Server and Instance Name found in the connection string of your App.Config file. This will allow you to run the application locally thus ruling out most configuration issues.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Sure,

The Calculator Application uses a Database to store the Audits. In order to run the application locally, you need to create the Database Table.

Within your Solution, you can find a .sql file called 'ApplicationProvisioning_Script'. This file should contain the necessary information to generate the database table needed to run the application. You need to log into your SQL Server Management Studio tool and create a new Database (right click -> new Database). Afterwards execute a new query against the database, and on the query, input the contents of the sql file above.

Once you have the Database set up, you need to modify your application to communicate with the database. In order to do this, you need to modify the App.Config file located within your solution. Towards the end of the file, you will see a 'Connection String' section. There is going to be a segment that says 'Server / Instance'; you need to modify that to match the location of your database. If you are running locally, using '(localhost)' should do the trick.

Once the database is set up and your application configured, you should be ready to launch the application locally. 

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

I did as you asked, but I still have issues with promoting. For the server/instance, am I replacing it with the name of my server?

Steven Chen 0 votes
0
Avatar

Hi Steven,

The changes we are making should only affect the local version of your application. This is to determine if the root of the problem is the platform or the application. Promoting the application should still fail.

For the server/instance field, it should be the name of  your SQL server/instance. If you do not know it, please contact your Server Admin to determine it.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

When I try to run it locally, I get an error on CalculatorService.Calculator.

 

Please try changing the HTTP port to 8733 or running as Administrator.

System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:40001/Service/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied

   at System.Net.HttpListener.AddAllPrefixes()

   at System.Net.HttpListener.Start()

   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()

   --- End of inner exception stack trace ---

   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()

   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)

   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)

   at System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)

   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

   at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)

   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)

   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

   at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)

System.Net.HttpListenerException (0x80004005): Access is denied

   at System.Net.HttpListener.AddAllPrefixes()

   at System.Net.HttpListener.Start()

   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()

Steven Chen 0 votes
0
Avatar

Hi Steven,

You need to have administrator permissions to host the services on your machine. If you are the owner/admin of your machine, close visual studio, and right click it. You should see a 'Run as Admin' option. From there, you can open the solution and run it again.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

That means that the service and website were hosted.

On the bottom right of your taskbar, you should see a program called 'IIS Express'. If you right click it, you will see the root address under which your UI was hosted. You can open that address in your browser to access the application.

The address will look something like this:  http://localhost:55798/

Best,

Bernie

 

Bernie Herdan 0 votes
0
Avatar

Ok, when I run the address I get the error More data was expected, but EOF was reached.

 

public string[] GetCalculationAudits()

Line 34:         {

Line 35:             return base.Channel.GetCalculationAudits();

Line 36:         }

Line 37:

 

In the connection string I have

<add connectionString="Data Source=2013-9\SQLEXPRESS;Initial Catalog=Calculator;Integrated Security=True;Pooling=False" name="CalculatorDB" providerName="System.Data.SqlClient"/>

 

 

Steven Chen 0 votes
0
Avatar

Is that using your solution or the completed one from our site?

It still appears as though you are unable to access the Database. Try modifying the connection string to include a username and password.

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

Okay, I reloaded the sample solution and ran it again. I got this error.

Could not load file or assembly 'Apprenda.Configuration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Steven Chen 0 votes
0
Avatar

Hi Steven,

It still appears as though the SDK is not the correct version. Did you uninstall, download and install the latest version as mentioned above?

Best,

Bernie

Bernie Herdan 0 votes
0
Avatar

A quick way would be to open the "Add or Remove Programs" setting page, you can examine the SDK version as shown in the image attached.

Bernie Herdan 0 votes