I don't know! I can't seem to get ejbjar to work for the life of me...

here's the target I'm using:

    <target name="ejbJar" depends="compileSource">
       <copy todir="${build.metainf.dir}">
          <fileset dir="${build.src.dir}"> 
             <include name="*-jar.xml"/>
          </fileset>
       </copy>
       <ejbjar descriptordir="${build.metainf.dir}"
                 srcdir="${build.classes.dir}"
               destdir="${build.jars.dir}"
                 classpath="${classpath}"
                 basejarname="powermarket">
                 <support dir="${build.classes.dir}">
                     <include name="**/*.class"/>
                     <exclude name="**/*Bean.class"/>
                 </support>
               <weblogic destdir="${build.jars.dir}"/>
               <include name="*ejb-jar.xml"/>
               <exclude name="*weblogic*.xml"/>     
       </ejbjar>
   </target>

but it throws this exception:
<--->
ejbJar:
     [copy] Copying 3 files to D:\andy\dev\main\build\META-INF
   [ejbjar] building powermarket.jar with 121 files

BUILD FAILED

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1503)
        at
org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.writeJar(Un
known Source)
        at
org.apache.tools.ant.taskdefs.optional.ejb.WeblogicDeploymentTool.writeJar(U
nknown Source)
        at
org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.processDesc
riptor(Unknown Source)
        at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(Unknown
Source)
        at org.apache.tools.ant.Target.execute(Target.java:153)
        at org.apache.tools.ant.Project.runTarget(Project.java:898)
        at org.apache.tools.ant.Project.executeTarget(Project.java:536)
        at org.apache.tools.ant.Project.executeTargets(Project.java:510)
        at org.apache.tools.ant.Main.runBuild(Main.java:421)
        at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 30 seconds
String index out of range: -1
<--->

I think that this _may_ be because my -ejb-jar.xml file is actually
'ejb-jar.xml' - but this is not much more than a wild guess... 

do you have any ideas?

many thanks,

Andy




> -----Original Message-----
> From: Les Hughes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 1:32 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Jar/ EJBs / Weblogic (general weirdness)
> 
> 
> 
> Hi,
> 
> Do you get the same problem when using the ejbjar / weblogic tasks?
> 
> Bye,
> Les
> 
> 
> > -----Original Message-----
> > From: Andy Yates [mailto:[EMAIL PROTECTED]]
> > Sent: 02 May 2001 06:47
> > To: '[EMAIL PROTECTED]'
> > Subject: Jar/ EJBs / Weblogic (general weirdness)
> > 
> > 
> > hi - so I have a somewhat confusing problem... (but then, 
> > aren't they all?
> > :))
> > 
> > we're creating an EJB jar using the jar task:
> > 
> > <jar jarfile="${build.jars.dir}/pm_classes${time.stamp}.jar"
> >       compress="false">
> >     <fileset dir="${build.classes.dir}"/>
> >     <fileset dir="${build.isv.dir}"
> >        includes="**/*.class"/>
> >     <fileset dir="${pm.main.dir}/build"
> >                includes="META-INF/**"/>
> > </jar>
> > 
> > and then running weblogic.ejbc on it, so as to make the 
> deployable jar
> > 
> > <target name="ejbc">
> >      <java classname="weblogic.ejbc" 
> >              classpath="${external.classes}"
> >      fork="yes">
> >           <arg value="${build.jars.dir}/pm_classes.jar"/>
> >           <arg value="${build.jars.dir}/pm_ejbc_classes.jar"/>  
> >      </java>
> > </target>
> > 
> > so far so good....
> > 
> > however, when we try and deploy this, a 
> > ClassNotFoundException is thrown,
> > for a class that is in the jar file!
> > 
> > being the curious lot that we are, we decided to unjar, and 
> > then re-jar the
> > said file manually (that is, 'jar -xvf pm_ejbc_classes.jar' 
> > followed by
> > deleting pm_classes.jar, and then 'jar -cvf 
> > pm_ejbc_classes.jar *' in a
> > temporary directory) ... and suddenly all is well, and the jar file
> > deploys!!
> > 
> > does anyone have any idea why this might be? how can I make 
> > it work in ant?
> > 
> > many thanks!
> > 
> > Andy
> > 
> > 
> > 
> > ps - here's the stack trace from the WL server:
> > 
> > weblogic.ejb20.EJBDeploymentException: Error deploying 
> > stateless EJB; nested
> > exception is:
> >         javax.naming.CommunicationException [Root exception is
> > java.rmi.UnmarshalException: error unmarshalling arguments; 
> > nested exception
> > is:
> >         java.lang.ClassNotFoundException:
> > com.powermarket.extract.webl.WebLEvaluatorBeanEOImpl_WLStub:  
> > This error
> > could indicate that a component was deployed on a  cluster 
> > member but not
> > other members of that cluster. Make sure that any component 
> > deployed on a
> > server that is part of a cluster is also deployed on all 
> > other members of
> > that cluster]
> > javax.naming.CommunicationException.  Root exception is
> > java.rmi.UnmarshalException: error unmarshalling arguments; 
> > nested exception
> > is:
> >         java.lang.ClassNotFoundException:
> > com.powermarket.extract.webl.WebLEvaluatorBeanEOImpl_WLStub:  
> > This error
> > could indicate that a component was deployed on a  cluster 
> > member but not
> > other members of that cluster. Make sure that any component 
> > deployed on a
> > server that is part of a cluster is also deployed on all 
> > other members of
> > that cluster
> >         java.lang.ClassNotFoundException:
> > com.powermarket.extract.webl.WebLEvaluatorBeanEOImpl_WLStub:  
> > This error
> > could indicate that a component was deployed on a  cluster 
> > member but not
> > other members of that cluster. Make sure that any component 
> > deployed on a
> > server that is part of a cluster is also deployed on all 
> > other members of
> > that cluster 
> > 
> > oh yeah - there is only one server in my 'cluster', and (as 
> > you can see) for
> > some reason, the exception is thrown 3 times....
> > 
> 

Reply via email to