How to debug the J2ME Polish MIDlet?
How can I show the logs which are generated?
You can easly log statements with J2ME Polish using the following:
//#debug
System.out.println("Error...");
Using //#debug with J2ME Polish indicates a pre-processing directive to log the println statement.
There are various levels of logging, including debug, info, warn, error and fatal. You can define your own logging levels but I find that over exhaustive for most situtations.
The best thing I found was to add a handler to the build file within the debug section.
<handler name="http">
<parameter name="server" value="http://a.server.com:80/Debug/" />
</handler>
Will post any log information straight to a server, so you can literally see the log flow in as your application is running.
Or you can add a handler that logs to an RMS and use the J2ME Polish Logviewer sample application to view the logs stored within the RMS. The can be found in the sample directory of your J2ME Polish installation.
<handler name="rms">
<parameter name="useBackgroundThread" value="false" />
</handler>
Remember to set the varriables in the logview build file. See below:
<variables>
<variable name="polish.log.MIDletSuite" value="Demonstrator" />
<variable name="polish.log.Vendor" value="Enough Software" />
</variables>
I had a collegue at work try to debug via bluetooth but I think this doesn't actually work.
Just a note to any one reading this who is new J2ME, you cannot debug on device! MIDlets and J2ME were first concieved in the late 90's.
Related
I am quite new to freeswitch and want my directory currently hardcoded in XML config files on the server to be in a relational database. I found this tutorial:
https://saevolgo.blogspot.com/2012/07/freeswitch-with-sip-users-in-mysql-mod.html
But this seems very outdated as the GIT repository used does not exist anymore. Can anyone let me know the XML I have to fill so that it gets the users from database instead of other XML files? Per default it does this:
<users>
<X-PRE-PROCESS cmd="include" data="default/*.xml"/>
</users>
But I guess there is a similar configuration to get them from database? Thanks in advance
The FreeSWITCH Database Handler allows you to connect to databases from your Lua script:
https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+Dbh
Here is example for using Database handler with user directory
https://asterisk-pbx.ru/wiki/blog/freeswitch_directory_mysql_storage_with_lua_dbh
Although #os11k answered the question with good references I decided to go antoher way:
In /etc/freeswitch/autoload_configs/xml_curl.conf.xml I put
<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="directory">
<param name="method" value="GET" />
<param name="gateway-url" value="https://example.com/my-freeswitch-directory.xml" bindings="directory"/>
</binding>
<binding name="dialplan">
<param name="gateway-url" value="https://example.com/my-freeswitch-dialplan.xml" bindings="diaplan"/>
<param name="method" value="GET" />
</binding>
</bindings>
</configuration>
Then I am able to autogenerate the dialplan and directory on my webserver and don't need to connect to a central database with my freeswitch servers. Don't forget to activate the module xml_curl in /etc/freeswitch/autoload_configs/modules.xml
I have a Wix installer to deploy my application in IIS. I want to remove HTTP binding when it deploys.
Below is the cmd command that helps in removing the HTTP binding:
“set site /site.name:"My Project Management" /-bindings.[protocol='http',bindingInformation='*:80:']”
I want the same thing happen via wix custom action.Something like below:
<CustomAction Name="RemoveHttp_Cmd" Schedule="Before" Reference="RemoveHttp" Condition="Installed">
<Definition Property="RemoveHttp" Execute="immediate" Value=""[WindowsFolder]system32\inetsrv\appcmd.exe" set site /name:"My Project Management" /-bindings:"http/*:80:"" />
</CustomAction>
<CustomAction Name="RemoveHttp" Schedule="Before" Reference="CreateAppPool" Condition="Installed">
<Definition BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" />
</CustomAction>
It should ideally remove the binding but actually, it is not.
Please suggest the right way to do.
You might want to look at the IIS Rewrite module. It's been my experience that you can use a bootstrapper to install the module if it isn't present and with just a little bit of XML in your applications web.config set up a rule to rewrite http to https or rewrite it to a not supported page. No installer work beyond making sure the rewrite module is present should be needed.
I am getting an error when I try to follow the steps to run PowerBI using the sample solution located in PowerBI-CSharp, when importing the PBIX Desktop file into my workspace on Azure (which is the second step and 6 item in the console provisioning app )
Error message does not say anything helpful: "Ooops, something broke: A task was canceled."
I tried with different PBIX files and even different workspaces in different times, no luck yet.
Currently I am using visual studio 2015 64 bit (planning to try with VS 2013 in near future).
I also had same issue.
I solved it by performing following steps:
1) creating simple .pbix file using Power BI desktop.
2) Save it on your harddisk
3) then try to upload it using console provisioning app.
Hope this will help!!
I received similar kind of error with a message "file not found".
The issue occurs when we do not write ".pbix" extention with the file name.
For example:
if your power bi file has name "myproject" then while writing the file name in the "File name" option give name with extension as "myproject.pbix".
I faced the same issue some time ago. Multiple things were going wrong.
First, the PBIX file I attempted to upload resided on a remote Hard Drive linked in my LAN network. The 'Getting-started' app did not have permissions to read the file.
I fixed this by copying the PBIX file to my personal desktop.
Second, make sure to fill in the correct data required before-hand in the program. Edit the file power-bi-embedded-integrate-report-into-web-app/ProvisionSample/App.config to save your personal settings. This will give fast reproduction of running the code.
<!-- The Power BI API Endpoint -->
<add key="powerBiApiEndpoint" value="https://api.powerbi.com" />
<!-- The Azure Resource Manager API Endpoint-->
<add key="azureApiEndpoint" value="https://management.azure.com" />
<!-- Your Azure subscription ID -->
<add key="subscriptionId" value="" />
<!-- The Azure resource group name -->
<add key="resourceGroup" value="" />
<!-- The Power BI Workspace Collection Name -->
<add key="workspaceCollectionName" value="" />
<!-- The Power BI Workspace Collection Access Key -->
<add key="accessKey" value="" />
<!-- The Power BI Workspace-->
<add key="workspaceId" value="" />
<!-- Credentials to connect to datasource within Power BI -->
<add key="username" value="" />
<add key="password" value="" />
Note the last two values username and password are not required for uploading a PBIX file. All other values subscriptionId, resourceGroup, workspaceCollectionName, accessKey and workspaceId are a must. All this information can be found on the Azure cloud in the PowerBI workspace collection tile.
Third, make sure the workspaceId you are uploading to does not already contain a PBIX file. As far as I am concerned, it is not possible to replace a PBIX file on a workspace and therefore a new workspace must be created to upload the PBIX file to. Please correct me if I am wrong.
I'm using TFS (VS 2010) Build Definitions and XAMLs to build apps to different environments. Now, we need to push these builds to Production servers which require different credentials than what the Build Controller has.
I have been working on implementing the steps found at "Customize Team Build 2010 – Part 9: Impersonate activities (run under other credentials)" from http://www.ewaldhofman.nl/post/2010/05/28/Customize-Team-Build-2010-e28093-Part-9-Impersonate-activities-(run-under-other-credentials).aspx but I cannot figure out how to use the credentials within the XAML file.
So, I have implemented the provided solution, and have made build definitions require the credentials, but how do I implement the credentials code (which appears to be in C#) into the XAML (which is XML)?
Thanks,
Stephanie
I have solved my issue here. I wasn't aware that the activities were coded in C#, although organized through the XML.
You can use a TryCatch activity to wrap the impersonation object and dispose it in the Finally.
The XAML should look like:
<TryCatch>
<TryCatch.Variables>
<Variable x:TypeArguments="bl:Impersonation" Name="Impersonation" />
</TryCatch.Variables>
<TryCatch.Try>
<Sequence>
<mtbwa:WriteBuildMessage Message="Impersonating..." />
<ba:CreateImpersonationContext Credentials="[Credentials]" Result="[Impersonation]" />
<!-- Your activities go here -->
</Sequence>
</TryCatch.Try>
<TryCatch.Finally>
<Sequence>
<ba:DisposeImpersonationContext Impersonation="[Impersonation]" />
<mtbwa:WriteBuildMessage Message="Done with impersonation!" />
</Sequence>
</TryCatch.Finally>
</TryCatch>
I have two string properties setup in my cocoa application's app delegate which are KVC compliant. My .sdef exposes them to applescript as text read-write properties.
When I use applescript to do the following, my properties are returned correctly:
tell application "iKeepFit"
activate
properties
end tell
What gets weird is that when I try to access the property by its name, applescript editor will popup a dialog saying my app had an error. Yet xcode debug output shows no messages. Previously when my .sdef was wrong then xcode would show errors if I ran the script calling my app when it is attached to the debugger.
E.g.
propertyname <- error "Can’t get propertyname." number -1728 from «class dact»
set propertyname "value" <- error "Can’t set propertyname." number -10006 from «class dact»
Is there something that would typically cause this behavior?
I've gone through two cocoa books, an applescript book and lots of sample code and apple documentation, but they seem to all implement applescript support differently. What I've got so far is the closest to working code from trying them all out. Here's my .sdef file:
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<!-- use XInclude to include the standard suite
<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/>
-->
<suite name="iKeepFit Scripting" code="iKft"
description="Commands and classes for iKeepFit Scripting">
<class name="application" code="capp" description="The application class.">
<!-- the following names the Objective-C class where Cocoa will look for
the property accessor methods for the properties we define for
this AppleScript class. -->
<cocoa class="MyApplication"/>
<!-- the 'done' property. -->
<property name="completedactivity" code="dAct" description="An activity that was completed" type="text" access="rw">
<cocoa key="doneActivity"/>
</property>
<!-- the 'cancel' property. -->
<property name="canceledactivity" code="cAct" description="An activity that was canceled" type="text" access="rw">
<cocoa key="cancelActivity"/>
</property>
<responds-to name="completed">
<cocoa method="handleCompletedActivityScriptCommand:"/>
</responds-to>
</class>
</suite>
I commented out the standard suite stuff because surprisingly it's broken and produces the following error: .sdef warning for argument 'FileType' of command 'save' in suite 'Standard Suite': 'saveable file format' is not a valid type name.
Please help. Thanks.
I was able to find a solution. In Snow Leopard, Applescript apparently doesn't know what properties are defined in the application unless it's surrounded by a using terms from block.
using terms from application "iKeepFit"
set doneActivity to "test"
end using terms from
And for some reason the <class> element needed an id="blah" attribute in it - the only reason I've found that is by looking at the output of an .sdef editing program. The real frustrating part is that this isn't in any of the examples or documents I've read.