Where to copy images directory on WLS server? - ORDS, SODA & JSON in the Database

I understand we have to create a war file of the images directory and then deploy it, but is it possible just to copy the images to a path on the WLS? (Similar to what we do in GlassFish, Apache Tomcat and OC4J servers)? That is a better option personally to me. I tried creating the war and then when I try to deploy the war file, I get the following errors
Message icon - Error Unable to access the selected application.
Message icon - Error Exception in AppMerge flows' progression
Message icon - Error Exception in AppMerge flows' progression
Message icon - Error C:\oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\tmp\.appmergegen_1278488556375_i.war\c:\oracle\apex_4\apex_4.0_en\apex\images\16admin.gif (The filename, directory name, or volume label syntax is incorrect)::Probably the string length of the path of the file being extracted was too long or failed to overwrite the file
Message icon - Error C:\oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\tmp\.appmergegen_1278488556375_i.war\c:\oracle\apex_4\apex_4.0_en\apex\images\16admin.gif (The filename, directory name, or volume label syntax is incorrect)::Probably the string length of the path of the file being extracted was too long or failed to overwrite the file 

You'll need to check the WLS configuration for a docroot and place it there.
-kris 

I had this problem because I was not familiar with the syntax of the JAR command.
In the documentation the command is shown as: jar –cvf0 <temp directory>\i.war –C <apex directory>\images .
I took the period at the end to be punctuation but it is in fact a necessary part of the JAR syntax. If it is not included the .WAR is compiled with absolute paths i.e "C:\APEX\..." which is not valid in a .WAR structure.
regards,
David 

Dear David,
Your reply was not clear to me. Can u post what the exact syntax should be, if the syntax in document is wrong?
Besr Regards,
Saravanan S 

The syntax in the document is correct. I misinterpreted it.
The ' . ' at the end of the line is part of the command syntax. Omitting it makes the WAR file unusable. 

I still have the problem and cannot load the i.war file in WLS server. 

This was a bit of a problem for me as well... You might get some useful information from my thread at:
Images not showing - Weblogic 10.3.3 - APEX 4.0
The key to solving my problem seemed to include using an updated version of Java to create the i.war file and to use short pathnames in my commands for doing so.
Try upgrading Java to the latest version of Sun Java and use it to create your i.war file.
It looks like you might have an issue with pathnames which could have resulted from how you created the i.war, so the following might help. If you use the one with the periond at the end, I would suggest keeping the pathnames short:
As I understand it, if you use the full paths, don't forget the "." at the end of the command since it looks like punctuation but it is actually needed. The final period argument instructs jar to archive all the contents of that directory, but not the directory itself. I used something like this:
jar -cvf0 /u01/war/i.war -C /u01/images401 .
which in my case corresponds to:
jar –cvf0 <temp directory>\i.war –C <apex directory>\images .
If you are in the directory where the images are stored, then I think that you could also just run the commands:
cd <apex directory>\images
or from my example above
cd /u01/images401
jar -cvf i.war *
I had copied my <apex directory>\images to a directory on my WebLogic server where I had installed the latest version of Sun Java. You can determine the version of Java you are using as follows:
java -version
will produce output like:
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)
Hope this helps!
- Scott

Related

jar tool slight problems

hi folks.
installed Java jdk 1.5.0
C:\Java\Jdk1.5.0\bin
q1)
on cmd command prompt, if i type jar, i get following error:
"Can't determine application home".
q2) I used JBuilder foundation to create a simple application with 5 classes.
Packge is called: sqlInsertion.
within the sqlInsertion i have the following directories:
bak, classes, src, doc.
I am struggling to use jar tool so thats my first concern. 2ndly I need to create an executable jar file, I have read sun's tutorial but i get following errors:
"Failed to load Main-Class Manifest attribute from " path ".jar". where path is the path to this .jar file I created.
Please, please help. 
q1) on cmd command prompt, if i type jar, i get following
error: "Can't determine application home".On the command line, did you key in the word 'jar', or do you mean you keyed in the name of your jarfile?
q2) I used JBuilder foundation to create a simple
application with 5 classes.
Packge is called: sqlInsertion. within the sqlInsertion i have the following
directories: bak, classes, src, doc.Do you mean that your package sqlInsertion is in the directory named sqlInsertion and the other directories: bak, classes, src, doc are sub-directories of sqlInsertion?
I am struggling to use jar tool so thats my first
concern. 2ndly I need to create an executable jar
file, I have read sun's tutorial but i get following
errors:
"Failed to load Main-Class Manifest attribute from "
path ".jar". where path is the path to this .jar file
I created.
Please, please help.Well before you create the jar you must make sure that the application works right. Does it run fine from the command prompt when you key in:
>java -cp my;class;path sqlInsertion.WhatEverTheClassNameIs
?
Next, in order to use the jar tool, at the command prompt simply key in:
>jar
... you should get a help menu. If you don't, what do you get? It may be that your system PATH needs to be set. I'll leave off here for the time being. 
thanks abil.
System PATH (My Computer, properties, Advanced, Environment Vars.) is set to:
C:\Sun\AppServer\bin;C:\Java\Jdk1.5.0\bin;C:\Java\Jre1.5.0\bin
1) On command prompt, this is the output (in response to the q: what command i type in)
C:\>jar
Can't determine application home
2) The directories lie here:
C:\Documents and Settings\user\jbproject\SQLInsertion\
the src, classes etc are in the parent directory SQLInsertion (above path) i.e subdirectories. 
Go to each of those 'bin' folders/directories one at a time and enter 'jar' and hit enter and see what you get.

Deploying Application in Solaris

Hello
I have a java Application (standalone) 5 class files uses the following jars
commons-logging-1.1.jar
j2ee.jar
log4j-1.2.13.jar
mail.jar
I created my application into a jar file (FA.jar) I am using the following batch file to run my application
E:
cd E:\
java -cp %CD%;%CD%\lib\j2ee.jar;%CD%\lib\mail.jar;%CD%\lib\log4j-1.2.13.jar;%CD%\lib\commons-logging-1.1.jar;;%CD%\lib\FA.jar FileAlert DEV
This was running without any issues in Windows box. Now the application has to be moved to Solaris box.
I have my user account set up and I created lib folder under that
/home/FileWatcher/lib
I changed the batch script to shell script
for name in /home/ln52701/FileWatcher/lib/*.jar ; do
CP=$CP:$name
done
CP=$CP:/home/ln52701/FileWatcher/lib/FA.jar
echo $CP
java -cp $CP FileAlert DEV
When I execute this script the following error is coming
$ ksh FA.sh
:/home/ln52701/FileWatcher/lib/FA.jar:/home/ln52701/FileWatcher/lib/commons-logging-1.1.jar:/home/ln52701/FileWatcher/lib/j2ee.jar:/hom
e/ln52701/FileWatcher/lib/log4j-1.2.13.jar:/home/ln52701/FileWatcher/lib/mail.jar:/home/ln52701/FileWatcher/lib/FA.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Category
How to tackle with this problem are there any configuration issues or am I making any mistake
Thanks in advance for help
Sridhar 
Hey
I found out the problem..the problem is the jar files got corrupted...I tried to look into jar files using the command jar tf <jar-filename> it throws an error...if the jar file is not corrupted then it will list of all the file names.
I updated the correct jar files and everything worked...
I hope it could be one of the points when problems like ClassNotFound Exceptions come just look into jar file...who knows
I am taking out my duke dollars...its mine now :-)
Sridhar

running servlet on tomcat5.0

hi,
i am using java version 1.4.2_03 and tomcat5.0, trying to run a servlet. i set the class path to c:\program files\tomcat5.0\common\lib\servlet-api.jar . is this correct? if yes, i still get a error which says,
invalid class file format:c:\program files\tomcat5.0\common\lib\servlet-api.jar(javax/servlet/http/HttpServlet.class), wrong version: 46, expected 45. now i have read in the website that tomcat supports servlet version 2.4 .does jdk1.4.2_03 come with a servlet version of 2.4 too? i dunno where i am going wrong. please help. thanx in advance. 
Are you sure you're using 1.4.2_03? Class file version 46 has been supported since Java 1.2. What does java -version say?
hi jason,
it says java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standar Edition (build 1.4.2_03-b02)
java Hot Spot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
thanx,
bye 
Tomcat is a servlet container and should not need any such classpath set. You should have your typical JAVA_HOME & CATALINA_HOME env variables set, but that should be all you need. 
See if you have another servlet.jar installed somewhere on your machine.
If you've installed Oracle or a J2EE app server there might be another one lurking around somewhere. Do a search on servlet*.jar and see what it says. - MOD
Have you recently upgraded your version of java?
what version is Tomcat running?
Try this on a jsp page: <%= System.getProperty("java.version")%>
Check your startup shortcuts for Tomcat to see exactly how it is starting it up.
hi,
here is what i did. i wrote a servlet program, a deployment descriptor(xml), and a simple html page(index.html). the application is supposed to take the values from the html page invoke the servlet and display a message that the info is recieved. i wrote the whole application and placed in the webapps folder. inside this folder i created a new folder called "greeting". inside the greeting folder i placed the html file (index.html).
and with in the greeting folder i created a folder called WEB-INF and placed the deployment decriptor (named web.xml) there. and here in the web-inf folder i created another folder called "classes" and placed greetingservlet.java there. now i have not set the class path to this folder because i have installed jre. when i compile it here i get three errors.
1.package javax.servlet not found.
2.javax.servlet.http not found
3.super class HttpServlet of Greetingservlet not found.
so i assumed that i had to set the path to the servlet-api that comes with tomcat (version 5.0). so i set the path to c:\program files\tomcat5.0\common\lib\servlet-api.jar (set classpath=%classpath%;c:\program files\tomcat5.0\common\lib\servlet-api.jar).
then when i compile the program i get the error "invalid class file format:c:\program files\tomcat5.0\common\lib\servlet-api.jar(javax/servlet/http/HttpServlet.class), wrong version: 46, expected 45".
i checked if any other servlet*.jar files lurking around. i performed a search and i found 5.
1.servlet-api in(tomcat\common\lib) 2.servlets-invoker 3.servlets-common 4.servlets-webdav 5.servlets-default in (tomcat\server\lib).
so am i comitting a mistake in creating the class path? or do i have to set the class path to some other jar file?
the java version is 1.4.2_03 .
java runtime edition Standard Edition (1.4.2_03-b02)
thanx a lot, ur advice will be really helpful. 
You shouldn't be setting any CLASSPATH at runtime. If you have an environment variable named CLASSPATH, be sure that Tomcat is ignoring it.
Tomcat assumes this CLASSPATH for your Web app at runtime:
(1) The rt.jar from the JDK, of course,
(2) All the JARs in TOMCAT_HOME/common/lib, which are visible to all apps,
(3) All the JARs in TOMCAT_HOME/server/lib,
(4) All the JARs in your WEB-INF/lib, which are visible only to your app,
(5) All the .class files in your WEB-INF/classes, which are visible only to your app.
That's it.
You put the greetingservlet.java in the WEB-INF/classes directory? You have to compile that to a .class file using javac.exe first.
You DO have to set the CLASSPATH when you compile so javac can find the servlet classes it needs. When you execute the javac command, use the -classpath argument to tell the class loader where to find what it needs. (Read the javadocs about the javac tool if you're not sure about this.) Don't use the CLASSPATH environment variable. Better to set it every time you need it using the -classpath option for both javac.exe and java.exe, IMO.
The servlet-api.jar is in TOMCAT_HOME/common/lib, so you'll have to tell the compiler where to find that one.
I think that installing any software to a directory whose name contains spaces is a very bad idea. I'd move Tomcat out of that Windoze Program Files directory. - MOD
hi,
i did run the command
javac -classpath c:\tomcat\common\lib\servlet-api.jar GreetingServlet.java . i still get the following error
invalid class file format:c:\tomcat\common\lib\servlet-api.jar(javax/servlet/http/HttpServlet.class), wrong version: 46, expected 45
public class GreetingServlet extends Httpservlet
^
i removed the spaces from the path. :).
thanx.
how to set class path in enviroment variables for running servlet in tomcat 5.0 
how to set class path in environment variable for running servlet in tomcat5.0 
Go to mycomputer->(rightclick)Advanced--Environment variables their u can see the system variables and user varlables their u have to set the class apth..
classpath=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;
That' All
I hope this will help uuuuuuuuu 
i installed j2sdk1.4.2 in c drive and i installed jdki.5.0 in c;\program files\java and i set the classpath,path, for jdk1.5.0.
i installed tomcat 5.5 in c:\program files and set the cataina_home,java_home paths.
i compiled the java servlet program
its shows error message javax.servlet package not found and so on errors r coming
plz send required info to solve this problem with clearly understandable step by step format solution to me

Using javac and classpath with Linux

My classpath is
/usr/java/jdk1.3.1_02/bin (that's the path to jdk1.3.1)
but I get a
/usr/java/jdk1.3.1_02/bin/i386/native_threads/javac: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory
error when I try to compile a java file with javac. tried to set the classpath to
/usr/java/jdk1.3.1_02/bin/i386/native_threads/
and I get another error with that
Any help is appreciated, thanks 
<http://developer.java.sun.com/developer/bugParade/bugs/4405489.html>
Assuming you are using RedHat, if other search at rpmfind.net for your distro (if it's a RPM-based distro):
You need either:
For RedHat 7.1: <http://www.rpmfind.net//linux/RPM/redhat/7.1/i386/compat-libstdc++-6.2-2.9.0.14.i386.html>
For RedHat 7.2:
<http://www.rpmfind.net//linux/RPM/redhat/7.2/i386/compat-libstdc++-6.2-2.9.0.16.i386.html>
The CLASSPATH values have already been specified in many other posts.
Bhav

Setting Server-Side Classpaths

Hello,
I was wondering if somebody would be generous enough to guide me in setting a server-side classpath. I am a fairly new java programmer who is a bit swamped in some of the specifics of working in a Server-Side Tomcat setup.
I attempt to execute the following shell script form the unix command line on the server to setup my Classpath. The shell script is as follows. Please assume all paths are correct:
--------------------------------------------------------
JAVA_HOME=/usr/java/j2sdk1.4.2_04
BASEDIR=/home/pkg/tomcat
JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed
set TOMCAT_COMMON=/home/pkg/tomcat/common/lib
set CECILREP_LIB=/home/pkg/tomcat/webapps/CecilRep/WEB-INF/lib
set WS_LIB="$TOMCAT_COMMON"/axis.jar:"$TOMCAT_COMMON"/axis-ant.jar:"$TOMCAT_COMMON"/activation.jar:"$TOMCAT_COMMON"/commons-logging.jar:"$TOMCAT_COMMON"/jaxrpc.jar:"$TOMCAT_COMMON"/mail.jar:"$TOMCAT_COMMON"/monitor.jar:"$TOMCAT_COMMON"/resolver.jar:"$TOMCAT_COMMON"/saaj.jar:"$TOMCAT_COMMON"/SOAP.jar:"$TOMCAT_COMMON"/tools.jar:"$TOMCAT_COMMON"/wsdl4j.jar:"$TOMCAT_COMMON"/xercesImpl.jar:"$TOMCAT_COMMON"/xml-apis.jar:"$TOMCAT_COMMON"/xmlParserAPIs.jar
set CLASSPATH="$JAVA_HOME"/lib/tools.jar:"$TOMCAT_COMMON"/jcommon-0.9.4.jar:"$TOMCAT_COMMON"/CecilRep2_0.jar:"$TOMCAT_COMMON"/HTMLPage.jar:"$TOMCAT_COMMON"/commons-fileupload-1.0-rc1.jar:"$TOMCAT_COMMON"/jfreechart-0.9.19.jar:"$CECILREP_LIB"/lucene-1.2-cecilchange.jar:"$CECILREP_LIB"/lucene-1.2.jar:"$CECILREP_LIB"/cecilbeans.jar:"$CECILREP_LIB"/cecilquery.jar:"$TOMCAT_COMMON"/poi-2.0-pre2-20030711.jar:"$TOMCAT_COMMON"/servlet.jar:"$TOMCAT_COMMON"/xls2CecilXML.jar:"$TOMCAT_COMMON"/log4j-1.2.8.jar:"$WS_LIB"
echo $CLASSPATH
export $CLASSPATH
--------------------------------------------------------
Here are the problems I am running into. The issue is that this shell script does not work correctly in setting the classpath. When I run the following command I receive the error:
--------------------------------------------------------
java org.apache.axis.client.AdminClient deploy.wsdd
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/client/AdminClient
--------------------------------------------------------
Now, I am smart enough to know that this is a tailor-made classpath problem, however I have not been successful in diagnosing it. Peculiarly, and this is probably what I am missing, if I execute "set $CLASSPATH" from the command-line, to view it, I do not see any of my shell script information in it.
If anybody would be generous enough to help me with this issue, I would be very thankful,
Sincerely,
James Crosson
Prospective Java Wizard.
setting a server-side classpathYou don't.
You have two environment variables:
JAVA_HOME
CATALINA_HOME
That's it. Everything else is just putting stuff in the correct place. 
What this is telling you is that Tomcat and WebSphere don't give a fig about your system CLASSPATH. They don't look at it.
You need to learn about Tomcat's class loaders and what it assumes the CLASSPATH is.
All the JARs in the TOMCAT_HOME/common/lib directory are automatically in the CLASSPATH.
If you create a Web app, the WEB-INF/classes and WEB-INF/lib contents are automatically in the CLASSPATH for that Web app.
What JAR is org/apache/axis/client/AdminClient stored in? That needs to be in TOMCAT_HOME/common/lib, too.
What version of Tomcat are you running? 4.1.30?
%
Thank you for your help.
The file org.apache.axis.client.AdminClient is a deployment loader for a Apache Axis web service. It is located in the axis.jar file.
I have the following directory structure, and the axis.jar file is in each of the following directories:
TOMCAT\common\lib
TOMCAT\webapps\axis\WEB-INF\lib
This should be sufficient, correct? If I do not have to worry about the CLASSPATH at all, then where should the files be stored within Axis?
Where should the files go within Tomcat so that running
java org.apache.axis.client.AdminClient will find axis.jar and be able to execute properly?
James

Categories

Resources