CMU-Sphinx : NullPointerException at recognizer.allocate() - nullpointerexception

I've been trying to set up CMU-Sphinx4 on my PC in order to make an application using speech Recognition. I was able to setup most of the parts and configuration and trying to run the HelloWorld application provided by Sphinx, but stuck with NullPointerExcetption at recognizer.allocate();.
Complete Stack Trace :
12:34:45.501 WARNING dictionary Missing word: <sil>
12:34:45.517 WARNING jsgfGrammar Can't find pronunciation for <sil>
12:34:45.517 WARNING dictionary Missing word: <sil>
12:34:45.517 WARNING jsgfGrammar Can't find pronunciation for <sil>
Exception in thread "main" java.lang.NullPointerException
at edu.cmu.sphinx.linguist.flat.SentenceHMMState.collectStates(SentenceHMMState.java:635)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.compileGrammar(FlatLinguist.java:452)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocate(FlatLinguist.java:304)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.allocate(SimpleBreadthFirstSearchManager.java:646)
at edu.cmu.sphinx.decoder.AbstractDecoder.allocate(AbstractDecoder.java:87)
at edu.cmu.sphinx.recognizer.Recognizer.allocate(Recognizer.java:168)
at com.cmu.sphinx.HelloWorld.main(HelloWorld.java:42)
Code:
package com.cmu.sphinx;
import edu.cmu.sphinx.frontend.util.Microphone;
import edu.cmu.sphinx.recognizer.Recognizer;
import edu.cmu.sphinx.result.Result;
import edu.cmu.sphinx.util.props.ConfigurationManager;
public class HelloWorld {
public static void main(String[] args) {
ConfigurationManager cm;
if (args.length > 0) {
cm = new ConfigurationManager(args[0]);
} else {
cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml"));
}
Recognizer recognizer = (Recognizer) cm.lookup("recognizer");
recognizer.allocate();
// start the microphone or exit if the program if this is not possible
Microphone microphone = (Microphone) cm.lookup("microphone");
if (!microphone.startRecording()) {
System.out.println("Cannot start microphone.");
recognizer.deallocate();
System.exit(1);
}
System.out.println("Say: (Good morning | Hello) ( Bhiksha | Evandro | Paul | Philip | Rita | Will )");
// loop the recognition until the programm exits.
while (true) {
System.out.println("Start speaking. Press Ctrl-C to quit.\n");
Result result = recognizer.recognize();
if (result != null) {
String resultText = result.getBestFinalResultNoFiller();
System.out.println("You said: " + resultText + '\n');
} else {
System.out.println("I can't hear what you said.\n");
}
}
}
}
Config File :
<?xml version="1.0" encoding="UTF-8"?>
<!--
Sphinx-4 Configuration file
-->
<!-- ******************************************************** -->
<!-- an4 configuration file -->
<!-- ******************************************************** -->
<config>
<!-- ******************************************************** -->
<!-- frequently tuned properties -->
<!-- ******************************************************** -->
<property name="logLevel" value="WARNING"/>
<property name="absoluteBeamWidth" value="-1"/>
<property name="relativeBeamWidth" value="1E-80"/>
<property name="wordInsertionProbability" value="1E-36"/>
<property name="languageWeight" value="8"/>
<property name="frontend" value="epFrontEnd"/>
<property name="recognizer" value="recognizer"/>
<property name="showCreations" value="false"/>
<!-- ******************************************************** -->
<!-- word recognizer configuration -->
<!-- ******************************************************** -->
<component name="recognizer" type="edu.cmu.sphinx.recognizer.Recognizer">
<property name="decoder" value="decoder"/>
<propertylist name="monitors">
<item>accuracyTracker </item>
<item>speedTracker </item>
<item>memoryTracker </item>
</propertylist>
</component>
<!-- ******************************************************** -->
<!-- The Decoder configuration -->
<!-- ******************************************************** -->
<component name="decoder" type="edu.cmu.sphinx.decoder.Decoder">
<property name="searchManager" value="searchManager"/>
</component>
<component name="searchManager"
type="edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager">
<property name="logMath" value="logMath"/>
<property name="linguist" value="flatLinguist"/>
<property name="pruner" value="trivialPruner"/>
<property name="scorer" value="threadedScorer"/>
<property name="activeListFactory" value="activeList"/>
</component>
<component name="activeList"
type="edu.cmu.sphinx.decoder.search.PartitionActiveListFactory">
<property name="logMath" value="logMath"/>
<property name="absoluteBeamWidth" value="${absoluteBeamWidth}"/>
<property name="relativeBeamWidth" value="${relativeBeamWidth}"/>
</component>
<component name="trivialPruner"
type="edu.cmu.sphinx.decoder.pruner.SimplePruner"/>
<component name="threadedScorer"
type="edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer">
<property name="frontend" value="${frontend}"/>
</component>
<!-- ******************************************************** -->
<!-- The linguist configuration -->
<!-- ******************************************************** -->
<component name="flatLinguist"
type="edu.cmu.sphinx.linguist.flat.FlatLinguist">
<property name="logMath" value="logMath"/>
<property name="grammar" value="jsgfGrammar"/>
<property name="acousticModel" value="wsj"/>
<property name="wordInsertionProbability"
value="${wordInsertionProbability}"/>
<property name="languageWeight" value="${languageWeight}"/>
<property name="unitManager" value="unitManager"/>
</component>
<!-- ******************************************************** -->
<!-- The Grammar configuration -->
<!-- ******************************************************** -->
<component name="jsgfGrammar" type="edu.cmu.sphinx.jsgf.JSGFGrammar">
<property name="dictionary" value="dictionary"/>
<property name="grammarLocation"
value="resource:/com/cmu/sphinx/"/>
<property name="grammarName" value="hello"/>
<property name="logMath" value="logMath"/>
</component>
<!-- ******************************************************** -->
<!-- The Dictionary configuration -->
<!-- ******************************************************** -->
<component name="dictionary"
type="edu.cmu.sphinx.linguist.dictionary.FastDictionary">
<property name="dictionaryPath"
value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d"/>
<property name="fillerPath"
value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict"/>
<property name="addSilEndingPronunciation" value="false"/>
<property name="allowMissingWords" value="false"/>
<property name="unitManager" value="unitManager"/>
</component>
<!-- ******************************************************** -->
<!-- The acoustic model configuration -->
<!-- ******************************************************** -->
<component name="wsj"
type="edu.cmu.sphinx.linguist.acoustic.tiedstate.TiedStateAcousticModel">
<property name="loader" value="wsjLoader"/>
<property name="unitManager" value="unitManager"/>
</component>
<component name="wsjLoader" type="edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader">
<property name="logMath" value="logMath"/>
<property name="unitManager" value="unitManager"/>
<property name="location" value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz"/>
<property name="modelDefinition" value="etc/WSJ_clean_13dCep_16k_40mel_130Hz_6800Hz.4000.mdef"/>
<property name="dataLocation" value="cd_continuous_8gau/"/>
</component>
<!-- ******************************************************** -->
<!-- The unit manager configuration -->
<!-- ******************************************************** -->
<component name="unitManager"
type="edu.cmu.sphinx.linguist.acoustic.UnitManager"/>
<!-- ******************************************************** -->
<!-- The frontend configuration -->
<!-- ******************************************************** -->
<component name="frontEnd" type="edu.cmu.sphinx.frontend.FrontEnd">
<propertylist name="pipeline">
<item>microphone </item>
<item>preemphasizer </item>
<item>windower </item>
<item>fft </item>
<item>melFilterBank </item>
<item>dct </item>
<item>liveCMN </item>
<item>featureExtraction </item>
</propertylist>
</component>
<!-- ******************************************************** -->
<!-- The live frontend configuration -->
<!-- ******************************************************** -->
<component name="epFrontEnd" type="edu.cmu.sphinx.frontend.FrontEnd">
<propertylist name="pipeline">
<item>microphone </item>
<item>dataBlocker </item>
<item>speechClassifier </item>
<item>speechMarker </item>
<item>nonSpeechDataFilter </item>
<item>preemphasizer </item>
<item>windower </item>
<item>fft </item>
<item>melFilterBank </item>
<item>dct </item>
<item>liveCMN </item>
<item>featureExtraction </item>
</propertylist>
</component>
<!-- ******************************************************** -->
<!-- The frontend pipelines -->
<!-- ******************************************************** -->
<component name="dataBlocker" type="edu.cmu.sphinx.frontend.DataBlocker">
<!--<property name="blockSizeMs" value="10"/>-->
</component>
<component name="speechClassifier"
type="edu.cmu.sphinx.frontend.endpoint.SpeechClassifier">
<property name="threshold" value="13"/>
</component>
<component name="nonSpeechDataFilter"
type="edu.cmu.sphinx.frontend.endpoint.NonSpeechDataFilter"/>
<component name="speechMarker"
type="edu.cmu.sphinx.frontend.endpoint.SpeechMarker" >
<property name="speechTrailer" value="50"/>
</component>
<component name="preemphasizer"
type="edu.cmu.sphinx.frontend.filter.Preemphasizer"/>
<component name="windower"
type="edu.cmu.sphinx.frontend.window.RaisedCosineWindower">
</component>
<component name="fft"
type="edu.cmu.sphinx.frontend.transform.DiscreteFourierTransform">
</component>
<component name="melFilterBank"
type="edu.cmu.sphinx.frontend.frequencywarp.MelFrequencyFilterBank">
</component>
<component name="dct"
type="edu.cmu.sphinx.frontend.transform.DiscreteCosineTransform"/>
<component name="liveCMN"
type="edu.cmu.sphinx.frontend.feature.LiveCMN"/>
<component name="featureExtraction"
type="edu.cmu.sphinx.frontend.feature.DeltasFeatureExtractor"/>
<component name="microphone"
type="edu.cmu.sphinx.frontend.util.Microphone">
<property name="closeBetweenUtterances" value="false"/>
</component>
<!-- ******************************************************* -->
<!-- monitors -->
<!-- ******************************************************* -->
<component name="accuracyTracker"
type="edu.cmu.sphinx.instrumentation.BestPathAccuracyTracker">
<property name="recognizer" value="${recognizer}"/>
<property name="showAlignedResults" value="false"/>
<property name="showRawResults" value="false"/>
</component>
<component name="memoryTracker"
type="edu.cmu.sphinx.instrumentation.MemoryTracker">
<property name="recognizer" value="${recognizer}"/>
<property name="showSummary" value="false"/>
<property name="showDetails" value="false"/>
</component>
<component name="speedTracker"
type="edu.cmu.sphinx.instrumentation.SpeedTracker">
<property name="recognizer" value="${recognizer}"/>
<property name="frontend" value="${frontend}"/>
<property name="showSummary" value="true"/>
<property name="showDetails" value="false"/>
</component>
<!-- ******************************************************* -->
<!-- Miscellaneous components -->
<!-- ******************************************************* -->
<component name="logMath" type="edu.cmu.sphinx.util.LogMath">
<property name="logBase" value="1.0001"/>
<property name="useAddTable" value="true"/>
</component>
</config>
Grammar
#JSGF V1.0;
/**
* JSGF Grammar for Hello World example
*/
grammar hello;
public <greet> = (Good morning | Hello) ( Bhiksha | Evandro | Paul | Philip | Rita | Will );

Finally able to run "HelloWorld" application of Sphinx4. For the above mentioned problem, I had to change the config file.
Earlier the fillerPath property was:
<property name="fillerPath"
value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict"/>
I just added the fillerdict and it worked:
<property name="fillerPath"
value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict"/>

It says your filler dictionary is missing the word <sil>. Your filler path is not correct. It needs to load noisedict.
This part of the config file:
<property name="fillerPath"
value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict"/>
must be something like
<property name="fillerPath"
value="resource:/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/noisedict"/>

Related

SQL Delete query is not working in apache camel

SQL Delete query is not working in camel, as it stuck at the SQL query and nothing happens. Have tried to execute same query in DB directly, it is working fine as expected.
Below is the glimpse of code.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean class="org.apache.commons.dbcp2.BasicDataSource"
destroy-method="close" id="OracleConnection">
<property name="driverClassName"
value="${Oracle.DB.DriverClassName}" />
<property name="url" value="${Oracle.DB.Url}" />
<property name="username" value="${Oracle.DB.Username}" />
<property name="password" value="${Oracle.DB.Password}" />
<property name="initialSize" value="${Oracle.DB.InitialSize}" />
<property name="maxTotal" value="${Oracle.DB.MaxTotal}" />
<property name="minIdle" value="${Oracle.DB.MinIdle}" />
<property name="maxIdle" value="${Oracle.DB.MaxIdle}" />
<property name="testOnBorrow" value="true" />
<property name="testOnReturn" value="true" />
<property name="removeAbandonedOnMaintenance" value="true" />
<property name="defaultAutoCommit" value="true" />
<property name="maxWaitMillis"
value="${Oracle.DB.MaxWaitMillis}" />
</bean>
<!-- configure the Camel SQL component to use the JDBC data source -->
<bean class="org.apache.camel.component.sql.SqlComponent" id="sql">
<property name="dataSource" ref="OracleConnection" />
</bean>
<camelContext id="GenerateOTPContext"
xmlns="http://camel.apache.org/schema/spring">
<route id="GenerateOTPMainRoute" streamCache="true">
<from id="_from1"
uri="restlet:http://localhost:9092/ESB/dbserviceapi/generateOTP?restletMethod=POST" />
<setHeader headerName="deleteQuery" id="_setHeader2">
<simple>sql:DELETE FROM MOBILE_OTP_DETAILS WHERE created_dt < SYSDATE - INTERVAL '20' MINUTE</simple>
</setHeader>
<log id="_log2" message="Delete query ${header.deleteQuery}" />
<recipientList delimiter="~" id="_recipientList2"
ignoreInvalidEndpoints="true">
<simple>${header.deleteQuery}</simple>
</recipientList>
<onException id="_onException1" useOriginalMessage="true">
<exception>java.sql.SQLException</exception>
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<log id="_log3"
message="ESBUUID : ${exchangeId} Exception occurred in GenerateOTPAdapter : ${exception.stacktrace}" />
</onException>
</route>
</camelContext>
</beans>
I'm using dbcp2, pool2 and camel-sql components to connect to DB.
Any suggestions please?
Have found the issue, I had created my own table but missed to grant the delete permission, so it was not deleting the data in DB from camel components so I granted the permission for my table and it worked.

How to config activiti.org to work with IBM Domino LDAP groups

I work on integration IBM Domino with activiti.org workflow engine. I need to connect Activiti with Domino LDAP in order to retrive users and groups.
I already can log in with my Domino credentials but I'm not able to resolve user groups. My user is a member of ACTIVITI_ADMINS domino group but he doesn't see activiti-explorer administration menu (the one that default kermit user see). I've made the following modifications in Activiti xml config files. What should I add/rewrite in my config files in order to resolve user groups?
activiti-custom-context.xml
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!--...-->
<property name="configurators">
<list>
<bean class="org.activiti.ldap.LDAPConfigurator">
<!-- Server connection params -->
<property name="server" value="ldap://myDominoLdapServer" />
<property name="port" value="389" />
<property name="user" value="cn=User Ldap, ou=myUnit1, ou=myUnit2, o=myCompany" />
<property name="password" value="myPassword" />
<!-- Query params -->
<property name="baseDn" value="o=myCompany" />
<property name="queryUserByUserId" value="(&(objectClass=inetOrgPerson)(displayname={0}))" />
<property name="queryUserByFullNameLike" value="(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
<!-- Attribute config -->
<property name="userIdAttribute" value="displayname" />
<property name="userFirstNameAttribute" value="GivenName" />
<property name="userLastNameAttribute" value="sn" />
<property name="userEmailAttribute" value="mail" />
<property name="groupIdAttribute" value="cn" />
<property name="groupNameAttribute" value="cn" />
</bean>
</list>
</property>
</bean>
activiti-ui-context.xml
<bean name="explorerApp" class="org.activiti.explorer.ExplorerApp" scope="session">
<property name="environment" value="${activiti.ui.environment}" />
<property name="useJavascriptDiagram" value="${activiti.ui.jsdiagram}" />
<property name="i18nManager" ref="i18nManager" />
<property name="viewManager" ref="viewManager" />
<property name="notificationManager" ref="notificationManager" />
<property name="attachmentRendererManager" ref="attachmentRendererManager" />
<property name="formPropertyRendererManager" ref="formPropertyRendererManager" />
<property name="variableRendererManager" ref="variableRendererManager" />
<property name="applicationMainWindow" ref="mainWindow" />
<property name="componentFactories" ref="componentFactories" />
<property name="workflowDefinitionConversionFactory" ref="workflowDefinitionConversionFactory" />
<property name="loginHandler" ref="activitiLoginHandler" />
<property name="simpleWorkflowJsonConverter" ref="simpleWorkflowJsonConverter" />
<property name="adminGroups">
<list>
<value>ACTIVITI_ADMINS</value>
</list>
</property>
<property name="userGroups">
<list>
<value>user</value>
</list>
</property>
</bean>
Your configuration looks right so the problem must have something to do with the LDAP query used to retrieved the groups for the user:
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
Is this query returning the ACTIVITI_ADMIN group?
Well, I've found that the baseDN entry was the reason of my problem. I set empty value and Activiti is resolving my group now. The activiti-custom-context.xml file contains the following code:
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!--...-->
<property name="configurators">
<list>
<bean class="org.activiti.ldap.LDAPConfigurator">
<!-- Server connection params -->
<property name="server" value="ldap://myDominoLdapServer" />
<property name="port" value="389" />
<property name="user" value="cn=User Ldap, ou=myUnit1, ou=myUnit2, o=myCompany" />
<property name="password" value="myPassword" />
<!-- Query params -->
<!--MY CHANGE START-->
<property name="baseDn" value="" />
<!--MY CHANGE END-->
<property name="queryUserByUserId" value="(&(objectClass=inetOrgPerson)(displayname={0}))" />
<property name="queryUserByFullNameLike" value="(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
<!-- Attribute config -->
<property name="userIdAttribute" value="displayname" />
<property name="userFirstNameAttribute" value="GivenName" />
<property name="userLastNameAttribute" value="sn" />
<property name="userEmailAttribute" value="mail" />
<property name="groupIdAttribute" value="cn" />
<property name="groupNameAttribute" value="cn" />
</bean>
</list>
</property>
</bean>

Do I need to manually set authenticationManager in spring?

After loading ApplicationContext I got a warning like this:
_ INFO: No authentication manager set. Reauthentication of users when changing passwords will not be performed. _
My Context.XML file is like this:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.6.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<!-- =============== Security =============== -->
<sec:method-security-metadata-source
id="method-security-metadata-source">
<sec:protect access="MyAccess"
method="springsecuritytest._00_base.AuthenticationTester.*" />
</sec:method-security-metadata-source>
<sec:global-method-security
access-decision-manager-ref="accessDecisionManager"
secured-annotations="enabled" pre-post-annotations="enabled"
proxy-target-class="true">
<sec:protect-pointcut
expression="execution(* springsecuritytest._00_base.AuthenticationTester.*(..))"
access="ROLE_USER_BASIC_099" />
<!-- <sec:protect-pointcut access="ROLE_USER_BASIC_099" expression="execution(*
springsecuritytest._00_base.AuthenticationTester.* (..))" /> -->
</sec:global-method-security>
<sec:authentication-manager alias="authenticationManager"
erase-credentials="true">
<sec:authentication-provider>
<sec:jdbc-user-service data-source-ref="dataSource" />
<!-- role-prefix="ROLE_" /> -->
</sec:authentication-provider>
</sec:authentication-manager>
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased">
<property name="decisionVoters">
<list>
<bean class="org.springframework.security.access.vote.RoleVoter" />
<!-- <bean class="org.springframework.security.access.vote.AuthenticatedVoter"/> -->
</list>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/spring_security" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
any body can help me?
I found it, it seems to be caused by the bean definition model I used.
I too was experiencing this nebulous message in the log. I had to add a reference to my authentication manager in the http and UserDetailsManager in the xml configuration file. This will depend on how Spring security is configured, but hopefully it will help!
<security:http auto-config="true" authentication-manager-ref="authenticationManager" use-expressions="true">
<security:remember-me data-source-ref="dataSource" user-service-ref="userDetailsManagerDao" />
<security:intercept-url pattern="/" access="permitAll" />
<security:intercept-url pattern="/home" access="permitAll" />
<security:intercept-url pattern="/login" access="permitAll" />
<security:intercept-url pattern="/registration" access="permitAll" />
<security:intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<security:form-login login-page="/login" default-target-url="/default" login-processing-url="/login/authenticate"
username-parameter="username" password-parameter="password" authentication-failure-url="/login?error" />
<security:logout logout-url="/logout" logout-success-url="/login?logout" />
</security:http>
<bean id="userDetailsManagerDao" class="com.alphatek.tylt.repository.UserDetailsManagerJdbcDao">
<property name="dataSource" ref="dataSource" />
<property name="enableAuthorities" value="false" />
<property name="enableGroups" value="true" />
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<security:authentication-manager id="authenticationManager">
<security:authentication-provider user-service-ref="userDetailsManagerDao">
<security:password-encoder ref="passwordEncoder" />
</security:authentication-provider>
</security:authentication-manager>

Can I load an image file into "GTk-glad" Tool as a GUI frame to work on it?

I know that "GtK-glade" got many convinent sample GUI frame like Management UI, there are many samples using the template of Glade's inside tool, like buttons, menus, label.
But I had like to use my own frame of GUI to be costumerized for users.And I just can't find a way to load my own "image" of frame from the "Glade" tool.
By What method can I let my one "image" of frame to replace the sample frame of "Glade" tool?
Or by what kind of "GtK" glade-like tooling can do this job?
I use c souce code of Ubuntu linux. And I can't find an toolkit to update my original souce code of GUI. I only find that GTK-glade can open it .
int
main (int argc, char *argv[])
..........
GtkImage *image = NULL;
image = glade_xml_get_widget (gxml, "image1");
gtk_image_set_from_file(image,"tux.png");
my glade xml file is:
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.6 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="window1">
<property name="visible">True</property>
<property name="border_width">10</property>
<property name="title" translatable="yes">window1</property>
<property name="default_width">800</property>
<property name="default_height">480</property>
<signal name="destroy" handler="on_window1_destroy"/>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkEntry" id="entry1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">รข</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="label" translatable="yes">Hello</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_button1_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">label</property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-missing-image</property>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

Adding ContentTypes to a list with SiteDefinition

Using SharePoint 2010 and Visual Studio I have created a site definition (inheriting from the publishing site) which correctly creates all the required lists and now includes page instances in the "Pages" document library.
The Pages use the correct custom pagelayout and the correct content type, however, because the "pages" library only accepts Article, Blank and Welcome pages by default it doesnt know about my custom content types and therefore the page doesn't work as expected.
I've tried adding an EventListener on the "List Added" event, with no success, the debugging doesnt even break at my breakpoints, I've also tried the List Adding, List Item added and Site Provisioned events. None of which seem to work the way I want.
I've included the XML for the Site Definition below, how do I add my custom content types to the pages library so I dont have to manually add it?
<?xml version="1.0" encoding="utf-8"?>
<Project Title="Custom_Site_Definition" Revision="2" ListDir="" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
<NavBars>
<NavBar Name="SharePoint Top Navbar" Url="/Site Template" ID="1002" />
<!-- removed -->
</NavBars>
<Configurations>
<Configuration ID="0" Name="Custom_Site_Definition">
<Lists />
<WebFeatures>
<!-- Include the common WSSListTemplateFeatures used by CMS -->
<Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" > </Feature>
<Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" > </Feature>
<Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" > </Feature>
<Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" > </Feature>
<Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" > </Feature>
<Feature ID="00BFEA71-F600-43F6-A895-40C0DE7B0117" > </Feature>
<Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5">
</Feature>
<Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<Property Key="ChromeMasterUrl" Value=""/>
<Property Key="WelcomePageUrl" Value="$Resources:osrvcore,List_Pages_UrlName;/at-a-glance.aspx"/>
<Property Key="PagesListUrl" Value=""/>
<Property Key="AvailableWebTemplates" Value=""/>
<Property Key="AvailablePageLayouts" Value=""/>
<Property Key="SimplePublishing" Value="true" />
</Properties>
</Feature>
<Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<Property Key="InheritGlobalNavigation" Value="true"/>
<Property Key="ShowSiblings" Value="true"/>
<Property Key="IncludeSubSites" Value="true"/>
</Properties>
</Feature>
<Feature ID="94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB">
<!-- Office SharePoint Server Publishing -->
</Feature>
</WebFeatures>
<Modules>
<Module Name="Home" />
</Modules>
</Configuration>
</Configurations>
<Modules>
<Module Name="Home" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
<File Url="at-a-glance.aspx" Type="GhostableInLibrary" Level="Draft" >
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Custom Article Page.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
</File>
<!-- removed -->
</Module>
</Modules>
</Project>
Never mind, I got it...eventually
Solution was to
Add a Feature to the site definition project with the following in its elements.xml file
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentTypeBinding ContentTypeId="0x010100899F73B9F6814EA9AED9876985F28B39" ListUrl="Pages" />
</Elements>
Then add a feature dependency in the onet.xml file
<!-- Binds custom content types to Pages library.-->
<Feature ID="8290db1f-0a87-44f3-be22-28c61f9c8965">
</Feature>
and finally to add each page in a module at the end of the file (including the content type)
<File Url="at-a-glance.aspx" Type="GhostableInLibrary" Level="Draft" >
<Property Name="Title" Value="At a glance" />
<Property Name="ContentType" Value="Custom_ContentTypes_Publishing - CustomFive" />
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Custom Article Page.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
</File>