Access a data file within a jar package
hello, everyone
I got a problem in locating a data file packaged in jar file.
For example, in foo.jar there is a data file with the directory path "d1/d2/data.log". In the command line, I want to access that data file by making it as an input to the Main class which will load data.log at runtime. However, it reported exception of "no such file or directory". In the command line, I input:
java -classpath foo.jar d1.d2.Main d1/d2/data.log
any suggestion?
Thanks
Chinyi
I don't understand what you're trying to do by including d1/d2/data.log in the commandline? It appears to be extraneous and invalid.
Assuming:
that the class you want to execute is Main.class in foo.jar, and that its path in the jar is di/d2, and
that Main uses d1.d2.data.log when it access this file, it should work.
Similar Messages
-
ORA-12705: Cannot access NLS data files or invalid environment specified
Hi,
I am using Oracle 10g Express, ojdbc14.jar , apache tomcat 5 server on Linux (Fedora 6).
In CustDisp.JSP I have following code:
<%
try {
Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance();
out.println("JDBC driver loaded.<br>");
catch (ClassNotFoundException e) {
%>
error :<br>
<%=e.toString() %>
<%
String sql = "SELECT custid, fname, lname FROM customers";
try {
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","myid", "mypassword");
out.println("Connection made.<br><br>");
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sql);
%>
When Itry to access http://localhost:8080/jsps/CustDisp.jsp,I get following error:
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-12705: Cannot access NLS data files or invalid environment specified.
When I display enviorenment parameters in this JSP, I get follwing:
JDBC driver loaded.
Oracle Home = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server
Language = en_US.UTF8
NLS Language = AMERICAN_AMERICA.AL32UTF8
Path = /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
Class Path = /usr/lib/jvm/java/lib/tools.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar
Charset = null
Home = /usr/share/tomcat5
Log Name = tomcat
LD LIB PATH = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/nls/data/ojdbc14.jar:
Locale = en_US
nls data directory : /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/nls/data
I have checked permissions for nls data folder, they are :
Owner: Oracle
Folder Access: Create and delete files
Group: Dba
Folder Access: Access files
Others
Folder Access: Access files
Execute: Allow executing file as program.
I have written a java program and used same drivers,customers table and connection i.e
Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance();
String sql = "SELECT custid, fname, lname FROM customers";
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","myid", "mypassword");
it works fine and displays customers.
Only when I try to access my CustDisp.JSP, I get
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-12705: Cannot access NLS data files or invalid environment specified. Error.
Can some one please help me sorting out this problem?
Thanks in advance.
AQKHi,
Relevant code for CustDisp.JSP is given below:
<%@ page session="false" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="oracle.jdbc.*" %>
<%
try {
Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance();
out.println("JDBC driver loaded.<br>");
catch (ClassNotFoundException e) {
%>
error :
<%=e.toString() %>
<%
String sql = "SELECT custid, fname, lname FROM customers";
try {
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","myid", "mypassword");
out.println("Connection made.<br><br>");
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sql);
%>
Permissions for nls data folder
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/nls/data/
are :
Owner: Oracle
Folder Access: Create and delete files
Group: tomcat
Folder Access: Access files
Others
Folder Access: Access files
Execute: Allow executing file as program.
In CustDisp.JSP I have following code which accesses ojdbc14.jar
// Check access to the nls data files.
cfile = "";
try{
File myfile = new File("/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/nls/data/ojdbc14.jar");
if (myfile.exists() == true){
cfile="ojdbc14.jar exists in the data directory. Its length is "+ myfile.length()+" It can be read =" myfile.canRead() " , can be written = " + myfile.canWrite();
}else{
cfile="ojdbc14.jar does not exist.";
catch (Exception er){
%>
error in reading file:<br>
<%=er.toString() %>
<%
This code gives following output:
File ojdbc14.jar exists in the data directory. Its length is 1536979 It can be read =true , can be written = false
Every things seems to be OK but when I try to access http://localhost:8080/jsps/CustDisp.jsp, Iget:
Sql Error:
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-12705: Cannot access NLS data files or invalid environment specified
Best regards.
AQK -
Ora:12705 unable to access NLS data files or invalid environment specified
Hi All,
In our BW production SAP standard job DBA:update_stats is failing . In Job log we found that the info like
Ora:12705 unable to access NLS data files or invalid environment specified.
Connect to DB instance failed.
Brconnect terminated with exit code 3.
We are on Oracle 10.2 BW 3.5 Sunsolaris 5.10
The Env is as below:
HOME=/home/bwpadm
PATH=/oracle/BWP/102_64/bin:/usr/jdk/j2sdk1.4.2_13/bin:/home/bwpadm:/usr/sap/BWP/SYS/exe/run:/etc:/usr/bin:.:/opt/EMCpower/bin/64:/etc/emc/bin:/usr/ccs/bin:/usr/ucb:/usr/openwin/bin
LOGNAME=bwpadm
HZ=
TERM=vt100
SHELL=/bin/csh
MAIL=/var/mail/bwpadm
TZ=US/Pacific
PWD=/home/bwpadm
USER=bwpadm
SAPSYSTEMNAME=BWP
DIR_LIBRARY=/usr/sap/BWP/SYS/exe/run
LD_LIBRARY_PATH=/usr/sap/BWP/SYS/exe/run:/opt/j2sdk1.4.2_08/bin
JAVA_HOME=/usr/jdk/j2sdk1.4.2_13
THREAD=NOPS
dbms_type=ORA
dbs_ora_tnsname=BWP
dbs_ora_schema=SAPBWP
ORACLE_PSRV=BWP
ORACLE_SID=BWP
DB_SID=BWP
ORACLE_HOME=/oracle/BWP/102_64
ORACLE_BASE=/oracle
ORA_NLS33=/oracle/client/92x_64/ocommon/nls/admin/data
NLS_LANG=AMERICAN_AMERICA.WE8DEC
SAPDATA_HOME=/oracle/BWP
Plz suggest what we have to change to fix the problem.
Thanks,
Subhash.GThanks for the reply,
The below is the orasid env:
As you suggest we found ld_library_path is not set to oracle client .
we still using 9.x client shall we add that path to the above varaible.
Please suggest..
HOME=/oracle/RSS
PATH=/oracle/RSS/102_64/bin:/oracle/RSS:/usr/sap/RSS/SYS/exe/run:/etc:/usr/bin:.:/opt/EMCpower/bin/64:/etc/emc/bin:/usr/ccs/bin:/usr/ucb
LOGNAME=orarss
HZ=
TERM=vt100
SHELL=/bin/csh
MAIL=/var/mail/orarss
TZ=US/Pacific
PWD=/oracle/RSS/102_64/dbs
USER=orarss
SAPSYSTEMNAME=RSS
DIR_LIBRARY=/usr/sap/RSS/SYS/exe/run
LD_LIBRARY_PATH=/usr/sap/RSS/SYS/exe/run:/oracle/RSS/102_64/lib
THREAD=NOPS
dbms_type=ORA
dbs_ora_tnsname=RSS
dbs_ora_schema=SAPRSS
ORACLE_SID=RSS
DB_SID=RSS
ORACLE_BASE=/oracle
ORACLE_HOME=/oracle/RSS/102_64
NLS_LANG=AMERICAN_AMERICA.UTF8
SAPDATA_HOME=/oracle/RSS.
Thanks,
Subhash.G -
[exec] ORA-12705: Cannot access NLS data files or invalid environment specified
Hi all,
We have an app running ok on WinXP, But if run on Win7 it gets error:
[exec] Caused by: java.sql.SQLException: ORA-00604: error occurred at recur
sive SQL level 1
[exec] ORA-12705: Cannot access NLS data files or invalid environment speci
fied
Is this a sqlnet client issue?
Thanks a lot,
zxyyxes2013 wrote:
I already google it but I am not confident about my result
I need validation from genius guys like you
And as long as you rely on being spoon-fed everything, you will never be confident about your result.
Try the following:
>change jre versión (donwload from http:www.sun.com) and declare the new JAVA_HOME variable.
>try calling this code: Locale.setDefault(Locale.ENGLISH);
before you open a database connection.
> The NLS_LANG must be unset in the Windows registry (re-named is best). Look for the NLS_LANG subkey in the registry at \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, and rename it.
And where did you find that solution?
Lie On The Internet - YouTube -
Configuring Apach(ORA-12705: Cannot access NLS data files .. )
Hello,
I receive this error while configure an HTTP Server for Oracle XE Database.
ORA-604 LogOn ORA-00604: error occurred at recursive SQL level 1\nORA-12705: Cannot access NLS data files or invalid environment specified
The database NLS parameters is
SQL> select * from nls_database_parameters;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET CL8MSWIN1251
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.1.0
DADs configuration:
<Location /elxe>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlMaxRequestsPerSession 10
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString elxe:1521:XE ServiceNameFormat
PlsqlNLSLanguage AMERICAN_AMERICA.CL8MSWIN1251
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword xxxx
Allow from all
</Location>
What is wrong?It is most likely that the NLS files are missing from the server/pc.
Also look at the apachectl file.
Find the following line:
NLS_LANG=${NLS_LANG=""}; export NLS_LANG
Modify this line to look like the following:
NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251; export NLS_LANG
Christopher Soza
Oracle BI DBA
Orix Consultancy Services Ltd
b: http://sozaman.blogspot.com -
Accessing a Jar file within my jar...
Hi,
I've got a JDBC Jar file that I wish to include in my Jar package, but I'm unsure how to do this...
I'm using ant to compile my code & package it up into the Jar, & I can get it to compile fine, and package everything up fine (including the JDBC jar), but when I go to run the app I get an error
(No suitable driver).
My app works fine without being Jar'ed up.
I'm guessing that I need to set the classpath to reference the JDBC jar file in my jar... but I'm unsure how to do this.
Any help would be greatly appreciated.package what you thirdpart jar file and your jar file to one jar file..
it will run ok.
maybe the below tool can help you.
a tool named JavaJar(written by java) can compress and decompress jar,war, ear and.zip...
may download from http://www.qwerks.com/download/4114/JavaJar.zip
the tool is very verygood tool.
but the homepage(www.pivotonic.com) of JavaJar cannot be accessed.
it is funny.
good lucky. -
Run a jar-File and modify a file within this jar-File
I am running the jar-File, which contains my compiled java files etc.
The program has a config part, which is saved in xml file.
This xml file is in the same directory like the class files.
All theses files are zipped as jar-File.
Well, I am running the jar file.
- But how do I open and save the xml file ?
- Is that possible ?
- How difficult ist that ?I tried to do this some time ago and found out the hard way that you can't, just as DrClap just told you. I would have taken his work for it anyway, but for what it's worth, I thought I'd mention that you're not alone. In my case I wanted to be cute and keep my properties all together within the .jar; thought it'd be cleaner that way. Ended up just creating the more typical class_name-props file in my home directory. Is this what you had in mind?
~Bill -
How to access local data file in running applet?
An applet resides in a remote website. However, when I use this homepage and this applet try to load data file in my computer, an error occurs. In console panel, an error for java.security.AccessController.doPrivileged (native method) occurred. Pls tell me the solution for this problem. Thanks!
Use a [signed applet|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html] or
update the [java policy|http://java.sun.com/j2se/1.4.2/docs/guide/security/PolicyFiles.html] on the target PC. -
Accessing Files within a jar - Problems.
So i have the following code in my program and when i goto run the jar file i get NPE's:
URL fileURL = getClass().getResource("resources/cfg/portlist");
BufferedReader portFileBuff = new BufferedReader(new InputStreamReader(fileURL.openStream()));Now my jar file has resources/cfg/portlist in it and i cannot figure out why this isnt working for me when it works just fine in another program i have. I feel im missing out on some framing issue. Any Suggestions?Hello,
I have the same problem when trying to log "log4j" from a jar....
Here is my code that generate the error:
static{
DOMConfigurator.configure("config"+File.separator+"log4j.xml");
Obviously, the file log4j is in my jar in the directory config.
This code works well outside the jar.
It semms that I got also the same problem on library that are in my jar under the directory "lib"....
Any idea..? -
Ok I need a quick lesson on accessing various tags in a xml
file and displaying them. I have a rather messy xml file that
dynamically created and the structure cannot be changed due to an
Excel application that is already accessing it.
Here's the xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Files>
<active>
<record>
<sendto>Joe D</sendto>
<head>
<level1>
<submited>true</submited>
<name>MIKE B</name>
<str>1</str>
<date>7/18/2006</date>
<notes>get this loaded!!!!!!!!!!!!!!!!!</notes>
</level1>
<level2>
<submited>false</submited>
<name></name>
<str></str>
<date></date>
<notes></notes>
</level2>
<level3>
<submited>false</submited>
<name></name>
<str></str>
<date></date>
<notes></notes>
</level3>
<level4>
<submited>false</submited>
<name></name>
<str></str>
<date></date>
<notes></notes>
</level4>
</head>
<itemcd>1234567</itemcd>
<desc>TEST</desc>
<retail>5</retail>
<aisle>AA01</aisle>
<replcst>2</replcst>
<pack>1</pack>
<upc>123456789999</upc>
<vendor>EMRYW</vendor>
<venditemcd>1234567</venditemcd>
<grp>2</grp>
<sec></sec>
<insaft></insaft>
<sellum default="each"></sellum>
<fracu default="i"></fracu>
<decp default="0"></decp>
<allowfr default=" "></allowfr>
<prium default="each"></prium>
<selluf default="1.00000"></selluf>
<priscal default="1"></priscal>
<stockum default="each"></stockum>
<itemstyp default="0"></itemstyp>
<traqoh default="y"></traqoh>
<rcvum default="each"></rcvum>
<rcvuf default="1.00000"></rcvuf>
<rcvscal default="1"></rcvscal>
<shipum default="each"></shipum>
<shipuf default="1.00000"></shipuf>
<stockingstr>
<str1>true</str1>
<str2>false</str2>
<str3>false</str3>
</stockingstr>
<pricematlev default="0"></pricematlev>
<qbreaktable default="0"></qbreaktable>
<taxflg default="y"></taxflg>
<gstcd default="0"></gstcd>
<tradedisf default="n"></tradedisf>
<promptpayf default="y"></promptpayf>
<commflg default="y"></commflg>
<additdescf default="n"></additdescf>
<talleyitemf default="n"></talleyitemf>
<nonstkitem default="n"></nonstkitem>
<assemblyitemf default="n"></assemblyitemf>
<assemblyitemtype
default="0"></assemblyitemtype>
<assemblyledtm default="0"></assemblyledtm>
<assemblywrkuts default="n/a"></assemblywrkuts>
<billmattyp default="0"></billmattyp>
<serialnumf default="n"></serialnumf>
<bascomitemf default="n"></bascomitemf>
<bascomitemcd></bascomitemcd>
<lotctrlf default="n"></lotctrlf>
<lotctrlnum default="0"></lotctrlnum>
<relitemmsgnum default="0"></relitemmsgnum>
<hazmatnum default="0"></hazmatnum>
<strydf default="s"></strydf>
<keyitemf default="n"></keyitemf>
<ctrlitemf default="n"></ctrlitemf>
<talleyindiv></talleyindiv>
<textfld2></textfld2>
<numfld1 default="0"></numfld1>
<numfld2 default="0"></numfld2>
<glacctcd default=""></glacctcd>
<stkitemrptf default="y"></stkitemrptf>
<lifopolnum default="0"></lifopolnum>
<lifosampf default="n"></lifosampf>
<pricetabname default=""></pricetabname>
<invcstperc default="0.00">
<str1></str1>
<str2></str2>
<str3></str3>
</invcstperc>
<invcritfac
default="0.00"><str1></str1><str2></str2><str3></str3></invcritfac>
<invglnum
default="0"><str1></str1><str2></str2><str3></str3></invglnum>
<invlngrngfac
default="0.00"><str1></str1><str2></str2><str3></str3></invlngrngfac>
<invminq default="1">
<str1></str1>
<str2></str2>
<str3></str3>
</invminq>
<invmaxq default="2">
<str1></str1>
<str2></str2>
<str3></str3>
</invmaxq>
<minmaxtab default="DO_NOT_ORDER">
<str1></str1>
<str2></str2>
<str3></str3>
</minmaxtab>
<invmingpperc default="49">
<str1></str1>
<str2></str2>
<str3></str3>
</invmingpperc>
<invordq
default="0"><str1></str1><str2></str2><str3></str3></invordq>
<price1><str1></str1><str2></str2><str3></str3></price1>
<price2><str1></str1><str2></str2><str3></str3></price2>
<price3><str1></str1><str2></str2><str3></str3></price3>
<price4><str1></str1><str2></str2><str3></str3></price4>
<price5><str1></str1><str2></str2><str3></str3></price5>
<price6><str1></str1><str2></str2><str3></str3></price6>
<price7><str1></str1><str2></str2><str3></str3></price7>
<price8><str1></str1><str2></str2><str3></str3></price8>
<aisle default="XXXXX">
<str1>AA01</str1>
<str2></str2>
<str3></str3>
</aisle>
<bin><str1></str1><str2></str2><str3></str3></bin>
<shelf><str1></str1><str2></str2><str3></str3></shelf>
<invstdcst><str1></str1><str2></str2><str3></str3></invstdcst>
<manminmax><str1></str1><str2></str2><str3></str3></manminmax>
<text2><str1></str1><str2></str2><str3></str3></text2>
<numer1><str1></str1><str2></str2><str3></str3></numer1>
<numer2><str1></str1><str2></str2><str3></str3></numer2>
<keyword default=""></keyword>
<note default="">get this
loaded!!!!!!!!!!!!!!!!!</note>
</record>
</active>
</Files>
Here's the code I have so far:
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="
http://www.adobe.com/2006/mxml"
layout="absolute" xmlns:local="*">
<XML id="feedData" source="index.xml"/>
<DataGrid dataProvider="{feedData..active.record}"
x="324" y="138" width="500">
<columns>
<DataGridColumn id="SubmittedBy" headerText="Submitted
By" dataField=""/>
<DataGridColumn headerText="Item" dataField="itemcd"/>
<DataGridColumn headerText="Description"
dataField="desc"/>
</columns>
</DataGrid>
</Application>
What I want to know is how to access and put into the "
Submitted By" column
<Files><active><record><head><level1><name>
Any help would be great since I'm stuck.After a little digging and a couple cups of coffee, I managed
to pull some data extracting from xml into a datagrid. I can access
attributes, node values, etc...
One thing I did notice, is that you have to refresh the
application if you have dynamic data constantly being updated. So
here is some code to help some of you out:
First some sample XML (index.xml):
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<records>
<active name="John" id="1234" location="New York">
<job>Architect</job>
<address>111 Salisbury Rd</address>
</active>
<inactive name="Chris" id="5432" location="California">
<job>Web Designer</job>
<address>888 Orchard Rd</address>
</inactive>
</records>
Code with two tabs one name (
Active), other named (
Inactive):
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" xmlns:local="*" pageTitle="Test App"
creationComplete="srv.send()">
<mx:HTTPService id="srv" url="
http://www.domain.com/index.xml?rand=math.random();"
resultFormat="e4x" useProxy="false" showBusyCursor="true" />
<mx:XMLListCollection id="xActive"
source="{srv.lastResult.active}" />
<mx:XMLListCollection id="xInActive"
source="{srv.lastResult.inactive}" />
<mx:script>
<[[
private function RefreshData():void{
xActive.refresh();
xInActive.refresh();
]]>
</mx:Script>
<mx:TabNavigator>
<mx:Canvas label="Active" width="100%" height="100%"
id="canvas1" initialize="RefreshData();">
<mx:DataGrid id="activeData" dataProvider="{xActive}"
selectedIndex="0" editable="true" enabled="true">
<mx:columns>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="@name" headerText="Name"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="@id" headerText="ID"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="@location" headerText="Location"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="job" headerText="Job"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="address" headerText="Address"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
<mx:Canvas label="Inactive" width="100%" height="100%"
id="canvas2" initialize="RefreshData();">
<mx:DataGrid id="inactiveData" dataProvider="{xInActive}"
selectedIndex="0" editable="true" enabled="true">
<mx:columns>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="@name" headerText="Name"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="@id" headerText="ID"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="@location" headerText="Location"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="job" headerText="Job"/>
<mx:DataGridColumn textAlign="center" resizable="false"
dataField="address" headerText="Address"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
</mx:TabNavigator>
</mx:Application> -
Access to a file in a jar archive
Hello.
I hava a Bean in a jar file. The Bean shoul read a file
which is is also in the sama archive. The location of the jar file is unknow.
How can the Bean read the file.
With friendly regards
tomI (now) know about images in jars...
//usage: loadIcon("icons/Open16.gif")
public ImageIcon loadIcon( String location ){
URL img = null;
try {
img = ClassLoader.getSystemResource(location);
}catch (Exception e){
e.printStackTrace();
return new ImageIcon(img);
}Make sure that the location that you use is case sensitive and the seperator is "/".
In the usage above, the image is in a dedicated "icons" folder in the jar. -
Problem opening a zip file within a jar file
Hi,
I have a jar file in a tomcat web server. The jar file includes a zip file which I've been trying to open with the following sentences:
SpellDictionary dict = null;
File f = new File(getClass().getResource*("us_US.zip"*).getFile());
dict = new OpenOfficeSpellDictionary( new ZipFile( f ) );
I'm getting this exception:
2007-09-13 15:31:38 java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:203)
at java.util.zip.ZipFile.<init>(ZipFile.java:84)
at com.iir.newsAdministration.textEditor.TextEditorSpellChecker.<init>(TextEditorSpellChecker.java:62)
If I run the application with the builded classes instead of the jar file, it works fine.
Any ideas about how can I make it work with the jar file?
Thanks in advance
NatalieFile f = new File(getClass().getResource*("us_US.zip"*).getFile());
This is not going to work.
What you need to do is create a Jar/ZipFile from your jar, then extract the ZipFile, put that in a temporary location, then open that with another ZipFile object -
SchemaLocation for a XSD file within a JAR
Hello,
What kind of shemaLocation should I use in my XML files to reference XSD files located in a JAR so that JDeveloper find it and thus enable code assist feature?
Note: The JAR in question is in the project library (not necessarily in WEB-INF/lib at the time of development)
Regards,
Simon Lessardhi Simon Lessard
If you select "Tools" > "Preferences..." > "XML Schemas", using JDeveloper 10.1.3.2, several "JDeveloper Schemas for XML Editing" have been defined, some inside JAR or ZIP files.
For example for the ".wsdl" extension like this:
jar:file:/D:/oracle/jdevstudio10132/jdev/lib/jdev.jar!/oracle/jdevimpl/webservices/wsdl/wsdl.xsd
Maybe you can define something similar in "User Schemas for XML Editing" in the same dialog.
Is this what you are looking for?
success
Jan Vervecken -
Ora-12705 can not access nls data files or invalid environment specified
platform: win2000,
dev tool: VC++2003
the client machine:only install oracle instant client and XDK
env variable:
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
ORA_NLS10=%XDK_HOME%/nls/data
the exception was thrown out when open oracle connection:
env->createConnection (user, password, service);
I will appreciate if anyone can tell me what was going on
RegardI recently encountered this error (12705 with same text) after installing, de-installing and again installing the Oracle 10.2.01 client. The initial install saved to a path ending in ... /Client1, but hung on the last screen (due to a conflict in my response to a prompt from Semantic to allow "javaw" to run). The second install saved to a path ending in .../Client2.
The error was resolved by removing the path for .../Client1 in the "Path" Environment Variable. -
ORA-12705: Cannot access NLS data files or invalid enviroment specified
Hi, I am using Oracle 11g R2 and using the client Navicat.
I can connect through command promt and SqlPlus absolutely fine but when I try to connect with Navicat, it wont allow me to and gives me the error in the topic. I have changed the NLS_LANG to NLS_LANG1 and double checked the ORACLE_HOME which is fine. Im not sure on how to connect with Navicat so could someone try and assist me on getting this to work?
Thanks in advance.939711 wrote:
Hi, I am using Oracle 11g R2 and using the client Navicat.
I can connect through command promt and SqlPlus absolutely fine but when I try to connect with Navicat, it wont allow me to and gives me the error in the topic. I have changed the NLS_LANG to NLS_LANG1 and double checked the ORACLE_HOME which is fine. Im not sure on how to connect with Navicat so could someone try and assist me on getting this to work?
Thanks in advance.
PLEASE stop spamming this forum with issues about non-Oracle products!
Consider to bother the actual support folks from Navicat.
http://www.navicat.com/en/support/live.html
Maybe you are looking for
-
Playing specific sounds on a slide
I'm new to Keynote 08, but familiar with PowerPoint where I can insert sounds (mainly language samples) on a slide and play each one manually by clicking on its icon. This is important if audience members ask to hear one sound again, or hear it compa
-
Toggle button (play/pause) problem when using smart shape
Hi, I am utilizing smart shape as button. I have one play button, and pause button, on top of each other. When "play" is clicked then I display "pause" button, and hide "play" button. Vice versa for pause button. And, I set the buttons to be displaye
-
Adobe change my Creative Cloud to Trial version
Hi, I paid my Creative Cloud monthly fees for the first time then Adobe send me email that there is a problem to get money for the second month .. so they change my CC as trial .So, what can i do ? , I have't any problem with my visa . Now , what abo
-
ERP install - Solution Manager Key
Dear all, We want to have one test system up and running but we are not interested in installing the solution manager. Can someone generate the solution manager key for us? System ID = IDS Central Instance Host = HPA Central Instance Number = 00 Than
-
HT201401 Few digits of my iphone 4S key board are not responding. kindly advise.
Few digits of my iphone 4S key board are not responding. kindly advise.