• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

i'm so frustrated......deployment issue

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have my file structure as:
E:\weblogic\wlserver6.1_beta\config\mydomain\applications\DefaultWebApp_myserver

I am using following commands at dos prompt:

mkdir build build\META-INF
copy *.xml build\META-INF

javac -d build Account.java AccountHome.java ProcessingErrorException.java
AccountBean.java

cd build
jar cv0f Account.jar META-INF mydomain
cd ..

java -classpath %WL_HOME%/lib/weblogic_sp.jar;%WL_HOME%/lib/weblogic.jar
weblogic.ejbc -compiler javac build\Account.jar %APPLICATIONS%\Account.jar

javac Account.java AccountHome.java ProcessingErrorException.java

javac Account.java AccountHome.java ProcessingErrorException.java

I GET ERROR: ACCOUNT BEAN NOT FOUND / CAN NOT OPEN JAR FILE.
WHERE TO RUN A BATCH FILE HAVING ALL THESER COMMANDS?
AT config>mydomain ?
OR AT config>mydomain>Applications?
OR AT config>mydomain>Applications>defaultwebapp_myserver?
if i store all beawns in config>mydomain>Beans folder and run all above commands i get error :
Can not open jar files

How to deploy the ejb?WHERE TO RUN SCRIPTS...
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sanjay,
I`m not a weblogic expert, but I`ve some experience of deploying similar code.
The best way forward, as i only have a limited understanding of you setup is to suggest you try and model you compile and deployment around the script below.
This script operates in the dircetory /opt/weblogic/build
It assumes your source code and jars are below this point.
take 15 mins to read it, then try and replace my code,jars etc with yours.
Its for a unix system obviously.......... hope this helps
***********************************************************

#!/bin/sh
#
#ident "@(#)makeeservice.sh
#
#1
#
# /makeeservice.sh - build/deploy/both deploy and build the eService application
#
#
# Prior to running this script - the following is necessary:
#1) WebLogic Server is installed and confirmed to run (in default configuration)
#2) The environment variable WL_HOME points to the root of the weblogic install directory
#example: WL_HOME=$WL_HOME
#3) The environment variable JAVA_HAME points to the root of the JDK install
#example: JAVA_HOME=/usr/java
#
#
#
# Verify/setup the environment
JAVA_HOME=${JAVA_HOME:-"/usr/java"}
WL_HOME=${WL_HOME:-"/opt/weblogic"}
LOCAL_HOME=${LOCAL_HOME:-"/opt/weblogic"}
MID_PATH=${MID_PATH:-"../lib/external/mail.jar:../classes:$WL_HOME/classes:$WL_HOME/lib/weblogicaux.jar:$WL_HOME/myserver/serverclasses:../lib/external/junit.jar:../lib/external/xm l.jar:../lib/external/vbjorb.jar:./classes"}
LONG_PATH=${LONG_PATH:-"../lib/external/mail.jar:../classes:$WL_HOME/classes:../lib/external/cos.jar:../lib/external/activation.jar:$WL_HOME/lib/weblogicaux.jar:$WL_HOME/myserver/s erverclasses:../lib/external/junit.jar:../lib/external/xml.jar:../lib/external/activation.jar:./classes:../lib/external/vbjorb.jar"}

case $1 in
'build')
# Make sure we're in the right place
if [ -f license/WebLogicLicense.xml ]; then
echo "makeeservice.sh: must not be run from the root WebLogic directory" 1>&2
exit 1
fi

# cleanup any previous builds
echo "cleaning up old files..."
rm -Rf classes
mkdir classes
# modify the execution attributes of the idltojava for solaris binary
# this is necessary as after the PVCS deploys this file it is non-executable
chmod +x ./bin/idl2javaVB40.sh
# create the CORBA stubs/skeletons
echo "creating CORBA stubs/skeletons..."
cd src
../bin/idl2javaVB40.sh ../orion/ORION_XA.idl

../bin/idl2javaVB40b.sh ../IDL/ORION_XA_Proxy.idl

../bin/idl2javaVB40b.sh ../IDL/xagent.idl

# COMPILE the project files

echo "build for EService 3"

echo "compiling ORION_XAClasses (deprecated message OK)..."
javac -classpath $MID_PATH -d ../classes ORION_XAClasses/*.java


echo "compiling ORION_XA_Proxy Classes (deprecated message OK)..."
javac -classpath $MID_PATH -d ../classes ORION_XA_Proxy_Classes/*.java


#echo "compiling ORION_XAClassesImpl (deprecated message OK)..."
#javac -classpath $MID_PATH -d ../classes xagent/*.java xagentc/*.java ORION_XAClassesImpl/*.java



echo "compiling ORION_XA (deprecated message OK)..."

javac -classpath $MID_PATH -d ../classes ORION_XA/*.java



echo "compiling model, servlets (deprecated message OK)..."

javac -classpath $MID_PATH:$LONG_PATH -d ../classes com/concert/model/*.java com/concert/servlets/*.java


echo "compiling model, servlets orion/util, tom ,xaaadmin,util & xagent & ipms/ejb packages & orion/actions & ipms/actions com/concert/ejb package eservice ,eservice/usebeans,eservice/createorder & eservice/orderstatus(deprecated message OK)..."

javac -classpath $MID_PATH:$LONG_PATH -d ../classes xagent/*.java xagentc/*.java ORION_XAClassesImpl/*.java com/concert/orion/util/*.java com/concert/orion/util/xaconverter/*.java com/concert/tom/*.java com/concert/xaaadmin/*.java com/concert/util/*.java com/concert/xagent/*.java com/concert/orion/actions/*.java com/concert/ejb/*.java com/concert/eservice/usebeans/*.java com/concert/eservice/*.java com/concert/eservice/createorder/usebeans/*.java com/concert/eservice/orderstatus/*.java com/concert/eservice/orderstatus/usebeans/*.java com/concert/ipms/actions/*.java com/concert/ipms/api/*.java com/concert/ipms/ejb/*.java com/concert/ipms/util/*.java



echo "compilation of eservice java classes complete..."

######################################################################
echo "starting compilation and jarring of EJBs (2)..."

# Current Directory - build/src
#copy the xml descriptor files for the ExchangeAgent EJB to the build directory
cp -R META-INF ../classes

#goto the build directory as we need to be there to properly jar the EJB(s)
cd ../classes

#create intermediate jar files that contains the xml descriptors
echo "jaring ExchangeAgentEJB...(1)"
jar c0f exchangeAgentEJBtmp.jar META-INF com/concert/ejb/ExchangeAgentEJB*.class


#compile and create the finalized EJB jar files
echo "compiling ExchangeAgentEJB..."
java -classpath .:$WL_HOME/classes:$WL_HOME/lib/weblogicaux.jar weblogic.ejbc -classpath .:../classes:$WL_HOME/classes:$WL_HOME/lib/weblogicaux.jar:$WL_HOME/myserver/serverclasses:../lib/external/junit.jar:../lib/external/xml.jar:./classes exchangeAgentEJBtmp.jar exchangeAgentEJB.jar
################################################
echo "jaring BEContext EJB...(2)"

# place /src/com/concert/xaaadmin *.xml files in the META-INF directory

echo "current directory -"
pwd

cp ../src/com/concert/xaaadmin/*.xml META-INF


# jar the BEContext*.classes with the META-INF xml descriptors
jar c0f BEContextEJBtmp.jar META-INF com/concert/xaaadmin/BEContext*.class

echo "compiling BEContext EJB..."
java -classpath .:$WL_HOME/classes:$WL_HOME/lib/weblogicaux.jar weblogic.ejbc -classpath .:../classes:$WL_HOME/classes:$WL_HOME/lib/weblogicaux.jar:$WL_HOME/myserver/serverclasses:../lib/external/junit.jar:../lib/external/xml.jar:./classes BEContextEJBtmp.jar BEContextEJB.jar

#remove the intermediate jar files
rm -f exchangeAgentEJBtmp.jar
rm -f BEContextEJBtmp.jar

echo "linking Images to images directory..."
ln -s /opt/weblogic/myserver/public_html/xaa/jsp/Images /opt/weblogic/myserver/public_html/xaa/jsp/images


#jar up the dependency classes for easy deployment
echo "jaring rest of classes..."
jar c0f orion_xa.jar ORION_XA ORION_XAClasses ORION_XA_Proxy_Classes ORION_XAClassesImpl
jar c0f orion_util.jar com/concert/orion/util
jar c0f xagent.jar com
jar c0f xagentserver.jar xagent xagentc
echo "build attempt complete - check for errors"
cd ..
;;


####################################################################
'deploy')
# make sure the external directory exists
echo "creating needed directories and copying files..."
if [ ! -f $LOCAL_HOME/lib/external/xml.jar ]
then
mkdir $LOCAL_HOME/lib/external
fi
# backup the files as needed
if [ -f $LOCAL_HOME/startWebLogic.sh ]
then
mv $LOCAL_HOME/startWebLogic.sh $LOCAL_HOME/startWebLogic.sh.back
fi
if [ -f $LOCAL_HOME/stopWebLogic.sh ]
then
mv $LOCAL_HOME/stopWebLogic.sh $LOCAL_HOME/stopWebLogic.sh.back
fi
if [ -f $LOCAL_HOME/xagent.properties ]
then
mv $LOCAL_HOME/xagent.properties $LOCAL_HOME/xagent.properties.back
fi
if [ -f $LOCAL_HOME/weblogic.properties ]
then
mv $LOCAL_HOME/weblogic.properties $LOCAL_HOME/weblogic.properties.back
fi
#clean up all old JSP generated java/class files
rm -Rf $LOCAL_HOME/myserver/classfiles
# copy the files to the run-time WebLogic Server environment
cp classes/orion_util.jar $LOCAL_HOME/lib/external
cp classes/orion_xa.jar $LOCAL_HOME/lib/external
cp classes/xagent.jar $LOCAL_HOME/lib/external
cp classes/xagentserver.jar $LOCAL_HOME/lib/external
cp classes/exchangeAgentEJB.jar $LOCAL_HOME/myserver/serverclasses
cp classes/BEContextEJB.jar $LOCAL_HOME/myserver/serverclasses
cp lib/external/xml.jar $LOCAL_HOME/lib/external
cp lib/external/junit.jar $LOCAL_HOME/lib/external
cp lib/external/mail.jar $LOCAL_HOME/lib/external
cp lib/external/activation.jar $LOCAL_HOME/lib/external
cp lib/external/cos.jar $LOCAL_HOME/lib/external
cp lib/external/oci.jar $LOCAL_HOME/lib/external
cp lib/external/vbjorb.jar $LOCAL_HOME/lib/external

cp startWebLogic.sh $LOCAL_HOME
cp stopWebLogic.sh $LOCAL_HOME
cp xagent.properties $LOCAL_HOME
cp weblogic.properties.unix $LOCAL_HOME/weblogic.properties
cp -R myserver/public_html/xaa $LOCAL_HOME/myserver/public_html
;;
'all')
makeeservice.sh build
makeeservice.sh deploy
;;
*)
echo
echo "usage: makeeservice.sh {build|deploy|all}"
echo
;;
esac
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic