Ant and ejbc
when trying to deploy any ejb's via ant the ejbc is unable to find any of the iplanet classes with errors like the following.
[exec] Unexpected compilation Error:
[exec] ejb_fac_com_kcom_vision_business_consumer_model_ejb_StbEbBean.java:9: Superclass com.kivasoft.eb.EBHomeFactoryBa
se of class com.kcom.vision.business.consumer.model.ejb.ejb_fac_com_kcom_vision_business_consumer_model_ejb_StbEbBean not fo
und.
[exec] extends com.kivasoft.eb.EBHomeFactoryBase
this file lives in kfcjdk11.jar file which is definatly in the classpath as defined by the classpath option of ejbc. I have tried adding javaccp option to include the entire classpath but this made no difference it is like the ejb compiler is just not picking up the classpath but when I run ant with the verbose option I can see the classpath taken on the commandline. So I just don't have any idea as to what is going on???
The WLS Ant tasks are *ahem* slightly off from "normal" Ant tasks in that they depend upon some of their magic ClassLoaders. The only way I know of using the WLS tasks is with their included Ant - it's in the (diretory-where-weblogic-was-installed)/server/ant/bin. I've tried several things to get their tasks to run under a "normal" Ant, but not had any luck... yet.
Similar Messages
-
Packages, Classpath, Ant, and JUnit (setting up a nice environment)
Hi,
I am seeking a little help getting up and running, creating a nice environment where I can build a Java project, including building with Ant and using JUnit - hopefully this is the right forum. I am having some trouble in getting JUnit to run my tests properly (it is installed and findable by my Java install) and I think this is due to a package/classpath issue that is currently outside my experience. Here's my setup to explain:
I have installed the JUnit jar in my extensions folder, and it works properly (I can call it, don't get errors about JUnit), however, when I run my test I get the error:
"Could not find class: org.xxx.powersim.ModelTest
Time: 0
OK (0 tests)
Java Result: 1"
ModelTest has been compiled properly without error, and looks like this:
package org.xxx.powersim;
import org.junit.*;
import static org.junit.Assert.*;
import java.util.*;
public final class ModelTest {
public static void main(String args[]) {
org.junit.runner.JUnitCore.main("org.xxx.powersim.ModelTest");
@Test
public void testJunit() {
assertTrue(true);
}Pretty simple stuff.
As you can see I'm trying to use the 'main' method of the test to execute the test itself... but I've tried running it via the runner from the command line also: "java org.junit.runner.JUnitCore org.xxx.powersim.ModelTest". I get the same result.
It might be a package issue, so here's how I have things set up in the file system:
PowerSim
/build
/org
/xxx
/powersim
- ModelTest.class
/src
/org
/xxx
/powersim
-ModelTest.javaI've tried running it within Ant, by hand using the runner, by hand calling the main method, and from within TextMate's built-in bundle - I get the same result. JUnit is installed and running fine, but it can't seem to see the test class - the more I think about it this is a package problem that I'm just not sure how to fix. I've tried running it by hand in the root /PowerSim directory, in the /build folder, and in the /powersim folder where ModelTest is. I still get the error that "Could not find class: org.xxx.powersim.ModelTest".
My files compile just fine with my simple Ant script which is as follows:
<?xml version="1.0"?>
<project name="PowerSim" default="run" basedir=".">
<property name="src" value="./src"/>
<property name="build" value="./build"/>
<property name="compile.debug" value="true"/>
<path id="compile.classpath">
<pathelement location="${mysql.jdbc}"/>
<pathelement location="${junit.jar}"/>
</path>
<target name="build" depends="init">
<javac srcdir="${src}"
destdir="${build}"
debug="${compile.debug}"
source="1.5">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="init">
<mkdir dir="${build}"/>
</target>
<target name="run" depends="build">
<java classname="org.xxx.powersim.Model"
fork="true"
dir="${build}"
classpath="${build}"
maxmemory="500m">
</java>
</target>
<target name="test" depends="build">
<java classname="org.xxx.powersim.ModelTest"
fork="yes"
dir="${build}"
classpath="${build}"
maxmemory="500m">
</java>
</target>
<target name="clean" description="Removes previous build">
<delete verbose="true">
<fileset dir="${build}"/>
</delete>
</target>
</project>As you can see, I'm not sure what to try next - any help would be much appreciated.
I've tried adding things to my $CLASSPATH. For example I've added the root folder of the project, 'PowerSim' to my classpath, but this appears to have no effect. I am running OS X 10.5.
Thanks again for any help you may be able to offer, it will be very much appreciated,
- PeterOk - final bump and then I'll go away.
(Really - if anyone has any advice that would be great) -
Building jars using ant and eclipse
Note: If this post could be in a more appropriate forum category could someone please tell me which one is better.
Vexing issue:
I am using ANT so that it will take care of which classes have been modified and therefore which jars need to be updated.
I noticed one way ANT can work is to look at the timestamp of the class files and then build the necessary jars. This works fine EXCEPT that eclipse has a nasty habit of sometimes recompiling everything, even when I dont ask it to. It would seem to make more sense basing the recompilation on the source files, and whether they have been modified. So I set this up with my build.xml, ie
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" fork="true"/>
</target>
Now suppose I go and change one of my source files, ANT recompiles that file and that all works great. However, suppose that file had in it, which many do,
public static String EXAMPLE_VARIABLE = "example";
This static variable is referenced in many classes, and yet ANT only recompiles the one file, and thus there begins an inconsistency!
Is there any way to get around this? I would have expected ANT to recompile all the files that depend on the class with the static variable but it doesnt.
Any help much appreciated.
CelYou know, that's a good question. I would think JVMs at runtime could resolve static variables, like when it compiles classes using that static variable it puts a placeholder "Hey, here I am using XXX, at runtime, figure it out and give me the value right at the start..". But I think it works like you suggest in that a static value is compiled into every location that uses it. The only thing I can think of is provide a target for a build-all in your ant and have it rebuild all.
I agree though that the javac compiler should be smarter in how it compiles classes. Anytime a class has certain attributes that may be compiled in to other classes, it should check and recompile any class that depends on the static value that has changed. -
Hi.
I see that the problem with ant and junit is discussed here, but with no absolutte solution.
The problem:
I create an build.xml containing the <junit>-task and want to run this from within the BEA Workshop. The standard error-message is that it cant find the junit-task. I can run the same build file from command since I got ANT set up correctly with JUnit outside Weblogic.
It sems for me that Workshop dont care about existing installation of ANT, it uses it own version. I have included junit.jar in the same direstory as ant.jar is in BEA-install-dir also, but it wont work.
Does anyone have a solution to this "small" problem??
Thanks in advance.I haven't figured out why, but my JDeveloper automatically adds the classpath I have in my ant build.xml to the additional classpath of the project. My classpath is set like this in the build.xml:<path id="classpath">
<fileset dir="env/lib">
<include name="**/*.jar"/>
</fileset>
</path>And my compile target looks like this:<target name="compile" depends="init">
<mkdir dir="${compile.outdir}"/>
<!--Compile Java source files-->
<javac destdir="${compile.outdir}" debug="on">
<classpath refid="classpath"/>
<src refid="srcpath"/>
</javac>
</target>And my Jdev project settings -> common -> ant has my build.xml file selected with default make and rebuild targets selected. I have never put a single entry in the additional classpath area but somehow I have all the libs as I set up in my build.xml file. I'm using JDev 9.0.3.2 by the way. -
Create web service consumer client with Ant and wsdl
How can I create a web service client with just Ant and WSDL?
Thanks.Hi,
Did you check this web log?
/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
Eddy -
Error while trying to use Ant and creating Jdbc Datasource
I was following the documentation to auto-create my datasource in my weblogic server. I get an error while it is trying to link the datasource to the server. Does anybody have any ideas,it is almost like the query to get the server isn't working.
Here is my ant task:
<target name="setupJdbcDatasource">
<wlconfig url="t3://localhost:7001" username="weblogic" password="weblogic">
<query domain="MyDomain" type="Server" name="AdminServer" property="adminserver"/>
<create type="JDBCConnectionPool" name="TestDatasource" property="DatasourceTest">
<set attribute="CapacityIncrement" value="1"/>
<set attribute="DriverName" value="weblogic.jdbcx.oracle.OracleDataSource"/>
<set attribute="InitialCapacity" value="1"/>
<set attribute="MaxCapacity" value="10"/>
<set attribute="Password" value="cmuser"/>
<set attribute="Properties" value="user=cmuser SID=ORCH serverName=10.13.5.144 portNumber=1521"/>
<set attribute="RefreshMinutes" value="0"/>
<set attribute="ShrinkPeriodMinutes" value="15"/>
<set attribute="ShrinkingEnabled" value="true"/>
<set attribute="TestConnectionsOnRelease" value="false"/>
<set attribute="TestConnectionsOnReserve" value="false"/>
<set attribute="URL" value="jdbc:bea:oracle://10.13.5.144:1521"/>
<set attribute="Targets" value="${adminserver}"/>
</create>
</wlconfig>
</target>
My Domain is MyDomain, and server is AdminServer. The error I get is:
[wlconfig] weblogic.management.DistributedManagementException : Distributed Management [1 exceptions]
BUILD FAILED
X:\ibutt_PCView\src\CM\build.xml:285: Error invoking MBean
command: javax.management.MBeanException
And in my server log:
jdbcDataSourceBean=[MBeanServerInvocationHandler]com.bea:Name=CP-ConfigManagemen
tTest,Type=weblogic.j2ee.descriptor.wl.JDBCDataSourceBean,Parent=[MyDomain]/JDBC
SystemResources[CP-ConfigManagementTest],Path=JDBCResource
<May 21, 2006 3:50:57 PM EDT> <Warning> <JDBC> <BEA-001129> <Received exception
while creating connection for pool "ConfigManagementTest": [BEA][Oracle JDBC Dri
ver]Missing connection information: no serverName specified.>
<May 21, 2006 3:50:58 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occured i
n the execution of deployment request with ID '1148241051441' for task 'weblogic
.deploy.configChangeTask.2'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:Hi. This seems like an XML parsing problem.
Could you please try changing the driver
properties from:
<set attribute="Properties" value="user=cmuser SID=ORCH serverName=10.13.5.144 portNumber=1521"/>
to:
<set attribute="Properties" value="user=cmuser SID=ORCH"/>
The server and port are already in the URL
thanks,
Joe -
ADF BC : Ant and XSLT to modify bc4j.xcfg and DataBindings.cpx
hi
Before I deploy my ADF BC / ADF Swing application I would like to use Ant to make some changes to bc4j.xcfg and DataBindings.cpx
(see also "Defining ADF Business Components Runtime Properties for ADF Swing Applications" in the JDeveloper documentation)
I would like DataBindings.cpx to point to the correct configuration and bc4j.xcfg to only contain the configuration information that is required.
I created some XSLT transformation stylesheets to help me with that, see this example application:
http://verveja.footsteps.be/~verveja/files/oracle/AntXsltConnectionSwitchStuff-v0.02.zip
question
Does JDeveloper itself provide any features to automatically make changes to DataBindings.cpx (and bc4j.xcfg) before deployment?
many thanks
Jan Verveckenrepost
-
How to stop running ant and the program
Hi all,
I have a java system which using ant to start execute external programs (.exe), by calling project.executeTargets(targets);
the exe will take a while to finish, sometimes user want to stop it, but still keep main system running, and fire another project.executeTargets(targets), therefore I can't use system.exit()
Now how can I stop this ant "project", and make sure the exe program also been terminated? By calling project.fireBuildFinished()?
Since the project.executeTargets(targets) will catch RuntimeException, maybe somewhere i can call process.destroy()?
Thanks for helpDouble tap the home button and swipe upwards on the preview of the App (not the App Icon).
-
Workshop, ant, and ejb project
I exported an ant build file from the workshop for an ejb project. I ran
the build from the command line. I got the following exception:
java.lang.NoClassDefFoundError: com/bea/ide/Application
at
com.bea.wls.build.DeleteModuleTask.execute(DeleteModuleTask.java:32)
at org.apache.tools.ant.Task.perform(Task.java:319)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Any ideas, suggestions, workarounds?
Your help in this regard is greatly appreciated...DESCRIPTION:
If you have overloaded methods with the same parameter name but the different parameter type and running EJBGen on the bean, all the overloaded methods are not included in the Remote interface.
Like if you have the following methods:
1)-public Record getRecord(Integer pRecordId)
2)-public Record getRecord(Integer pRecordId, String str)
3)-public Record getRecord(Integer pRecordId, double str)
running EJBGen on it will include only the method 1 and the method 2 in the remote interface.
Does this match what you were seeing? (the WLS CR is marked as fixed in 10.0 - patch is requested for 9.2/9.1) -
Invalid Syntax error while using Ant and WLST
I am trying to run the following code in an ant build file but continue to see the error below even though the exact same code works through the WLST console. Any help would be greatly appreciated.
Note: * = 1 tab
<wlst debug="true" failonerror="false">
*<script>
**connect('system','weblogic','t3://...')
**apps=cmo.getAppDeployments()
**for app in apps:
***if app.getName().startswith("4X"):
****stopApplication(app,block='true')
****undeploy(app.getName(),targets='MS1,MS2',block='true')
**deploy('4X','//box/domains/applications/4X.ear',targets='MS1,MS2',stageMode='stage',block='true')
**apps=cmo.getAppDeployments()
**for app in apps:
***if app.getName().startswith("4X"):
****startApplication(app.getName(),block='true')
*</script>
</wlst>
When this is run I get the following error:
BUILD FAILED
C:\docume~1\dtanner\desktop\RELupdate.xml:134: Error executing the script snippe
t
connect('system','weblogic','t3://...:
7001')
apps=cmo.getAppDeployments()
for app in apps:
if app.getName().startswith("reporting-r
eport"):
stopApplication(app,block='true'
undeploy(app,targets='MS1,MS2',b
lock='true')
deploy('reporting-report-server','//box1/do
mains/applications/reporting-report-server.war',targets='MS1,MS2',stageMode='sta
ge',block='true')
apps=cmo.getAppDeployments()
for app in apps:
if app.getName().startswith("reporting-r
eport"):
startApplication(app,block='true
due to:
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('<string>', 2, 33, '\t\t\t\tapps=cmo.getAppDepl
oyments()'))Hi,
Move the row from IT_MSEG into a work area and use it. Declare the workarea of required type.
DATA:l_werks type werks.
read table it_mseg into wa_mseg index 1.
l_werks = wa_MSEG-WERKS.
Regards
Vinod -
Can anyone tell me how to run JUnit from Ant? I have a directory structure set up with the source files in src, the .class files in build, and the junit task in Ant seems to be unable to find my .class files.
I can run the test using the java task (which would be an option, when all else fails):
<target name="test" depends="init,compile"
description="unit test" >
<java classname="${testclassname}"
failonerror="yes"
classpath="${fullclasspath}"
>
</java>
</target>I can run the test using the junit task from the build directory (but you lose the depends functionality, as you cannot compile from here):
<target name="unit" depends="init"
description="unit test" >
<junit printsummary="yes"
>
<test name="it.FlagHandlerTest"/>
<formatter type="plain"/>
</junit>
</target>But I cannot persuade the junit task to run from the project top directory (java.lang.ClassNotFoundException thrown in JUnit), eg.
<target name="unit" depends="init,compile"
description="unit test" >
<junit printsummary="yes"
dir="${build}"
fork="yes"
>
<test name="it.FlagHandlerTest"/>
<formatter type="plain"/>
<classpath>
<pathelement location="${fullclasspath}"/>
</classpath>
</junit>
</target>I am using Ant 6.1, JUnit 3.8.1, Java 1.4.2.The JUnit task requires 2 jars to be in the classpath when Ant is run:
1) ant-junit.jar
2) junit.jar
According to the Ant manual you have two choices:
1) Add junit.jar to the classpath
2) Remove ant-junit.jar from the ant/lib directory and redefine the task in the build script, with a <taskdef> and a nested <classpath> elements. -
I am developing a GUI interface applying the MVC architecture, and I do my compiling using the ANT. I work on XP and use Cygwin.
I classified the source codes into 4 different packages: handler, view, model, and helper. All source codes are stored in their corresponding package directories and they all have their correct package statement first line in the code.
After I build the code using ANT, I attempted to run the code using a script, the script containing following lines:
echo "msg"
java -cp ./build/classes/ teleinstrument.handler.TeleInstrument -d demo
However I get a exception during the middle of the execution:
Exception in thread "main" java.lang.NoClassDefFoundError: com/l2fprod/gui/plaf/Skin/SkinLookAndFeel
I know this is a third-party jar file that a use so enables me to use theme pack to dress up my application, and CLASSPATH has been set in the Windows XP's environment variables. Also I've use this jar file to develop other applications without a problem.(the only difference I can think of is that in previous applications I never used package statement in the code).
So then I copied the skinlf.jar which is the third-party jar file into /lib/ directory, but the problem persist. So I changed my script into this:
echo "msg"
java -cp /home/Unamuno/TeleInstrument0.2/lib/skinlf.jar:./build/classes teleinstrument.handler.TeleInstrument -d demo
I get the following error:
exception in thread "main" java.lang.NoClassDefFoundError: teleinstrument/handler/TeleInstrument
Please I am going nuts on this, can somebody please help me?????Have you tried running it in a cmd window (not using cygwin).
java -cp c:\whatever\home\gyang\TeleInstrument0.2\lib\skinlf.jar;c:\somwhereelse\build\classes teleinstrument.handler.TeleInstrument -d demo
I suggest this as the first approach you used to launch java
worked but could not find the required class from the skinlf.jar
file.
The second approach you tried (with paths to skinlf.jar and build/classes)
could not even find the TeleInstrument class. Now the reason for that
could be that the ':' in the cygwin command is not being properly converted
to the corresponding ';' and therefore java could not understand
the second part of the -cp argument.
So the way I see to test if this is the case is to open a cmd box
under windows (start->programs->accessories->command prompt)
and type in somthing similar to the example I gave at the begining of this
post. Ensure that you specify the compelete path to each entry in the -cp
arguments (you can trim out the bits you don't need after you have it working)
matfud -
Hi
I am trying to build an ANT file in eclipse and using vssget to get the latest version. When I run it it gives me this error "'ss' is not recognized as an internal or external command". Can somebody help me?That's the same message you would get if you went to the command line with a randomly-chosen current directory and typed "ss (whatever)". So either fix your PATH environment variable so it includes the directory where ss.exe is located, or have your script use that directory as its current directory, or something else like that.
-
ECLIPSE, ANT and generating WAR files...
I'm trying to configure my Eclipse Ant Builder, so that I can have the WAR of my web-app generated in a single task.
The "build.xml" that Eclipse generates as a result of the "Export" task does good (obviously!), but I'd like to add a "generate-war" task, which (depending on the "build" task) should also create the WAR, adding all the needed resources into it.
The problem I'm facing is about the external libraries that I want to be included in the "WEB-INF/lib" directory of the WAR.
Infact, I'd like them to be "loaded" directly from the classpath, that is directly from the "path" element created by eclipse during the Export task.
So, in "build.xml" I have:
<path id="MyWebApp.classpath">
<path refid="Database.userclasspath"/>
<path refid="JavaHelp.userclasspath"/>
</path>where, for example:
<path id="Database.userclasspath">
<pathelement location="path-to-jar"/>
<pathelement location="path-to-another-jar"/>
</path>And in "build-user.xml" I want to make a target capable of copying all the jars referenced by "MyWebApp.classpath", discovering them automatically.
The problem is that the "copy" tasks need a fileset or a dir, whereas what I have is a path reference...
Has anyone been involved in the same?
Thanks in advance for your help!!I don't know what you mean by "reproducing what eclipse does". Eclipse will use the projects java build path, and you can add the jars from your WEB-INF/lib directory to this path.
If you really don't want to put the jars in WEB-INF/lib then:
<property environment="env"/>
<property name="xxx.jar" location="${env.CATALINA_HOME}/common/lib/xxx.jar"/> // for example
<path id="webapp.base.classpath">
<pathelement location="${xxx.jar}"/> // refer to the property not the file directly
</path>
// etc ... -
Not sure if this is the right forum, but has anyone managed to get Ant to connect to CVS via SSH
I am trying the following in my build file
<target name="checkout">
<delete dir="project" includeemptydirs="true"/>
<property name="src" value="."/>
<cvs cvsRoot=":ext:usernaml@localhost:/Users/user/cvsrep" command="co project" cvsRsh="ssh" />
</target>The .cvspass file exists but it keeps prompting me for a password.
GeorgeDoes Ant have anything to do with the Java Programming language? - Yes
<quote>
Apache Ant is a Java-based build tool.
</quote>
I am sure there are many developers on this forum who use ant. Perhaps you don't but thats no reason for a bad tempered and unhelpful response.
So here is mine
Why don't you just fuck off.
Maybe you are looking for
-
MacBook Pro Hard drive is making weird noises and slow
its important that you understand what has led to these issues. I first was witing an essay on my MacBook. Whole thing dies, screen freezes and entire thing crashes. i have no choice but to force it off by holding the power button... Then the fun beg
-
Apache PW Authentication & Leopard
i have an apache site running on my G%. i had password authentication working fine under Panther and Tiger. just upgraded to Leopard and it seems not to be working. it's as though none of the httpd.conf edits (that i see are still there) are not taki
-
Windows Defender will not start after injecting Language Pack
Hi I have started creating a new Windows 8.1 image for deployment to a new series of computers. When I am in audit mode installing programs, Windows Defender works fine. After sysprep and offline injection of Language Pack (da-dk) Windows Defender us
-
I just downloaded the new version of itunes, but I don't know why I can't download my music as the last version I used
-
SPA504G won't boot up after misconfiguration
I have a spa504g phone which I successfully upgraded to 7.5.5. After that I changed the config file to add support for Croatian language. By accident I have entered following in XML config file: <Dictionary_Server_Script group="Regional/Miscellaneous