eiffel: type is based on unknown class (even when visible into libraries) - include-path

Trying to include a library I just created I'm unable to have the Class available even if it appears into the libraries on the group view of eiffel studio
../thirdparty/moon_time/sunriset_lib.ecf
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-21-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-21-0 http://www.eiffel.com/developers/xml/configuration-1-21-0.xsd" name="sunriset" uuid="6E7AC452-4513-4BB4-9F04-A1ABCBCC1BE3" library_target="sunriset">
<target name="sunriset">
<root all_classes="true"/>
<file_rule>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="warning" manifest_array_type="mismatch_warning">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<setting name="total_order_on_reals" value="false"/>
<setting name="dead_code_removal" value="feature"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="sunriset_tests" extends="sunriset">
<root class="APPLICATION" feature="make"/>
<option warning="warning">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing.ecf"/>
<cluster name="test" location=".\testing\" recursive="true"/>
</target>
</system>
main-raspi-app.ecf
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-21-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-21-0 http://www.eiffel.com/developers/xml/configuration-1-21-0.xsd" name="main_raspi_app" uuid="CC76847A-99AA-4FAE-A27F-CFBA76A914AF">
<target name="raspi_data_visitor">
<root class="RASPI_DATA_VISITOR_APP" feature="make"/>
<file_rule>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude>
<exclude>/\.svn$</exclude>
</file_rule>
<option warning="warning" manifest_array_type="mismatch_warning">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<setting name="executable_name" value="raspi_data_visitor"/>
<setting name="dead_code_removal" value="feature"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="json" location=".\..\thirdparty\json\library\json.ecf" readonly="false"/>
<library name="sit-platform" location=".\..\sit-platform\sit_platform_lib.ecf" readonly="false"/>
<library name="sunriset" location=".\..\thirdparty\moon_time\sunriset_lib.ecf" readonly="false"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="raspi_data_generator" extends="raspi_data_visitor">
<root class="RASPI_DATA_GENERATOR_APP" feature="make"/>
</target>
</system>

Got it!
As the SOLAR_NRJ_ADVISOR class is part of the sit-platform library, I had to include the library into the sit-platform library instead of the current project

Related

Setup VS Code to compile C++ Program

I have a C++ program that I usually compile with Code::Blocks, but now I must find a way to compile it with VS Code. I've been watching tutorials for hours, but I still can't make it happen in VS Code.
The program is really simple. Here's my project settings from Code::Blocks
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="game_test" />
<Option makefile="makefile" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="default">
<Option output="game_test" prefix_auto="1" extension_auto="1" />
<Option type="1" />
<Option compiler="gcc" />
</Target>
</Build>
<Linker>
<Add library="ws2_32" />
</Linker>
<Unit filename="admin.cpp" />
<Unit filename="common.cpp" />
<Unit filename="common.h" />
<Unit filename="database.cpp" />
<Unit filename="database_auto.cpp" />
<Unit filename="database_common.cpp" />
<Unit filename="database_common.h" />
<Unit filename="database_mysql.cpp" />
<Unit filename="main.cpp" />
<Unit filename="main.h" />
<Unit filename="memory.cpp" />
<Unit filename="memory.h" />
<Unit filename="protocal.cpp" />
<Unit filename="server.cpp" />
<Unit filename="sock.cpp" />
<Unit filename="user.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
Hope the settings from C::B will make it clear on what should be done.
Visual studio code is not an IDE it is a text editor.
You should start by adding the Microsoft Extension for C/C++.
I suggest you check this tutorial out:
https://www.youtube.com/watch?v=X7CXjKGi_ro&t=2253s
it is almost an hour long, but it really gets you into setting up an environment for c++ development in VS code.

HistoryLevel mismatch on Camunda 7.2

I deployed camunda.war (7.2) into my vanilla tomcat7 following the guide on official web-site.
Now when i starting tomcat i have the following error:
GRAVE: Error while closing command context
org.camunda.bpm.engine.ProcessEngineException: historyLevel mismatch: configuration says org.camunda.bpm.engine.impl.history.HistoryLevelAudit#21 and database says 3
In the database (ACT_GE_PROPERTY table) the historyLevel is set to 3
this is my bpm-platform.xml file
<?xml version="1.0" encoding="UTF-8"?>
<bpm-platform xmlns="http://www.camunda.org/schema/1.0/BpmPlatform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.camunda.org/schema/1.0/BpmPlatform http://www.camunda.org/schema/1.0/BpmPlatform ">
<job-executor>
<job-acquisition name="default" />
</job-executor>
<process-engine name="default">
<job-acquisition>default</job-acquisition>
<configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
<datasource>java:jdbc/solve</datasource>
<properties>
<property name="history">full</property>
<property name="databaseSchemaUpdate">true</property>
<property name="authorizationEnabled">true</property>
<property name="jobExecutorDeploymentAware">true</property>
</properties>
<plugins>
<!-- plugin enabling Process Application event listener support -->
<plugin>
<class>org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin</class>
</plugin>
<!-- plugin enabling integration of camunda Spin -->
<plugin>
<class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
</plugin>
<!-- plugin enabling connect support -->
<plugin>
<class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
</plugin>
</plugins>
</process-engine>
</bpm-platform>
EDIT
Processes.xml
<?xml version="1.0" encoding="UTF-8" ?>
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<process-archive name="MyProcess">
<process-engine>myEngine</process-engine>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
</properties>
</process-archive>
</process-application>
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd">
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/my_process" />
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
<property name="processEngineName" value="myEngine" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="deploymentResources" value="classpath*:*.bpmn" />
<property name="processEnginePlugins">
<list>
<bean id="spinPlugin" class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
</list>
</property>
</bean>
<bean id="processEngine" class="org.camunda.bpm.engine.spring.container.ManagedProcessEngineFactoryBean" destroy-method="destroy">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="MyProcess" class="org.camunda.bpm.engine.spring.application.SpringServletProcessApplication" />
<context:annotation-config />
<bean class="it.processes.Starter" />
<bean id="cudOnProcessVariableService" class="it.services.CUDonProcessVariableService" />
</beans>
Did you download the 'camunda standalone webapp' WAR for Tomcat from camunda.org/download?
If so, you should adjust the history level inside the 'application-context.xml' file by adding <property name="history" value="full"/> to the process engine configuration bean <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration>.
Otherwise it is strange that you write you install camunda.war to a vanilla Tomcat but post a reference to your bpm-platform.xml file which is not used at all when you are not using the shared process engine approach.

Hibernate-4.3.4 and Websphere EmbeddedContainer-8.5.0

is it known that Hibernate-4.3.4 to work with Websphere EmbeddedContainer-8.5.0 ?
I am getting the following exception...
org.hibernate.engine.jndi.JndiException: Unable to lookup JNDI name [java:comp/websphere/ExtendedJTATransaction]
at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:117)
at org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter$TransactionAdapter.<init>(WebSphereExtendedJtaPlatform.java:155)
at org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter$TransactionAdapter.<init>(WebSphereExtendedJtaPlatform.java:151)
at org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter.getTransaction(WebSphereExtendedJtaPlatform.java:123)
at org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter.getStatus(WebSphereExtendedJtaPlatform.java:118)
at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)
at org.hibernate.engine.transaction.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy.canRegisterSynchronization(TransactionManagerBasedSynchronizationStrategy.java:56)
at org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.canRegisterSynchronization(AbstractJtaPlatform.java:148)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.attemptToRegisterJtaSync(TransactionCoordinatorImpl.java:252)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.pulse(TransactionCoordinatorImpl.java:289)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1584)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:210)
at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:91)
at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:345)
at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:332)
at com.ibm.ws.jpa.management.JPAEMPool.getEntityManager(JPAEMPool.java:170)
at com.ibm.ws.jpa.management.JPATxEntityManager.getEMInvocationInfo(JPATxEntityManager.java:259)
at com.ibm.ws.jpa.management.JPATxEntityManager.getEMInvocationInfo(JPATxEntityManager.java:191)
at com.ibm.ws.jpa.management.JPAEntityManager.createQuery(JPAEntityManager.java:299)
Caused by: javax.naming.NameNotFoundException: Name "comp/websphere/ExtendedJTATransaction" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1228)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1141)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookupExt(UrlContextImpl.java:1436)
at com.ibm.ws.naming.java.javaURLContextImpl.lookupExt(javaURLContextImpl.java:477)
at com.ibm.ws.naming.java.javaURLContextRoot.lookupExt(javaURLContextRoot.java:485)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:396)
at javax.naming.InitialContext.lookup(InitialContext.java:415)
at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114)
my persistence.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="PersistenceUnit">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>my-ds</jta-data-source>
<non-jta-data-source>my-ds</non-jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
<!-- CMT -->
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.CMTTransactionFactory" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereTransactionManagerLookup" />
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform" />
</properties>
</persistence-unit>
</persistence>
am i missing some other configuration ?
Thanks in advance

Stateless Spring Security usage

I need your help with stateless Spring Security. I wrote service that authorize user, my security.xml:
<http use-expressions="true" create-session="stateless" entry-point-ref="restAuthenticationEntryPoint">
<intercept-url pattern="/auth/**" access="permitAll" />
<intercept-url pattern="/**" access="isAuthenticated()" />
<custom-filter ref="myFilter" position="FORM_LOGIN_FILTER"/>
</http>
<beans:bean id="myFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
<beans:property name="authenticationManager" ref="authenticationManager"/>
</beans:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider user-service-ref="userDetailsService" />
</authentication-manager>
It hasn't state, thats why after my authentication, when I want get anything via another URL, it takes me 401 Unauthorized. I heard about token but I don't know how achieve this.
Maximus,
This is what I did in similar scenario:
Used OAuth - http://oauth.net/
There are multiple libraries that implement OAuth specifications
http://tools.ietf.org/html/rfc6749
Spring has an implementation that is easy to configure. There are two sample applications (server and client) from Spring for this. Tutorials are available at:
https://github.com/SpringSource/spring-security-oauth/wiki/tutorial
Sample working config:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xmlns:ss="http://www.springframework.org/schema/security" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/security/oauth2
http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
">
<ss:http pattern="/test/customer/**" create-session="stateless"
access-decision-manager-ref="accessDecisionManager"
entry-point-ref="oauthAuthenticationEntryPoint"
xmlns="http://www.springframework.org/schema/security">
<ss:anonymous enabled="false" />
<ss:intercept-url pattern="/test/customer/welcome*"
access="ROLE_USER" />
<ss:custom-filter ref="resourceServerFilter" before="PRE_AUTH_FILTER" />
<ss:access-denied-handler ref="oauth2AccessDeniedHandler" />
</ss:http>
<ss:http pattern="/oauth/token" create-session="stateless"
entry-point-ref="oauthAuthenticationEntryPoint"
authentication-manager-ref="authenticationManager">
<ss:intercept-url pattern="/oauth/token" access="IS_AUTHENTICATED_FULLY" />
<ss:anonymous enabled="false" />
<ss:custom-filter ref="clientCredentialsTokenEndpointFilter"
before="BASIC_AUTH_FILTER" />
<ss:access-denied-handler ref="oauth2AccessDeniedHandler" />
</ss:http>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider ref="myAuthenticationProvider" />
</ss:authentication-manager>
<oauth:resource-server id="resourceServerFilter" token-services-ref="tokenServices" />
<bean id="myAuthenticationProvider" class="com.sachin.test.ws.user.MyUserAuthenticationProvider" />
<bean id="oauthAuthenticationEntryPoint"
class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint">
<property name="realmName" value="myCustomerAppRealm" />
</bean>
<bean id="clientDetailsUserService"
class="org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService">
<constructor-arg ref="clientDetailsService" />
</bean>
<oauth:authorization-server
client-details-service-ref="clientDetailsService" token-services-ref="tokenServices">
<oauth:authorization-code />
<oauth:implicit />
<oauth:refresh-token />
<oauth:client-credentials />
<oauth:password />
</oauth:authorization-server>
<oauth:client-details-service id="clientDetailsService">
<oauth:client client-id="admin"
authorized-grant-types="password,authorization_code,refresh_token,implicit,client_credentials"
authorities="ROLE_USER, ROLE_TRUSTED_CLIENT" scope="read,write,trust"
access-token-validity="60" />
</oauth:client-details-service>
<bean id="oauth2AccessDeniedHandler"
class="org.springframework.security.web.access.AccessDeniedHandlerImpl" />
<bean id="clientCredentialsTokenEndpointFilter"
class="org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter">
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased"
xmlns="http://www.springframework.org/schema/beans">
<constructor-arg>
<list>
<bean class="org.springframework.security.oauth2.provider.vote.ScopeVoter" />
<bean class="org.springframework.security.access.vote.RoleVoter" />
<bean class="org.springframework.security.access.vote.AuthenticatedVoter" />
</list>
</constructor-arg>
</bean>
<bean id="tokenStore"
class="org.springframework.security.oauth2.provider.token.InMemoryTokenStore" />
<bean id="tokenServices"
class="org.springframework.security.oauth2.provider.token.DefaultTokenServices">
<property name="tokenStore" ref="tokenStore" />
<property name="supportRefreshToken" value="true" />
</bean>
</beans>
Add this to web.xml:
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
You'll need to read the specs for OAuth and Spring security to understand what I did. You may extend this code to use your DB for authentication and token sharing across multiple servers.
Hope this helps.

Browser is not working in my Blackberry Simulator

I am working on developing Blackberry application using PhoneGap framwork. I have executed the sample app using below link
http://wiki.phonegap.com/w/page/31930982/Getting%20Started%20with%20PhoneGap%20BlackBerry%20WebWorks
But browser is not working in my Simulator.I mean if I try to goto Google site I am getting below error
I tried following steps too
1)I have installed 'BlackBerry Email and MDS Services Simulators 4.1.2'
2)Run the MDS and Run my application
Even I am getting issue. Please advice!
Device details:
Windows OS,PhoneGap,BlackBerry Email and MDS Services Simulators 4.1.2,Simulator:9550,BlackBerry WebWorks SDK 2.3.1.5
Config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Widget Configuration Reference:
http://docs.blackberry.com/en/developers/deliverables/15274/
-->
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0">
<name>Corperate Directory</name>
<access subdomains="false" uri="http://www.google.com"/>
<description>
A sample application written with Cordova.
</description>
<license href="http://opensource.org/licenses/alphabetical">
</license>
<!-- Cordova API -->
<feature id="blackberry.system" required="true" version="1.0.0.0" />
<feature id="org.apache.cordova" required="true" version="1.0.0" />
<feature id="blackberry.find" required="true" version="1.0.0.0" />
<feature id="blackberry.identity" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
<feature id="blackberry.io.file" required="true" version="1.0.0.0" />
<feature id="blackberry.utils" required="true" version="1.0.0.0" />
<feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
<feature id="blackberry.app" required="true" version="1.0.0.0" />
<feature id="blackberry.app.event" required="true" version="1.0.0.0" />
<feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
<feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
<feature id="blackberry.media.camera" />
<feature id="blackberry.ui.dialog" />
<!-- Cordova API -->
<access subdomains="true" uri="file:///store/home" />
<access subdomains="true" uri="file:///SDCard" />
<!-- Expose access to all URIs, including the file and http protocols -->
<access subdomains="true" uri="*" />
<icon rim:hover="false" src="resources/icon.png" />
<icon rim:hover="true" src="resources/icon.png" />
<rim:loadingScreen backgroundColor="#CFCFCF"
foregroundImage="resources/loading_foreground.png"
onFirstLaunch="true">
<rim:transitionEffect type="fadeOut" />
</rim:loadingScreen>
<content src="index.html" />
<rim:permissions>
<rim:permit>use_camera</rim:permit>
<rim:permit>read_device_identifying_information</rim:permit>
<rim:permit>access_shared</rim:permit>
<rim:permit>read_geolocation</rim:permit>
</rim:permissions>
</widget>
You probably need to whitelist google.com in your config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0">
<name>commonPitfalls</name>
<access subdomains="false" uri="http://www.google.com"/>
</widget>
From: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Common-BlackBerry-WebWorks-development-pitfalls-that-can-be/ta-p/624712
Alternatively, instead of checking google.com, you could use the connection api that PhoneGap offers:
http://docs.phonegap.com/en/1.8.0/cordova_connection_connection.md.html#Connection
Or use an xhr to google.com (with the appropriate whitelisting in your config.xml) to see if you get a response that way instead of loading in a page.