473,799 Members | 3,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using dll and .conf files in java web application

5 New Member
Hi all,

I am using netbeans as IDE and glassfish as app server for my web application.
At runtime it needs some dll files and .conf file. Now the question is:
1. How should I package the .conf file into my web application war file. The scenario is that one .conf file makes use of another. e.g. if one file is a.conf and another is b.conf then the path of b.con is specified in a.conf as absolute path. How I have to change this path in case I will bundle it in my war file.
2. How can i configure app server or netbeans so that the dll files will be available at runtime to the application.

This is really urgent as I am stuck on it.

Thanks
Gaurav
Apr 6 '09 #1
3 5727
chaarmann
785 Recognized Expert Contributor
1.) don't hardcode any absolute path! You can always get the current directory where your application started. In your case you can get the directory where you deployed the war-file with
Expand|Select|Wrap|Line Numbers
  1. servletContext.getRealPath("/").
If you use relative path only then referencing to one file inside another is no problem. For example I use an entry in web.xml to reference to an .xsl file I need for transformation:
Expand|Select|Wrap|Line Numbers
  1.     ServletContext servletContext = request.getSession().getServletContext();
  2.     String xslFile= servletContext.getInitParameter("xslFile"); // e.g. "/xslFiles/myFile.xsl"
  3.     String xslFilePath = servletContext.getRealPath(xslFile) ; // e.g. "C:/Tomcat/webapps/ROOT/myApp/WEB-INF/xslFiles/myFile.xsl
2.) don't use *.dll files. Just get the corresponding *.jar file. Dll-files are platform dependent and only run on Microsoft Windows. If you access functions in dll-files through native calls in java (or whatever you do with the dll-files, I am really wondering about that), you need to provide the corresponding files for EVERY platform. For example corresponding *.so files for Linux, Mac-OS, AIX, HP-UX, Solaris and others. For each of these platforms, you need to provide your own platform-dependent installer. (For example InstallShield on Windows that copies your dll-files into the win32-directory). That's a lot of work and possibly not a good idea, so avoid *.dlls and use *.jar files instead, which can be easily deployed, no matter what operating system you are using. (Just put them into lib-directory or add them to your classpath)
Apr 7 '09 #2
gjain123
5 New Member
Hi chaarmann,

Thanks for the reply.

Suppose I put my A.conf file under WEB-INF/classes/config folder which refers to B.conf file in the same folder should I change the path to B.conf as /config/B.conf.

Regarding dll files, these are some tool specific files that needs to be used and these are to be used only on Windows platform so can you please tell me where should I put it in my web application so that these are available to my application at runtime.

Thanks
Gaurav
Apr 7 '09 #3
chaarmann
785 Recognized Expert Contributor
@gjain123
That could work. But most likely it's "classes/config/B.conf". (see comments in my code example above).
To make sure just print out the path you get (system.out.pri ntln(servletCon text.getRealPat h("/")), it should be "WEB-INF/classes" in your case, then you know what to append to it.

@gjain123
See above, I already suggested to use something like InstallShield, so users can easily deinstall.
But if it's only for yourself, just copy the dlls into the directory "system32" inside your windows-directory, where all the other dlls are.
Apr 7 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
11869
by: Phil Powell | last post by:
In /etc/httpd/conf.d/php.conf there is a line that limits the size of $_REQUEST to a byte size that, when shipped with PHP, comes to approx 524K, however, that amount can be changed. How can you use PHP to determine the size of LimitRequestBody in advance? I need that for my application as the user will need to know the absolute limit of what they can upload at one time via PHP. Thanx Phil
0
6272
by: mdh | last post by:
I am trying to learn the basics of MVC applications using a Tomcat infrastructure. I'm starting by building a simple application with: * a login.jsp page for a basic login form with a action pointing to "loginValidate.jsp" * a loginValidate.jsp page that references logic to validate requests * a loginBean class used to pass info between the JSP and validation logic * a usersDAO class used to perform lookups in a USERS
1
15849
by: Oliver Hoehle | last post by:
Hello! I tried to get my J2EE app working with DB2 for several days and now it seems to work, but... (Tomcat 5.0.19 on NT 4.0 with J2SDK 1.4.1_02) 1) Declaring the DB2-datasource in $CATALINA_HOME/conf/server.xml did not work. All I got was a message like "Cannot create JDBC driver of class '' for connect URL 'null', cause: null"
0
2150
by: atlantis | last post by:
Hi, I have a very strange problem with xsl:import when usig RELATIVE path on AIX 5.2 server. I have two XSL files in the same directory: "ists_xslt3.xsl" and "ists_xslt3_layout.xsl". This is what the beginning of "ists_xslt3.xsl" looks like:
1
2540
by: brahatha | last post by:
I am trying to come up with a Java code where I can read a xml file and extract particular element/attribute. This is the structure of xml I have <RootElement> <colAttempt> <Attempt1 a="1" b="abc> <ResultElement Result = "123" Msg="success"> <nodeList> <NodeIwant nodeName="conf" noFail="1">
8
28607
by: ajos | last post by:
hi frnds, im trying to convert my servlets database configuration from ms access to mysql database.however im getting some error like no driver found exception. to verify this error ive made a simple database in jsp(just to check if my mysql is working smoothly otherwise) which access' the username.....but in the process im getting a error--> java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) i have...
5
2932
by: bmm | last post by:
I have a Store Procedure on a Sql Server 2000 Where I use the Table Hint "NoLock" on all selects. One of my clients (OleDbConnection from C#) doesn't get the same Result Set as the others. The result Set should have 31 rows but this client only gets 5! When I remove all the "NoLocks" everything works fine. How can that be?
0
2044
by: choukse | last post by:
Hi All, I am trying to bind to ADAM instance with a windows user through JNDI and it keeps failing. My ADAM and AD is running on same Windows 2k3 server. But, through LDP I am able to bind with the same windows user successfully and browse through the entire tree successfully. The error is as below
0
1497
by: =?Utf-8?B?QWxleA==?= | last post by:
Hi to everyone At the moment, I am converting a .Net 1.1 application to 2.0. As the My.settings did not exist in the 1.1 framework, the "101 VB.NET Sample" "How to configuration settings" was used. At the moment, the App.exe.conf is stored under "Program Files\MyApp". As read/write access is needed to the Application configuration file, I have to change the current approach to get the application running under Windows Vista.
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.