Thanks Aaron,

We're still having issues, so I've attached my plans.

ClusterMonitorPlan.xml is for the GBean jar.
 - Contains the <gbean> declaration
geronimo-web.xml is for the ClusterManager-1.0.war
 - contains the <gbean-ref> tag
web.xml is also for the ClusterManager-1.0.war

The interface class is:
org.cait.ClusterMonitor.ClusterMonitorGBeanInterface

The GBean class is:
org.cait.ClusterMonitor.CustomDeltaManageGBean

Still getting this error:
----------------------
     Error: Unable to distribute
ClusterManager-1.0.war: Could not
     resolve reference at deploy time for queries
 
[?name=CustomDeltaManagerGBean#org.cait.ClusterMonitor.ClusterMonitorGBeanInterface]

         No matches for referencePatterns:
 
[?name=CustomDeltaManagerGBean#org.cait.ClusterMonitor.ClusterMonitorGBeanInterface]
---------------------

Can you see anything obvious from the plans?

Thanks!
Tyler



--- Aaron Mulder <[EMAIL PROTECTED]>
wrote:

> You're right -- gbean-ref only works in 1.1.  Your
> GBean needs to
> implement an interface, and the gbean-ref and lookup
> should go by the
> interface -- like this:
> 
> public interface MyInterface {
>     public void doSomething();
> }
> 
> public class MyGBean implements MyInterface {
>     public void doSomething() {...}
> 
>     ...
>     infoFactory.addInterface(MyInterface.class);
>     ...
> }
> 
> 
> <gbean-ref>
>   <ref-name>AGBean</ref-name>
>   <ref-type>MyInterface</ref-type>
>  
> <pattern><name>MyGBeanInstanceName</name></pattern>
> </gbean-ref>
> 
> 
> MyInterface mine = (MyInterface)new
> InitialContext().lookup("java:comp/env/AGBean");
> mine.doSomething();
> ...
> 
> Thanks,
>      Aaron
> 
> On 7/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> > I have 1.1 up and running, and am now getting an
> error
> > with the <gbean-ref>:
> >
> >     Error: Unable to distribute example-1.0.war:
> Could
> > not
> >     resolve reference at deploy time for queries
> >     [?name=InstanceName#com.example.GBean]
> >
> >         No matches for referencePatterns:
> >     [?name=InstanceName#com.example.GBean]
> >
> > In my deployment plan for the GBean I have:
> >   <gbean name="InstanceName"
> > class="com.example.GBean"/>
> >
> > Can anyone see where I've gone astray?
> >
> > Thanks!
> > Tyler
> >
> >
> >
> > --- [EMAIL PROTECTED] wrote:
> >
> > > Aaron,
> > >
> > > Found this note in your book:
> > >
> > > The schema includes a placeholder element
> > > (gbean-ref)
> > > for GBean references (that is, putting a
> reference
> > > to
> > > an arbitrary GBean in the component's
> java:comp/env
> > > JNDI space), but that is not yet working in
> Geronimo
> > > 1.0 so it is not covered here.
> > >
> > > I guess we need to upgrade to 1.0, huh? Please
> > > verify.
> > >
> > > Tyler
> > >
> > >
> > > --- Aaron Mulder <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > The GBean should implement at least one
> interface,
> > > > say
> > > > com.example.Foo, which includes all the
> methods
> > > your
> > > > web app wants to
> > > > call on it.
> > > >
> > > > Then you add a block like this to the
> deployment
> > > > plan for the web app
> > > > (geronimo-web.xml):
> > > >
> > > > <gbean-ref>
> > > >     <ref-name>MyGBean</ref-name>
> > > >     <ref-type>com.example.Foo</ref-type>
> > > >     <pattern>
> > > >         <name>YourGbeanInstanceName</name>
> > > >     </pattern>
> > > > </gbean-ref>
> > > >
> > > > That will stick the GBean named
> > > > YourGbeanInstanceName (e.g. plan has
> > > > <gbean name="YourGbeanInstanceName"
> class=...>) in
> > > > JNDI for the web
> > > > app at java:comp/env/MyGBean (java:comp/env/
> plus
> > > > the <ref-name>
> > > > above).  When you access that JNDI location,
> > > you'll
> > > > get something that
> > > > implements com.example.Foo (the <ref-type>
> above),
> > > > so you can use it
> > > > like this:
> > > >
> > > > Foo foo = (Foo)new
> > > >
> InitialContext().lookup("java:comp/env/MyGBean");
> > > >
> > > > Make sure that the GBeanInfo for your GBean
> has a
> > > > line like
> > > >
> infoFactory.addInterface(com.example.Foo.class);
> > > for
> > > > this to work.
> > > >
> > > > Thanks,
> > > >     Aaron
> > > >
> > > > On 7/14/06, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > I have successfully deployed a GBean using a
> > > > > deployment plan. I have added a new jar to
> the
> > > > > repository, and I reference the class in the
> > > > > deployment plan.
> > > > >
> > > > > Now, my question is: How do I access the
> > > deployed
> > > > > class via the GBean from my web
> > > > service/application?
> > > > >
> > > > > Thanks.
> > > > > Tyler
> > > > >
> > > > >
> > > > >
> > >
> __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best
> spam
> > > > protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > >
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1";>
  <environment>
    <moduleId>
      <groupId>ClusterMonitor</groupId>
      <artifactId>ClusterMonitor</artifactId>
      <version>1.0</version>
      <type>jar</type>
    </moduleId>
    <dependencies>
      <dependency>
        <groupId>tomcat</groupId>
        <artifactId>catalina-cluster</artifactId>
        <version>5.5.15</version>
        <type>jar</type>
      </dependency>
      <dependency>
        <groupId>tomcat</groupId>
        <artifactId>catalina</artifactId>
        <version>5.5.15</version>
        <type>jar</type>
      </dependency>
    </dependencies>
  </environment>
  <gbean name="CustomDeltaManagerGBean" class="org.cait.ClusterMonitor.CustomDeltaManagerGBean"/>
  <!--<gbean name="geronimo.apps:name=ClusterMonitor" class="org.cait.ClusterMonitor.CustomDeltaManagerGBean">
        <attribute name="port" type="int">4545</attribute>
    </gbean>-->
</module>
<web-app version="2.4"
   xmlns="http://java.sun.com/xml/ns/j2ee";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

    <listener>
        <listener-class>org.apache.axis.transport.http.AxisHTTPSessionListener</listener-class>
    </listener>

  <servlet>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>
        org.apache.axis.transport.http.AxisServlet
    </servlet-class>
  </servlet>

  <servlet>
    <servlet-name>AdminServlet</servlet-name>
    <servlet-class>
        org.apache.axis.transport.http.AdminServlet
    </servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>

  <servlet>
    <servlet-name>SOAPMonitorService</servlet-name>
    <servlet-class>
        org.apache.axis.monitor.SOAPMonitorService
    </servlet-class>
    <init-param>
      <param-name>SOAPMonitorPort</param-name>
      <param-value>5001</param-value>
    </init-param>
    <load-on-startup>100</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>SOAPMonitorService</servlet-name>
    <url-pattern>/SOAPMonitor</url-pattern>
  </servlet-mapping>

 <!-- uncomment this if you want the admin servlet -->
 <!--
  <servlet-mapping>
    <servlet-name>AdminServlet</servlet-name>
    <url-pattern>/servlet/AdminServlet</url-pattern>
  </servlet-mapping>
-->

    <session-config>
        <!-- Default to 5 minute session timeouts -->
        <session-timeout>5</session-timeout>
    </session-config>

    <!-- currently the W3C havent settled on a media type for WSDL;
    http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
    for now we go with the basic 'it's XML' response -->
  <mime-mapping>
    <extension>wsdl</extension>
     <mime-type>text/xml</mime-type>
  </mime-mapping>


  <mime-mapping>
    <extension>xsd</extension>
    <mime-type>text/xml</mime-type>
  </mime-mapping>

  <welcome-file-list id="WelcomeFileList">
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.jws</welcome-file>
  </welcome-file-list>

</web-app>
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1";
         xmlns:naming="http://geronimo.apache.org/xml/ns/naming";>

  <environment>
    <moduleId>
      <groupId>ClusterManager</groupId>
      <artifactId>ClusterManager</artifactId>
      <version>1.0</version>
      <type>war</type>
    </moduleId>
  </environment>

    <context-root>/ClusterManager</context-root>
<!--    <context-priority-classloader>false</context-priority-classloader>-->

    <cluster>TomcatCluster</cluster>

    <gbean-ref>
        <ref-name>MyCDMGBean</ref-name>
        <ref-type>org.cait.ClusterMonitor.ClusterMonitorGBeanInterface</ref-type>
        <pattern>
            <name>CustomDeltaManageGBean</name>
        </pattern>
    </gbean-ref>



    <!-- Apache Geronimo 1.0 ClusterManager deployment plan -->

    <!-- Cluster -->
    <gbean name="TomcatCluster" class="org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean">
        <attribute name="className">
            org.apache.catalina.cluster.tcp.SimpleTcpCluster
        </attribute>
        <attribute name="initParams">
            managerClassName=org.apache.catalina.cluster.session.DeltaManager
            expireSessionsOnShutdown=false
            useDirtyFlag=false
            notifyListenersOnReplication=true
        </attribute>

        <reference name="Membership">
<!--            <moduleType>J2EEModule</moduleType>-->
            <name>TomcatMembership</name>
        </reference> 
        <reference name="Receiver">
<!--            <moduleType>J2EEModule</moduleType>-->
            <name>TomcatReceiver</name>
        </reference> 
        <reference name="Sender">
<!--            <moduleType>J2EEModule</moduleType>-->
            <name>TomcatSender</name>
        </reference> 
        <reference name="TomcatValveChain">
<!--            <moduleType>J2EEModule</moduleType>-->
            <name>ReplicationValve</name>
        </reference>
    </gbean>

    <!-- Membership -->
    <gbean name="TomcatMembership" class="org.apache.geronimo.tomcat.cluster.MembershipServiceGBean">
        <attribute name="className">
            org.apache.catalina.cluster.mcast.McastService
        </attribute>
        <attribute name="initParams">
            mcastAddr=228.0.0.4
            mcastBindAddress=209.174.123.183
            mcastPort=45564
            mcastFrequency=500
            mcastDropTime=3000
        </attribute>
    </gbean> 

    <!-- Receiver -->
    <gbean name="TomcatReceiver"
        class="org.apache.geronimo.tomcat.cluster.ReceiverGBean">
        <attribute name="className">
            org.apache.catalina.cluster.tcp.ReplicationListener
        </attribute>
        <attribute name="initParams">
            tcpListenAddress=209.174.123.183
            tcpListenPort=4001
            tcpSelectorTimeout=100
            tcpThreadCount=6
        </attribute>
    </gbean>  

    <!-- Sender -->
    <gbean name="TomcatSender"
        class="org.apache.geronimo.tomcat.cluster.SenderGBean">
        <attribute name="className">
            org.apache.catalina.cluster.tcp.ReplicationTransmitter
        </attribute>
        <attribute name="initParams">
            replicationMode=pooled
            ackTimeout=15000
        </attribute>
    </gbean>   

    <!-- Valves -->
    <gbean name="ReplicationValve"
        class="org.apache.geronimo.tomcat.ValveGBean">
        <attribute name="className">
            org.apache.catalina.cluster.tcp.ReplicationValve
        </attribute>
        <attribute name="initParams">
            filter=.*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt;
        </attribute>
    </gbean>

</web-app>

Reply via email to