Base URL Differences between eclipse and tomcat

Hello friends. I'm sure that I am missing something basic, so please forgive my ignorance.
I have several classes that work fine when run through main calls / test scripts in Eclipse. However, when I deploy the application to Tomcat, I see strange behavior in regards to interactions with files on the operating system.
My logging component (log4j) wants to spit log files out to Tomcat 5.5/bin instead of to the base project directory in Eclipse. I guess I would have expected the logger to write out to webapps/myApplcationName.
When loading other files from the OS (castor mapping files) I get a FileNotFoundException when I run the process in Tomcat. In this case, it would seem that it wants to load directly from c:\, again instead of from webapps/myApplicationName/whateverFolder.
Is there any chance this is a classloader based issue?
Can anyone help? Thanks
-cm

It is probably a 'working directory' issue. If you don't specify a directory to work with, most of the time Java will start from the directory that the app was launched from.
Since Tomcat would be launched via a batch or exe in the Tomcat/bin directory, then that is where you start from there. But Eclipse sets the project directory as the working directory for input/output....
Anyway, to get around it you should make sure you are getting files from/in the servlet context:
For example, using:
getServletContext().getRealPath(...);
I would presume that Log4J has its own mechanism for defining paths for the log files. I am not particularly sure how, but you could here for more details:
<http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html>

Similar Messages

  • Differences between Eclipse and Oracle JDeveloper

    Hi,
    Could any one please provide me a list of advantages/dis-advantages and differences between Eclipse 3.1 & Oracle JDeveloper 10g (any version). It's very imp and urgent!!!
    Thanks!

    Hi,
    Could any one please provide me a list of advantages/dis-advantages and differences between Eclipse 3.1 & Oracle JDeveloper 10g (any version). It's very imp and urgent!!!
    Thanks!

  • Difference between Eclipse and Apache Tomcat?

    Can anyone let me know difference between these two? or give me a website link where i can find comparison of the two?I want to work on JAVA+Web services, so what is best bet for me to work with?

    eat your pizza then getinto car.or get into car ,
    reach the moon and then eat your pizza there.you see
    both are usefull somehow.well i asked as i dint know
    much about this stuff, so instead of making fun you
    could have helped me a bit. no?MAybe you could have just taken the sarcasm as what it was and yould have tried to find out what to use Eclipse and what to use Tomcat for... if you can't tell the terms "deleopment environment" and "servlet container" apart, writing servlets might still be too big a task for your present state of knowledge.

  • Difference between urn and url

    what's the difference between urn and url?

    <b>What is an URL</b>
    An Uniform Resource Locator (URL) is the term used to identify an Internet resource, and can be specified in a single line of text.
    <b>What is an URN</b>
    An Uniform Resource Name (URN) is the term used to identify an Internet resource, without the use of a scheme, and can be specified in a single line of text.
    <b>What is an URI</b>
    An Uniform Resource Identifier (URI) is used by a browser to identify a single document, and it too can be specified in a single line of text
    <b>The general form of an URL has four parts</b>
    A scheme followed by a colon.
    Invokes a TCP/IP-based application level protocol
    Schemes are: http, https, ftp, news, mailto, file, telnet.
    <b>A server name.</b>
    A // followed by the host name or IP address of the server
    Not needed if the server is the default
    news server
    mail server
    <b>An optional port number. Standard or default port numbers are:</b>
    ftp *
    ssh 22
    telnet 23
    smtp 25
    gopher 70
    http 80
    nntp 119
    SSL 443
    <b>A path.</b>
    Consisting of folders and/or files.
    May include a file extension which identifies the type of document.
    May also include a QUERY_STRING with arguments.
    Ftp uses port 20 for data and port 21 for flow control.
    <b>DIFFERENCE BETWEEN URN & URI</b>
    The idea is that a URL is a mechanical link to a resource's location, where it can be downloaded. For this reason, a URL contains a hostname and a local part, all of which can be resolved anywhere on the Internet.
    What a URN tries to do is different. It tries to give a description of a resource without actually pointing at it. For example:
    urn:isbn:90-365-17273
    <b>URI:</b> is a string that identifies any resource. Indentifying the resource does not necessarily mean we can retrieve it. URI is a superset of URL and URN.
    files/reports/marketing/report.html
    <b>URL:</b> URI that specify a common Internet protocol such as HTTP or FTP are also called URLs. URL is an informal term an is not used in technical specifications.
    http://www.foo.com/files/reports/marketing/report.html
    <b>URN:</b> A URN is an identifier the uniquely indentifies a resource but does not specify how to access that resource.
    ISBN: 1-930110-59-6
    I hope it helps
    Best Regards

  • Difference between GET and URL Rewriting in Servlets

    What is the difference between GET and URL Rewriting in Servlets?.Please illustrate with an example.

    Thanks for your reply gimbal.
    GET appends query string at the end of the URL. URL rewriting also does the same thing. It also appends query string right?. Then what is the difference between two. I have this question in my mind for long time.To my surprise an interviewer asked this question in an interview also.

  • Difference between sendRedirect and RequestDispatcher?

    Difference between sendRedirect and RequestDispatcher?

    I have a situation of needing to redirect a request to a URL that is outside of the container. The scenario is the following, we have a simple logging in servlet that takes some POST parameters (username, password, and other values.) Depending on the username and password, the logon request along with all its POST parameters need to be redirected integrally to another machine. How do i do a redirect with all my parameters intact? sendRedirect does not seem to have any (visible to me) mechanism to do this. We cannot send them on the URL as this will reveal things too easily to our users and we don't want them to bookmark the resulting page.
    Thanks for any help,
    t

  • Difference between forward and redirect

    difference between forward and send redirect

    + a Redirect will change the URL in the browser, whereas a forward will not.
    + a Redirect can be any URL, whereas a forward has to be directed to a resource within the container,
    + a Redirect MUST be an absolute URL (though the Servlet functions will do this for you).
    + a Redirect, being a new request, triggers filters, whereas a forward does not.

  • Problem launching a jsp page with eclipse and tomcat

    Hi,
    I have just started using eclipse and tomcat for creating dynamic web pages. I tried to launch a jsp page after starting the tomcat server with the URL: http://locahost:8080/HelloWorld/, an error page was displayed as below:
    HTTP Status 404 -/
    type Status report
    message /_
    description The requested resource (-) is not available
    Apache Tomcat/5.5.17
    I didn't get any error at the console and when i just typed http://localhost, a pop up menu saying that the connection was refused when attempting to contact localhost.
    I'm not sure what is the problem here. Could it be the permssion to the localhost is not granted by the system as the eclipse IDE is running using linux?
    Hope someone can help.
    Thanks.

    http://www-128.ibm.com/developerworks/library/os-ectom/

  • Credit Management: Difference Between Static and Dynamic Credit Check

    Hi,
    Could anyone tell the difference Between Static and Dynamic Credit Check?
    According to website: http://www.sap-basis-abap.com/sd/difference-between-static-and-dynamic-credit-check.htm ... this is the answer:
    ====================
    Simple Credit Check : Tr.Code - FD32
    It Considers the Doc.Value + Open Items.
    Doc.Value : Sales Order Has been saved but not delivered
    Open Item : Sales Order has been saved , Delivered, Billed & Transfered to FI, but not received the payment from the customer.
    Static Credit Check it checks all these doc value & check with the credit limit
    1) Open Doc.Value / Sales Order Value : Which is save but not delievered
    2) Open Delivery Doc.Value : Which is delivered but not billed
    3) Open Billing Doc.Value : Which is billed but not posted to FI
    4) Open Item : Which is transfered to FI but not received from the customer.
    Dynamic Credit Check         1) Open Doc
                                                2) Open Delivery
                                                3) Open Billing
                                                4) Open Items
                                                5) Horizon Period = Eg.3Months
    Here the System will not consider the above 1, 2, 3 & 4 values for the lost 3 months.    
    ====================
    Question 1: Could you further explain the above information, if there is any?
    Question 2:: What is the Tcode to customize settings of:
    a) Simple Credit Check (isn't this same with b) below?)
    b) Static Credit Check
    c) Dynamic Credit Check

    Hi Tanish,
    Diff between Static and Dynamic Filters.
    Example One at report Level.
    Create a variable for a Infoobject say ,Material .
    1)In the Query Designer and if u restrict it to some 10 materials at query level, the report will display for only those 10 materials only.This is Static Filter.UR AHrdcoding it to those materials.You cant change them at Query Run time.i.e not changeable by user.
    2)If u give the variable as input ,and when u run the query ,u can can choose the material,may 10 may be 1 or may 20 .It is dynamic.Changeable by user at run time
    Example Two at DTP and Start Routine Level,say Document Type.
    1)If u give filters in Start routine it is Static as u cannot change it in Production,not changeable by user.
    2)f u give filters in DTP it is Dyanamic as u can change it in Production.U can give any doc type,Changeable by user at run time.
    Hope it is Understood.
    Rgds
    SVU

  • Difference between mtl_system_items and mtl_system_items_b

    Hi All,
    Can anyone tell me the difference between mtl_system_items and mtl_system_items_b ?
    Regards,
    Shruti

    mtl_system_items is a synonym that points to mtl_system_items_b
    mtl_system_items used to be the actual items table in older versions.
    But in recent version the mtl_system_items_b is the items table. If any old code was using mtl_system_items, the synonym helps it compile and thus make this change backward compatible.
    Oracle follows the following convention to handle multi-language.
    The b stands for base table. And then there is a table called tl (e.g. mtlsystem_items_tl). In the _tl table, for each base record, you can find multiple records - one for each language that you use.
    Hope this answers your question,
    Sandeep Gandhi

  • Difference between VAT AND EXCISE DUTIES

    HI ginius
    can any body give the difference between vat and excise duties

    VAT  is value added tax.  a tax levied by the government at the time of sales earlier it was LST ( local sales tax ) this is livied by the state goverments.
    ok...example  .like if colgae is manufacturing toothpaste and yu are buying it ... so at the time of buying ap[art from the price of material you are payin the vat also.
    but wher as excise duty is concerend it is levied by the central excise departments
    it is lived on colgate company after it manufactured the product even before selling the toothpaste colgate should pay excise to central excise dept on toothpaste becasue it manufactured it in india ( ofcourse it again collects frm the customer by hiking price )
    and excise is calulate don advolrem basis whcih is approx 16% on base price.

  • Difference between BBP_GET_STATUS_2 and CLEAN_REQREQ_UP reports

    Could someone explain in simple way what is the difference between BBP_GET_STATUS_2 and CLEAN_REQREQ_UP reports? I have read the differences in standard documentation but it is a little confusing.
    Thanks!
    Regards,
    Madhur

    Hi
    CLEAN_REQREQ_UP (Cleaner Job)
    You can use this function for document types Shopping cart, (Local) Purchase Order, Confirmation, and Invoice to trigger a synchronization with the associated documents in the back-end system. The system checks whether and how the (follow-on) documents were posted in the back end, and updates the object link and references, as well as the document status.
    A job (background processing) is generated for the program CLEAN_REQREQ_UP. When this is run, the system queries a database table containing the transfer information of the documents to the back end. The entries are checked with the data of the respective back-end systems. If the back-end transfer is successful, the respective entries are deleted and the prerequisites for further processing are created.
    BBP_GET_STATUS2 (Status Job)
    The status job was created by SAP to update the EBP system with data such as purchase requisition number, purchase order number, goods received or invoices recorded manually in R/3, etc. The report should not be run on a frequent basis at short intervals unless the order count from EBP to R/3 is not that high. Otherwise, a recommended interval for running the report is approximately every hour. Basically the schedule times depend on your business requirements.
    Until this job runs, the user will not see the number of the backend document created in R/3 for a particular shopping cart in the history tab of the check status transaction.
    Some more information :
    Go to:
    SPRO->IMG->Integration with Other SAP components->Advanced Planning and
    Optimization->basic Settings for the Data Transfer->Change Transfer->
    change Transfer for Transaction Data->Active Online Transfer using BTE
    Here you should maintain the application 'SRMNTY' with active flag.
    Once this customizing is enabled, whenever a follow-on document
    (either confirmation or invoice) for an extended classic PO is created
    in the backend R/3 system, the R/3 system communicates to the SRM system
    by creating an entry in the table BBP_DOCUMENT_TAB for this PO.
    The item level of the SRM PO has fields to store the actual quantity
    and values entered for the corresponding confirmations and invoices.
    After that, run the reports CLEAN_REQREQ_UP and BBP_GET_STATUS_2.
    When the report CLEAN_REQREQ_UP runs this will update the
    PO with statistical information. With the latest information in
    BBP_PDIGP table (statistical information) the query should work fine.
    Summer

  • What's the difference between jsp and jsf?

    who can tell me what's the difference between jsp and jsf?
    I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)

    Hi,
    Find the difference between JSP and JSF
    1. A developer has more control with JSP, but (should) get easier development with JSF
    2. Event handling is done differently in JSP (HTTP) and JSF (Java)
    3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
    4. The end product should also be defined differently - JSP page versus a JSF application.
    Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
    All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
    If you are in this vacuum here are some key points promoting JSF:
    1. Fundamental unit is the Component
    2. Built in event and state management
    3. Component sets can be provided by any vendor
    4. Closer to ASP.Net or Swing development
    5. Choice of UI technology
    6. Scale up (rich clients)
    7. Scale down (mobile devices)
    8. Built into J2EE containers in J2EE 5.0 (tentative)

  • What's the Difference Between OLAP and OLTP?

    HI,
    What's the difference between OLAP and OLTP ? and which one is Best?
    -Arun.M.D

    Hi,
       The big difference when designing for OLAP versus OLTP is rooted in the basics of how the tables are going to be used. I'll discuss OLTP versus OLAP in context to the design of dimensional data warehouses. However, keep in mind there are more architectural components that make up a mature, best practices data warehouse than just the dimensional data warehouse.
    Corporate Information Factory, 2nd Edition by W. H. Inmon, Claudia Imhoff, Ryan Sousa
    Building the Data Warehouse, 2nd Edition by W. H. Inmon
    With OLTP, the tables are designed to facilitate fast inserting, updating and deleting rows of information with each logical unit of work. The database design is highly normalized. Usually and at least to 3NF. Each logical unit of work in an online application will have a relatively small scope with regard to the number of tables that are referenced and/or updated. Also the online application itself handles the majority of the work for joining data to facilitate the screen functions. This means the user doesn't have to worry about traversing across large data relationship paths. A heavy dose of lookup/reference tables and much focus on referential integrity between foreign keys. The physical design of the database needs to take into considerations the need for inserting rows when deciding on physical space settings. A good book for getting a solid base understanding of modeling for OLTP is The Data Modeling Handbook: A Best-Practice Approach to Building Quality Data Models by Michael C. Reingruber, William W. Gregory.
    Example: Let's say we have a purchase oder management system. We need to be able to take orders for our customers, and we need to be able to sell many items on each order. We need to capture the store that sold the item, the customer that bought the item (and where we need to ship things and where to bill) and we need to make sure that we pull from the valid store_items to get the correct item number, description and price. Our OLTP data model will contain a CUSTOMER_MASTER, A CUSTOMER_ADDRESS_MASTER, A STORE_MASTER, AN ITEM_MASTER, AN ITEM_PRICE_MASTER, A PURCHASE_ORDER_MASTER AND A PURCHASE_ORDER_LINE_ITEM table. Then we might have a series of M:M relationships for example. An ITEM might have a different price for specific time periods for specific stores.
    With OLAP, the tables are designed to facilitate easy access to information. Today's OLAP tools make the job of developing a query very easy. However, you still want to minimize the extensiveness of the relational model in an OLAP application. Users don't have the wills and means to learn how to work through a complex maze of table relationships. So you'll design your tables with a high degree of denormalization. The most prevalent design scheme for OLAP is the Star-Schema, popularized by Ralph Kimball. The star schema has a FACT table that contains the elements of data that are used arithmatically (counting, summing, averaging, etc.) The FACT Table is surrounded by lookup tables called Dimensions. Each Dimension table provides a reference to those things that you want to analyze by. A good book to understand how to design OLAP solutions is The Data Warehouse Toolkit: Practical Techniques for Building Dimensional Data Warehouses by Ralph Kimball.
    Example: let's say we want to see some key measures about purchases. We want to know how many items and the sales amount that are purchased by what kind of customer across which stores. The FACT table will contain a column for Qty-purchased and Purchase Amount. The DIMENSION tables will include the ITEM_DESC (contains the item_id & Description), the CUSTOMER_TYPE, the STORE (Store_id & store name), and TIME (contains calendar information such as the date, the month_end_date, quarter_end_date, day_of_week, etc).
      Database Fundamentals > Data Warehousing and Business Intelligence with Mike Lampa
    Search Advice from more than 250 TechTarget Experts
    Your question may have already been answered! Browse or search more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.

  • Difference between BAPI and IDocs

    hello all
    what is difference between BAPI and IDocs

    Hi,
    BAPI
    One of the big plusses for BAPIs is that the interface and function are not supposed to change.  This is a big plus when you do upgrades or hot packs because the transaction can change (format, required inputs etc) which means you then need to update the call transaction.
    Some of the BAPIs are better documented and easier to use than others. You usually need to perform the BAPI that actually does the COMMIT after you call your BAPI.
    The Program coding for calling a BAPI is usually cleaner than setting up the screen flow etc for the Call Transaction.
    You don't need to worry about special data circumstances interrupting the normal data flow of the screens and causing errors because of that.
    BAPIs probably have better performance since they don't do the screen flow processing.
    In general if the BAPI exists for the transaction you want to perform and you can figure out how to use it the BAPI is probably the best way to go.
    BAPIs are a subset of the RFC-enabled function modules, especially designed as Application Programming Interface (API) to the SAP business object, or in other words: are function modules officially released by SAP to be called from external programs.
    IDOC
    IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign system. Instead of calling a program in the destination system directly, the data is first packed into an IDoc and then sent to the receiving system, where it is analyzed and properly processed.   Therefore an IDoc data exchange is always an
    asynchronous process. The significant difference between simple RFC-calls and IDoc data exchange is the fact, that every action performed on IDocs are protocolled by R/3 and IDocs can be reprocessed if an error occurred in one of the message steps.
    While IDocs have to be understood as a data exchange protocol, EDI and ALE are typical use cases for IDocs. R/3 uses IDocs for both EDI and ALE to deliver data to the receiving system. ALE is basically the scheduling mechanism that defines when and between which partners and what kind of data will be exchanged on a regular or event triggered basis. Such a set-up is called an ALE-scenario.
    The philosophical difference between EDI and ALE can be pinned as follows: If we send data to an external partner, we generally speak of EDI, while ALE is a mechanism to reliable replicate data between trusting systems to store a redundant copy of the IDoc data.   The difference is made clear, when we think of a purchase order that is sent as an IDoc. If we send the purchase order to a supplier then the supplier will store the purchase order as a sales order. However, if we send the purchase order via ALE to another R/3 system, then the receiving system will store the purchase order also as a purchase order.
    Regards,
    Bhaskar

Maybe you are looking for