terracotta open source not working in ecache.xml - terracotta:clustered-shared - ehcache-3

I am migrating from ehcache 2 to ehcache 3.5. I am trying to use terracotta open source for sharing the cache with clusters.
Below is my java code,
final CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder =
CacheManagerBuilder.newCacheManagerBuilder()
.with(ClusteringServiceConfigurationBuilder.cluster(URI.create("terracotta://terr.com:9410/clustered")).autoCreate()
.defaultServerResource("default-resource")
.resourcePool("pool3", 28, MemoryUnit.MB))
.withCache("boxMaxFileId", CacheConfigurationBuilder.newCacheConfigurationBuilder(String.class, Integer.class,
ResourcePoolsBuilder.newResourcePoolsBuilder()
.with(ClusteredResourcePoolBuilder.clusteredShared("pool3")))) ;
final PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(true);
LOGGER.info(cacheManager.getStatus().toString());
return cacheManager;
Can someone help me in getting converted to ehcache.xml
<ehcache:service>
<terracotta:cluster>
<terracotta:connection url="terracotta://terr.com:9410/clustered"/>
<terracotta:server-side-config auto-create="true">
<terracotta:default-resource from="default-resource"/>
<terracotta:shared-pool name="pool1" unit="MB">2</terracotta:shared-pool>
</terracotta:server-side-config>
</terracotta:cluster>
</ehcache:service>
<ehcache:cache alias="boxMaxFileId">
<ehcache:key-type>java.lang.String</ehcache:key-type>
<ehcache:value-type>java.lang.Integer</ehcache:value-type>
<ehcache:resources>
<ehcache:heap unit="entries">100</ehcache:heap>
<ehcache:offheap unit="MB">1</ehcache:offheap>
<terracotta:clustered-shared sharing="pool1" />
</ehcache:resources>
</ehcache:cache>
tc-config.xml
<plugins>
<config>
<ohr:offheap-resources>
<ohr:resource name="default-resource" unit="MB">512</ohr:resource>
</ohr:offheap-resources>
</config>
</plugins>
I am getting exception like Pool name "pool1" not exists in server.

<?xml version="1.0" encoding="UTF-8"?>
<ehcache:config
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:jsr107='http://www.ehcache.org/v3/jsr107'
xmlns:terracotta='http://www.ehcache.org/v3/clustered'
xmlns:ehcache='http://www.ehcache.org/v3'
xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.1.xsd
http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.5.xsd
http://www.ehcache.org/v3/clustered http://www.ehcache.org/schema/ehcache-clustered-ext-3.1.xsd">
<ehcache:service>
<terracotta:cluster>
<terracotta:connection url="terracotta://terr.com:9410/clustered"/>
<terracotta:server-side-config auto-create="true">
<terracotta:default-resource from="default-resource"/>
<terracotta:shared-pool name="pool1" from="default-resource" unit="MB">2</terracotta:shared-pool>
</terracotta:server-side-config>
</terracotta:cluster>
</ehcache:service>
<ehcache:cache alias="boxMaxFileId">
<ehcache:key-type>java.lang.String</ehcache:key-type>
<ehcache:value-type>java.lang.Integer</ehcache:value-type>
<ehcache:resources>
<ehcache:heap unit="entries">100</ehcache:heap>
<ehcache:offheap unit="MB">1</ehcache:offheap>
<!-- <terracotta:clustered-dedicated unit="MB">5</terracotta:clustered-dedicated>-->
<terracotta:clustered-shared sharing="pool1" />
</ehcache:resources>
</ehcache:cache>
</ehcache:config>
This is the converted xml. For sharing, we need to use the above format.

Related

ejb 2 FinderException table or view does not exist

I'm working with an existing database and EJB 2.x application.
My task is to migrate the app from WebSphere 8 over to JBOSS EAP 6.4
After many days of fighting with this thing, everything seemed to be working until we started trying to use some of the beans. There are beans that end with "Mgr". For example, there is a SiteMgr bean and a Site bean. Right now, all of the Mgr beans work, but not the rest.
If you couldn't tell already, I'm not an EJB 2 Guru. Here is code that errors out:
/**
* getSessionContext
*/
public SiteVO getSite(int siteId) {
SiteLocal siteLocal;
try {
siteLocal = getSiteHome().findByPrimaryKey(new SiteKey(siteId));
} catch (FinderException e) {
throw new EJBException(e);
}
return siteLocal.getSiteVO();
}
So, when I try to findByPrimaryKey I get javax.ejb.FinderException, with the following cause:
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
Drilling into that a bit more, here is the cause:
Error : 942, Position : 27, Sql = SELECT t0_Site.siteId FROM SITE t0_Site WHERE t0_Site.siteId=:1 , OriginalSql = SELECT t0_Site.siteId FROM SITE t0_Site WHERE t0_Site.siteId=?, Error Msg = ORA-00942: table or view does not exist
The database contains a table named APP_SITES and the WebSphere app probably figures that out using some files that appear to be specific to WebSphere.
There is appdb70.dbm and Map.mapxmi
These files are very long. I will provide some example text that is specific to the above example.
ejb-jar.xml
<entity id="Site">
<ejb-name>Site</ejb-name>
<local-home>com.app.site.entity.SiteLocalHome</local-home>
<local>com.app.site.entity.SiteLocal</local>
<ejb-class>com.app.site.entity.SiteBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>com.app.site.entity.SiteKey</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Site</abstract-schema-name>
<cmp-field id="CMPAttribute_1087249279390">
<field-name>siteId</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1087249281781">
<field-name>siteName</field-name>
</cmp-field>
...
Map.mapxmi
<ejbrdbmapping:EjbRdbDocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:OracleModel="http:///com/ibm/db/models/oracle/oracle.ecore"
xmlns:SQLConstraints="http:///org/eclipse/datatools/modelbase/sql/constraints.ecore"
xmlns:SQLTables="http:///org/eclipse/datatools/modelbase/sql/tables.ecore" xmlns:ejb="ejb.xmi"
xmlns:ejbrdbmapping="ejbrdbmapping.xmi" xmlns:Mapping="Mapping.xmi" xmi:id="EjbRdbDocumentRoot_1289312938455" topToBottom="true" commandStack="">
<helper xmi:type="ejbrdbmapping:RdbSchemaProperies" xmi:id="RdbSchemaProperies_1289312938455" primitivesDocument="ORACLE_V11"/>
<nested xmi:type="ejbrdbmapping:RDBEjbMapper" xmi:id="RDBEjbMapper_1289313262395">
<helper xmi:type="ejbrdbmapping:PrimaryTableStrategy" xmi:id="PrimaryTableStrategy_1289313262395">
<table xmi:type="OracleModel:OracleTable" href="META-INF/backends/ORACLE_V11_3/acapdb70.dbm#_q0x58OwNEd-LtOpsZa3J5w"/>
</helper>
<nested xmi:type="ejbrdbmapping:RDBEjbFieldMapper" xmi:id="RDBEjbFieldMapper_1289315290408">
<inputs xmi:type="ejb:CMPAttribute" href="META-INF/ejb-jar.xml#CMPAttribute_1087249279390"/>
<outputs xmi:type="SQLTables:Column" href="META-INF/backends/ORACLE_V11_3/acapdb70.dbm#_q0x58ewNEd-LtOpsZa3J5w"/>
<typeMapping xmi:type="ejbrdbmapping:RDBEjbFieldMapper" href="JavatoORACLE_V11TypeMaps.V7.xmi#int-NUMBER"/>
</nested>
<nested xmi:type="ejbrdbmapping:RDBEjbFieldMapper" xmi:id="RDBEjbFieldMapper_1289315290409">
<inputs xmi:type="ejb:CMPAttribute" href="META-INF/ejb-jar.xml#CMPAttribute_1087249285656"/>
<outputs xmi:type="SQLTables:Column" href="META-INF/backends/ORACLE_V11_3/acapdb70.dbm#_q0x5-ewNEd-LtOpsZa3J5w"/>
<typeMapping xmi:type="ejbrdbmapping:RDBEjbFieldMapper" href="JavatoORACLE_V11TypeMaps.V7.xmi#String-VARCHAR"/>
</nested>
appdb70.dbm (contains WAY too much data to post...)
<?xml version="1.0" encoding="UTF-8"?>
<!--xtools2_universal_type_manager-->
<xmi:XMI xmlns:datamodelversion="http://www.ibm.com/com.ibm.datatools.core/model/7.5.1.1" xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:OracleModel="http:///com/ibm/db/models/oracle/oracle.ecore" xmlns:SQLConstraints="http:///org/eclipse/datatools/modelbase/sql/constraints.ecore" xmlns:SQLDataTypes="http:///org/eclipse/datatools/modelbase/sql/datatypes.ecore" xmlns:SQLExpressions="http:///org/eclipse/datatools/modelbase/sql/expressions.ecore" xmlns:SQLSchema="http:///org/eclipse/datatools/modelbase/sql/schema.ecore" xmlns:SQLStatements="http:///org/eclipse/datatools/modelbase/sql/statements.ecore" xmlns:SQLTables="http:///org/eclipse/datatools/modelbase/sql/tables.ecore">
<OracleModel:OracleDatabase xmi:id="_WPDywewNEd-LtOpsZa3J5w" name="APPdb70" vendor="Oracle" version="11" schemas="_WQG7oOwNEd-LtOpsZa3J5w"/>
<SQLSchema:Schema xmi:id="_WQG7oOwNEd-LtOpsZa3J5w" name="APPWDB" triggers="_q0VNoOwNEd-LtOpsZa3J5w ..." database="_WPDywewNEd-LtOpsZa3J5w"/>
<SQLTables:Trigger xmi:id="_q0VNoOwNEd-LtOpsZa3J5w" name="APP_APPOINTMENT_D_TRG" schema="_WQG7oOwNEd-LtOpsZa3J5w" subjectTable="_q0VNpuwNEd-LtOpsZa3J5w" ...>
<dependencies xmi:id="_q0VNoewNEd-LtOpsZa3J5w" targetEnd="_q07ry-wNEd-LtOpsZa3J5w"/>
<dependencies xmi:id="_q0VNouwNEd-LtOpsZa3J5w" targetEnd="_q0e_b-wNEd-LtOpsZa3J5w"/>
<dependencies xmi:id="_q0VNo-wNEd-LtOpsZa3J5w" targetEnd="_q0VNpuwNEd-LtOpsZa3J5w"/>
<dependencies xmi:id="_q0VNpOwNEd-LtOpsZa3J5w" targetEnd="_q0VN_OwNEd-LtOpsZa3J5w"/>
<actionStatement xsi:type="SQLStatements:SQLStatementDefault" ..."/>
</SQLTables:Trigger>
<OracleModel:OracleTable xmi:id="_q0VNpuwNEd-LtOpsZa3J5w" name="APP_APPOINTMENT" schema="_WQG7oOwNEd-LtOpsZa3J5w" triggers="_q0VNoOwNEd-LtOpsZa3J5w ...>
<columns xmi:id="_q0VNp-wNEd-LtOpsZa3J5w" name="APPT_ID" nullable="false">
<containedType xsi:type="SQLDataTypes:FixedPrecisionDataType" xmi:id="_q0VNqOwNEd-LtOpsZa3J5w" name="NUMBER" primitiveType="NUMERIC"/>
</columns>
<columns xmi:id="_q0VNqewNEd-LtOpsZa3J5w" name="RMKS_TX">
<containedType xsi:type="SQLDataTypes:CharacterStringDataType" xmi:id="_q0VNquwNEd-LtOpsZa3J5w" name="VARCHAR2" primitiveType="CHARACTER_VARYING" length="200"/>
</columns>
Notice that you can find "CMPAttribute_1087249279390" in multiple files. JBOSS does not seem to make use of these extra files.
I'm not sure what to do at this point. I figured out everything else, but I can't seem to get around this. Any fix that gets the beans to work would be appreciated!

read nuget.config programmatically in c#

Is it possible to read nuget.config file and packages sources inside with using Nuget.visualStudio,nuget.core or nuget.clients dll.I can parse xml but is there any outofthebox logic in nuget.dlls
Yes! You need to consume the NuGet.Configuration package available at https://www.nuget.org/packages/NuGet.Configuration/4.6.2.
Then you can use the following code -
using NuGet.Configuration;
using System;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
// basic implementation of nuget.config in code
var setting = Settings.LoadSpecificSettings(#"f:\root", "nuget.config");
// get sources
var packageSourceProvider = new PackageSourceProvider(setting);
var sources = packageSourceProvider.LoadPackageSources();
foreach(var source in sources)
{
Console.WriteLine($"{source.Name}: {source.SourceUri}");
}
}
}
}
This will generate the following output -
NuGet.org: https://api.nuget.org/v3/index.json
Sample config file used (lets say at path f:\root\nuget.config)-
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

UWP and FullTrustProcessLauncher missing in namaspeace

I am trying to launch powershell (some lightweight commands that all user can do) command from UWP application using FullTrustProcessLauncher.
Problem is I am getting that this name does not exists in current context.
My manifest is largly default so it looks like :
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
IgnorableNamespaces="uap mp">
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="PrototypeProject.App">
<Extensions>
<desktop:Extension Category="windows.fullTrustProcess" Executable="powershell.exe">
<desktop:FullTrustProcess>
<desktop:ParameterGroup GroupId="TestGroup" Parameters="ls"/>
</desktop:FullTrustProcess>
</desktop:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
</Package>
And class I am trying to call it from looks like:
using Windows.ApplicationModel;
using Windows.Foundation;
namespace FullTrustProcess
{
public class Ftp
{
public const string FtpParamGroupId = "TestGroup";
public void RunFtp()
{
IAsyncAction operation = FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(FtpParamGroupId);
}
}
}
Now am I missing something??
It looks like I was missing - Windows Desktop Extensions for the UWP, in extensions reference

Orbeon autocomplete - Content is not allowed in prolog

I'm trying to add an autocomplete component in dynamic mode to a form created with the Orbeon Form Builder (version Orbeon Forms 3.9.0+.stable.201109261742 PE).
The xml below is a simple test form with the autocomplete that retrieves the data from a public webservice (currently with a static request body).
The first time the autocomplete loads the data it works just fine: the items are presented in a list. But the second time, when I type another character to narrow down the search results, or when I select an item from the list, I get the error message "Content is not allowed in prolog".
If I ignore the error and continue anyway, the error changes to "Got unexpected request sequence number".
I don't understand why it only works the first time since the data returned by the web service is always the same because of the static request body.
Below you find the complete xml of the test form.
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xhtml:head>
<xhtml:title>Test form</xhtml:title>
<xforms:model id="fr-form-model">
<xforms:instance id="fr-form-instance">
<form>
<section-1>
<codeSearch/>
</section-1>
</form>
</xforms:instance>
<xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
<xforms:bind id="section-1-bind" nodeset="section-1">
<xforms:bind id="codeSearch-bind" nodeset="codeSearch" name="codeSearch" type="xforms:string"/>
</xforms:bind>
</xforms:bind>
<xforms:instance id="fr-form-metadata" xxforms:readonly="true">
<metadata>
<application-name>IRISbox</application-name>
<form-name>Test</form-name>
<title xml:lang="fr">Test form</title>
<description xml:lang="fr"/>
<author/>
<logo mediatype="" filename="" size=""/>
</metadata>
</xforms:instance>
<xforms:instance id="fr-form-attachments">
<attachments>
<css mediatype="text/css" filename="" size=""/>
<pdf mediatype="application/pdf" filename="" size=""/>
</attachments>
</xforms:instance>
<xforms:instance id="fr-form-resources" xxforms:readonly="false">
<resources>
<resource xml:lang="fr">
<codeSearch>
<label>Cities</label>
<hint/>
<help/>
<alert/>
</codeSearch>
<section-1>
<label>Test</label>
<help/>
</section-1>
</resource>
</resources>
</xforms:instance>
<xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
<request/>
</xforms:instance>
<xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
<response/>
</xforms:instance>
<!-- Search Cities by Name HTTP service -->
<xforms:instance id="searchCitiesByName-instance" class="fr-service"
xxforms:exclude-result-prefixes="#all">
<body><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.restfulwebservices.net/ServiceContracts/2008/01">
<soapenv:Header/>
<soapenv:Body>
<ns:GetCitiesByCountry>
<ns:Country>USA</ns:Country>
</ns:GetCitiesByCountry>
</soapenv:Body>
</soapenv:Envelope></body>
</xforms:instance>
<xforms:submission id="searchCitiesByName-submission" class="fr-service"
ref="instance('fr-service-request-instance')"
resource="http://www.restfulwebservices.net/wcf/WeatherForecastService.svc"
method="post"
serialization="application/xml"
mediatype="application/soap+xml; action=GetCitiesByCountry"
replace="instance"
instance="searchCitiesByName-instance"/>
<xforms:action ev:event="xforms-submit" ev:observer="searchCitiesByName-submission">
<xxforms:variable name="request-instance-name" select="'searchCitiesByName-instance'"
as="xs:string"/>
<xforms:insert nodeset="instance('fr-service-request-instance')"
origin="saxon:parse(instance($request-instance-name))"/>
</xforms:action>
</xforms:model>
</xhtml:head>
<xhtml:body>
<fr:view>
<xforms:label ref="instance('fr-form-metadata')/title"/>
<fr:body>
<fr:section id="section-1-section" bind="section-1-bind">
<xforms:label ref="$form-resources/section-1/label"/>
<xforms:help ref="$form-resources/section-1/help"/>
<fr:grid columns="1">
<xhtml:tr>
<xhtml:td>
<fr:autocomplete
id="codeSearch"
bind="codeSearch-bind"
dynamic-itemset="true"
max-results-displayed="50">
<xforms:label ref="$form-resources/codeSearch/label"/>
<!-- React to user searching -->
<xforms:action ev:event="fr-search-changed">
<xxforms:variable name="search-value" select="event('fr-search-value')"/>
<xxforms:variable name="make-suggestion" select="string-length($search-value) >= 2"/>
<xforms:action if="$make-suggestion">
<xforms:setvalue ref="instance('code-search-instance')/searchFor" value="$search-value"/>
<xforms:send submission="searchCitiesByName-submission"/>
</xforms:action>
<xforms:action if="not($make-suggestion)">
<!-- Delete itemset -->
<xforms:delete nodeset="instance('searchCitiesByName-instance')//*:GetCitiesByCountryResult/*:string"/>
</xforms:action>
</xforms:action>
<xforms:itemset nodeset="instance('searchCitiesByName-instance')//*:GetCitiesByCountryResult/*:string">
<xforms:label ref="text()"/>
<xforms:value ref="text()"/>
</xforms:itemset>
</fr:autocomplete>
</xhtml:td>
</xhtml:tr>
<xhtml:tr>
<xhtml:td>
<widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget" id="orbeon-xforms-inspector"/>
</xhtml:td>
</xhtml:tr>
</fr:grid>
</fr:section>
</fr:body>
</fr:view>
</xhtml:body>
</xhtml:html>
Any help is appreciated.

add a Queue JNDI ref in ejb-jar.xml? sending JMS Msg in a EJB/MDB

I have an EAR application which contains an MDB and a WAR.
In this EAR application I would send a message into an another Queue from other EAR application. Say jms/anotherQueue
If the message sending happens in web context, it works.
I have such setup in web.xml
<message-destination-ref>
<message-destination-ref-name>jms/anotherQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
<message-destination-link>jms/anotherQueue</message-destination-link>
</message-destination-ref>
But if the message sending occurs in EJB (MDB here) context, I will get a JNDI name lookup failure.
javax.naming.NameNotFoundException: anotherQueue
my ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<enterprise-beans>
<message-driven>
<ejb-name>jms/myMDB</ejb-name>
<ejb-class>com.my.MDBImplement</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destination</activation-config-property-name>
<activation-config-property-value>jms/myQueue</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
</activation-config>
<resource-ref>
<res-ref-name>jms/myCF</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>jms/myMDB</ejb-name>
<method-name>onMessage</method-name>
<method-params>
<method-param>javax.jms.Message</method-param>
</method-params>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
the openejb.jar is
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ejb:openejb-jar
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pers="http://java.sun.com/xml/ns/persistence"
xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
<dep:environment>
<dep:moduleId>
<dep:groupId>myGroup</dep:groupId>
<dep:artifactId>imyMDB</dep:artifactId>
<dep:version>1.0</dep:version>
<dep:type>ejb</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>org.apache.geronimo.configs</dep:groupId>
<dep:artifactId>activemq-broker</dep:artifactId>
<dep:type>car</dep:type>
</dep:dependency>
</dep:dependencies>
</dep:environment>
<ejb:enterprise-beans>
<ejb:message-driven>
<ejb:ejb-name>jms/myMDB</ejb:ejb-name>
<ejb:resource-adapter>
<ejb:resource-link>myJmsResource</ejb:resource-link>
</ejb:resource-adapter>
</ejb:message-driven>
</ejb:enterprise-beans>
</ejb:openejb-jar>
I define myJmsResource in geronimo-application.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<app:application
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pers="http://java.sun.com/xml/ns/persistence"
xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
<dep:environment>
<dep:moduleId>
<dep:groupId>myGroup</dep:groupId>
<dep:artifactId>myEAR</dep:artifactId>
<dep:version>1.0</dep:version>
<dep:type>ear</dep:type>
</dep:moduleId>
</dep:environment>
<app:module>
<app:connector>geronimo-activemq-ra-2.1.4.rar</app:connector>
<conn:connector>
<dep:environment>
<dep:moduleId>
<dep:groupId>myGroup</dep:groupId>
<dep:artifactId>myJmsResource</dep:artifactId>
<dep:version>1.0</dep:version>
<dep:type>rar</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>org.apache.geronimo.configs</dep:groupId>
<dep:artifactId>activemq-broker</dep:artifactId>
<dep:type>car</dep:type>
</dep:dependency>
</dep:dependencies>
</dep:environment>
<conn:resourceadapter>
<conn:resourceadapter-instance>
<conn:resourceadapter-name>myJmsResource</conn:resourceadapter-name>
<nam:workmanager>
<nam:gbean-link>DefaultWorkManager</nam:gbean-link>
</nam:workmanager>
</conn:resourceadapter-instance>
<conn:outbound-resourceadapter>
<conn:connection-definition>
<conn:connectionfactory-interface>javax.jms.ConnectionFactory</conn:connectionfactory-interface>
<conn:connectiondefinition-instance>
<conn:name>jms/myCF</conn:name>
<conn:implemented-interface>javax.jms.QueueConnectionFactory</conn:implemented-interface>
<conn:implemented-interface>javax.jms.TopicConnectionFactory</conn:implemented-interface>
<conn:connectionmanager>
<conn:xa-transaction>
<conn:transaction-caching />
</conn:xa-transaction>
<conn:single-pool>
<conn:match-all />
</conn:single-pool>
</conn:connectionmanager>
</conn:connectiondefinition-instance>
</conn:connection-definition>
</conn:outbound-resourceadapter>
</conn:resourceadapter>
<conn:adminobject>
<conn:adminobject-interface>javax.jms.Queue</conn:adminobject-interface>
<conn:adminobject-class>org.apache.activemq.command.ActiveMQQueue</conn:adminobject-class>
<conn:adminobject-instance>
<conn:message-destination-name>jms/myQueue</conn:message-destination-name>
<conn:config-property-setting name="PhysicalName">jms/myQueue</conn:config-property-setting>
</conn:adminobject-instance>
<!-- ******************************************************************** -->
<!-- define referred message destination ??? -->
<conn:adminobject-instance>
<conn:message-destination-name>jms/anotherQueue</conn:message-destination-name>
<conn:config-property-setting name="PhysicalName">jms/anotherQueue</conn:config-property-setting>
</conn:adminobject-instance>
</conn:adminobject>
<conn:adminobject>
<conn:adminobject-interface>javax.jms.Topic</conn:adminobject-interface>
<conn:adminobject-class>org.apache.activemq.command.ActiveMQTopic</conn:adminobject-class>
</conn:adminobject>
</conn:connector>
</app:module>
</app:application>
It seems that myMDB cannot understand what jms/anotherQueue is!!!
How can I fix it?
OK, I found a quick fix....
in ejb-jar.xml
<enterprise-beans>
<message-driven>
<ejb-name>jms/myMDB</ejb-name>
.....
<!-- referred queue -->
<resource-env-ref>
<resource-env-ref-name>jms/anotherQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
I must admit, I still don't understand how to write a correct deployment plan.
I just goggle, copy, paste.....and mix up those deployment plans.