Tuesday, March 12, 2013

Dune HD "Error: file can't be played"

I recently got a "Error: file can't be played" when I tried to play a file in my Dune HD player (it was working less than 12 hours ago).

How I solved it was to re-flash my firmware. It doesn't seem to have any adverse effect besides wasting my time. Here's how I did it in my Dune HD.


  1. Go to "Setup -> Miscellaneous -> Firmware Upgrade"
  2. Select "Check Available Updates"
  3. It tells me "no new firmware version available" (If there is a new firmware, I'd suggest upgrading. If so, you can ignore the below steps.)
  4. Select "Show all versions".
  5. Select the current version (it stated there "current")
  6. Select "Upgrade"

Hths



Player: Dune HD Smart B1
Player purchased in: 2012
Player firmware: 121018_0846

NAS: Synology DS212

Wednesday, December 21, 2011

Eclipse settings

Eclipse settings are saved in the workspace/.metadata.


So for example my workspace is /gerardsetho/workspace,
then my Subclipse repository directories are stored in: 
/gerardsetho/workspace/.metadata/.plugins/org.tigris.subversion.subclipse.core/.svnProviderState


Might be useful when upgrading Eclipse versions (e.g. I wouldn't have to retype all the SVN repositories).

Wednesday, November 2, 2011

Null Object Reference in Flex 4's CrossDomainRSLItem

I just upgraded my computer and re-installed Eclipse and Flash Builder 4.5. And I ran into a familiar error:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::CrossDomainRSLItem()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\CrossDomainRSLItem.as:115]
at mx.core::FlexModuleFactory/getRSLInfo()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:493]
at mx.core::FlexModuleFactory/update()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:368]
at mx.core::FlexModuleFactory/moduleInitHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:709]

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::CrossDomainRSLItem()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\CrossDomainRSLItem.as:115]
at mx.core::FlexModuleFactory/getRSLInfo()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:493]
at mx.core::FlexModuleFactory/update()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:368]
at mx.core::FlexModuleFactory/moduleCompleteHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:718]

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::CrossDomainRSLItem()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\CrossDomainRSLItem.as:115]
at mx.core::FlexModuleFactory/getRSLInfo()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:493]
at mx.core::FlexModuleFactory/update()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:368]
at mx.core::FlexModuleFactory/timerHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:732]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()


The last error just kept repeating infinitely.

This happened before so I'm just writing this down that I won't forget again what the fix was.

In my case, this happened because my Flex compiled SWF was loaded by another Flex compiled SWF. No issues there. The issue was: the my SWF (lets call it "baby SWF") was compiled in Flex SDK 4.5. The other SWF ("papa SWF") was compiled in Flex 4.1. 

The solution is to recompile baby SWF using SDK 4.1. This is a 4 step process:
  1. download the Flex 4.1 SDK
  2. add the Flex 4.1 SDK to the list of Eclipse SDK
  3. change my baby SWF's project settings to use Flex 4.1
  4. recompile and deploy

#1. I downloaded it here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4. I downloaded the "Adobe Flex SDK"

#2. In Eclipse preferences, under Flash Builder -> Installed Flex SDKs, click "Add". Browse to the Flex 4.1 SDK, and call it something sensible.

#3. In the baby SWF's project settings, under "Flex Compiler", select "Use a specific SDK" and select the 4.1 SDK.

#4. Happy developer...


Thursday, August 11, 2011

PostgreSQL server doesn't start in OS X

My PostgreSQL server is an EnterpriseDB product. It was installed using their installer. Suddenly one day, while watching a YouTube video, my computer hung. I had to restart OS X Snow Leopard (10.6), and after the restart, I couldn't connect to my PostgreSQL server: it wouldn't start. Even restarting Snow Leopard didn't help.


So I checked Snow Leopard's launchctl, which was responsible for starting processes at startup. 



sudo launchctl list |grep post
549 1 com.edb.launchd.postgresql-9.0




Not good. The second number tells me that postmaster has exited with a value of 1. Which most Unix users will know is an exit with error.



So OS X is launching the postmaster, but postmaster keeps exiting with an error. So what's the error? I'll try to launch postmaster in the exact same way that OS X is trying to launch, but I'll do it on the command line, so I can see the error myself.



First, I got to find the command that Launchctl uses. I thus open "/Library/LaunchDaemons/com.edb.launchd.postgresql-9.0.plist":



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <false/>
        <key>Label</key>
        <string>com.edb.launchd.postgresql-9.0</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Library/PostgresPlus/9.0SS/bin/postmaster</string>
                <string>-D/Library/PostgresPlus/9.0SS/data</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    <key>UserName</key>
    <string>postgres</string>
    <key>KeepAlive</key>
    <dict>
         <key>SuccessfulExit</key>
         <false/>
    </dict>
</dict>
</plist>


This tells me the command to run is "sudo /Library/PostgresPlus/9.0SS/bin/postmaster -D/Library/PostgresPlus/9.0SS/data". So I run that:



"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.



Ok. Can't execute that command as root. I know that PostgreSQL server is started under the user "postgres". So I try that:

sudo -u postgres /Library/PostgresPlus/9.0SS/bin/postmaster -D/Library/PostgresPlus/9.0SS/data

GMT FATAL:  lock file "postmaster.pid" already exists
GMT HINT:  Is another postmaster (PID 62) running in data directory "/Library/PostgresPlus/9.0SS/data"?


Ahhhh… Apparently another process has opened the pid lock file. Next step is to kill that offending process and try again. I can do it on the command line, but where possible, I try to do it using OS X's GUI :) Steve wants it done his way… So I open Activity Monitor, find PID = 62, and "Quit Process".

Everything is now fixed.


Tuesday, August 2, 2011

"An internal build error has occurred. Right-click for more information"

This has to be the most irritating compiler error description ever in the Flex compiler in Flash Builder 4 for Eclipse.


I opened up the "error log" view in Eclipse, and saw that Macromedia (now Adobe)'s parser was throwing an exception "java.lang.ClassCastException: macromedia.asc.parser.MetaDataEvaluator$KeyValuePair cannot be cast to macromedia.asc.parser.MetaDataEvaluator$KeylessValue"


No help there.


I then found the issue. In my case, it was a bad coding that was actually valid syntax:



private var fileLoadIsComplete = Boolean = false;



This should be 



private var fileLoadIsComplete : Boolean = false;



My only advice is to start commenting out recent code until you find the offending line that caused the "internal build error".

Tuesday, May 17, 2011

Bug "One or more constraints have not been satisfied"

I get the error message:


"Errors were encountered while creating the project.


Reason:
One or more constraints have not been satisfied"


This happens when I try to create a combined Java / Flex project using WTP (Web Tools Platform) in Eclipse 3.6 (Helios). Searching the Internet, this problem doesn't seem very widespread. Indeed a lot of people recommended to simply separate the Java side of the Flex Remote application and the Flex side of the Flex Remote application into 2 separate projects.


I have considered this, but I would still like to have both parts in the same Eclipse project. So how do I do this?


The idea is to not use the WTP wizard to create the combined Java / Flex project, but to do it manually myself. Below is a screen cast that will make it clear.






Here is a summary of what I did in the screen cast:

  1. create a Dynamic Web Project
  2. deploy to Glassfish
  3. copy BlazeDS jar files to WEB-INF/libs folder
  4. create WEB-INF/flex folder
  5. copy BlazeDS config files to WEB-INF/flex folder
  6. edit web.xml to deploy the BlazeDS MessageBroker servlet
  7. add Flex Project nature to the project, setting "bin-debug" as the output folder
  8. edit .settings 

In the screen cast, I paste some standard BlazeDS configuration. Here's what I pasted:





  <servlet>
  <servlet-name>MessageBrokerServlet</servlet-name>
  <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
  <init-param>
  <param-name>services.configuration.file</param-name>
  <param-value>/WEB-INF/flex/services-config.xml</param-value>
  </init-param>
  <init-param>
  <param-name>flex.write.path</param-name>
  <param-value>/WEB-INF/flex</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
  </servlet>


  <servlet-mapping>
  <servlet-name>MessageBrokerServlet</servlet-name> 
  <url-pattern>/messagebroker/*</url-pattern>
  </servlet-mapping>

Thursday, May 5, 2011

Changing the context root of a Dynamic Web Project in Eclipse

I always hated that when I created a Dynamic Web Project in Eclipse (I used 3.4 and 3.6), the context root of the deployed application was always the same as my project name. So I can't have a descriptive project name like 'The Company - concept test 1'. I'd have to have names like 'boc' as my Eclipse project name.


So now (yes, call me slow), I found out how I can dynamically change the context root that Eclipse will deploy my project application with.


When I create a Dynamic Web Project, a .settings folder would be automatically created for me. In that folder, in an XML file called: org.eclipse.wst.common.component, there will be elements called 'property'. One of those elements has a name-value attribute pair called 'context-root'. Change the value of that attribute, and republish your project.


Yes.