How to Specify the Log File address as RootDir/Logs/Error.log in Log4j

I have a web application,
How to configure the log4j Rolling file Appender in that.
I want to logs to be redirected to the RootDir/logs/Error.log.
Currently, I m using following configuration:
# This file must live on the classpath of the jvm
# Set root logger level to DEBUG and log to both stdout and rollingFile appenders
# (see below for their definitions)
# The set of possible levels are: DEBUG, INFO, WARN, ERROR and FATAL
log4j.rootLogger=INFO, stdout, R
####### Console appender ######
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
# The pattern: Date Priority (Filename:Line Number) - Message\n
log4j.appender.stdout.layout.ConversionPattern=%d %-5p (%F:%L) - %m%n
#### Second appender writes to a file
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=Error.log
# Control the maximum log file size
log4j.appender.R.MaxFileSize=100KB
# Archive log files (one backup file here)
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p (%F:%L) - %m%n
Thanks for your replies in advance.

Please follow the following steps, will work.
To enable log4j logging to a file on lunar pages do the following:
1) Create a servlet class that will initialize log4j. Here is
the code:
package logging;
import org.apache.log4j.PropertyConfigurator;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Log4jInit extends HttpServlet {
public
void init() {
String prefix = getServletContext().getRealPath("/");
String file = getInitParameter("log4j-init-file");
// if the log4j-init-file is not set, then no point in trying
if(file != null) {
PropertyConfigurator.configure(prefix+file);
public
void doGet(HttpServletRequest req, HttpServletResponse res) {
2) In your web.xml file add the following entry:
<servlet>
<servlet-name>log4j-init</servlet-name>
<servlet-class>logging.Log4jInit</servlet-class>
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>WEB-INF/classes/log4j.lcf</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
3) Create a log4j.lcf file located in your WEB-INF/classes directory
as with the following entries:
log4j.rootLogger=debug, R
# yourdirectory below is where your site lives.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/home/yourdirectory/public_html/logs/out.log
log4j.appender.R.MaxFileSize=500KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p [%c] %m%n
4) Add logging to your class. Here is an example:
import org.apache.log4j.Logger;
public class Example {
static Logger logger = Logger.getLogger(Example.class);
public void doSomething() {
logger.debug("testing logging");
5) make sure you have the log4j-1.2.8.jar file located in your WEB-INF/lib directory.
That should do it!

Similar Messages

  • How to specify the database file path when create FDM application

    Dear All,
    How to specify the database file path (MSSQL) when create FDM application?
    Right now, all data file are placed in the D:\ . I want to specify the database files (log and mdf file) in other place. How to do it?
    Thanks.

    Where is the highS2.xml located on the disk? If you add it to your project you should set its Build Action to Content and its Copy To Output Directory to Always in Visual Studio:
    Please remember to close your threads by marking helpful posts as answer once your issue has been solved and then start a new thread if you have a new question.

  • Jaas How to specify the config file

    Hi
    I'm working on a web app based on Sun's App Server 8. I am implementing security using a Jaas LoginModule. I cant figure out how i can specify the config file because if i make the change in the java.security file the server throws all sorts of exceptions....... i'm not sure how i can go about that..
    Thanks..

    Read the documentation. There are several different files that you can use to specifiy the handler to use for a particular context. One is ${user.home}/.java.login.config

  • How to specify the download file name??

    Hi guys~~~
    I have servlet which can generate a *.pdf file,I found if I didn't setContentType="application/pdf",I can download it!!But the download file name is my servlet file name.If I want to change the download file name,How do I do????
    thanx a lot!!!Best regard!

    Thanx for ur help...But I encounter a new charllenge now...
    I use a javascript(window.open("/myservlet")) to open the download file servlet.
    Everything is okay.But when I finish downloading the file which window I opened cant close itself automatically.
    I am really not understand the header parameter of the HTML header,could someone give me something about this??
    Thanx again!!!!

  • How to disable the XML file produced under SYSMAN/RECV/ERRORS folder of EM?

    Under $ORACLE_HOME/sysman directory where 10G Grid Control management server installed there is a SYSMAN/RECV/ERRORS subdirectory that contains files that were uploaded by the agents but could not be processed by the management server;
    [root@tcellhost errors]# pwd
    /u01/app/oracle/oracle/product/10.2.0/db_1/tcellhost.tcelldomain_tcell/sysman/recv/errors
    [root@tcellhost errors]# ls
    B0000000001.err_2007_02_22_15_14_59 B0000000001.err_2007_03_15_22_01_53 B0000000003.err_2007_02_23_21_16_21
    B0000000001.err_2007_02_23_11_01_00 B0000000002.err_2007_02_22_15_14_59 B0000000003.err_2007_02_23_21_19_21
    B0000000001.err_2007_02_23_21_15_23 B0000000002.err_2007_02_23_21_15_23 B0000000003.err_2007_02_23_21_19_44
    B0000000001.err_2007_02_23_21_16_21 B0000000002.err_2007_02_23_21_16_21 B0000000003.err_2007_02_23_21_25_18
    B0000000001.err_2007_02_23_21_19_21 B0000000002.err_2007_02_23_21_19_21 B0000000003.err_2007_02_23_21_28_59
    B0000000001.err_2007_02_23_21_19_44 B0000000002.err_2007_02_23_21_19_44 B0000000003.err_2007_02_23_21_29_17
    B0000000001.err_2007_02_23_21_20_22 B0000000002.err_2007_02_23_21_25_18 B0000000003.err_2007_02_24_22_55_59
    B0000000001.err_2007_02_23_21_25_18 B0000000002.err_2007_02_23_21_28_59 B0000000003.err_2007_03_05_08_07_30
    B0000000001.err_2007_02_23_21_28_59 B0000000002.err_2007_02_23_21_29_16 B0000000003.err_2007_03_05_08_22_44
    B0000000001.err_2007_02_23_21_29_15 B0000000002.err_2007_02_24_22_55_59 B0000000003.err_2007_03_05_08_22_57
    B0000000001.err_2007_02_24_00_06_39 B0000000002.err_2007_03_05_08_07_30 B0000000004.err_2007_02_24_22_56_26
    B0000000001.err_2007_02_24_22_55_59 B0000000002.err_2007_03_05_08_22_44 B0000000005.err_2007_02_24_22_56_26
    B0000000001.err_2007_03_05_08_07_30 B0000000002.err_2007_03_05_08_22_57 B0000000006.err_2007_02_24_22_56_27
    B0000000001.err_2007_03_05_08_22_44 B0000000003.err_2007_02_22_15_14_59
    B0000000001.err_2007_03_05_08_22_57 B0000000003.err_2007_02_23_21_15_23
    [root@tcellhost errors]# more B0000000001.err_2007_03_15_22_01_53
    <!--
    Time: 2007-03-15 22:01:51
    From: http://tcellhost.tcelldomain:3938/emd/main
    -->
    <UPLOAD OMS_PROTOCOL_VERSION="10.1.0.2.0" UPLOAD_TYPE="severity" EMD_URL="http://tcellhost.tcelldomain:3938/emd/main" MERGE_TIMEST
    AMP="2007-03-15 22:01:51">
    <ROWSET OMS_PROTOCOL_VERSION="10.1.0.2.0" TABLE="MGMT_SEVERITY">
    <ROW>
    <TARGET_GUID>F580A92FBEDDFE7A5754D45B3CB71375</TARGET_GUID>
    <METRIC_GUID>D6438569B496BC9205481E8A70F92F1E</METRIC_GUID>
    <KEY_VALUE>SYS_tcellhost</KEY_VALUE>
    <COLLECTION_TIMESTAMP>2007-03-15 22:01:48</COLLECTION_TIMESTAMP>
    <SEVERITY_CODE>20</SEVERITY_CODE>
    <MESSAGE>User SYS logged on from tcellhost.</MESSAGE>
    <MESSAGE_NLSID>UserAudit_username_alertmessage</MESSAGE_NLSID>
    <MESSAGE_PARAMS><![CDATA[SYS&tcellhost]]></MESSAGE_PARAMS>
    </ROW>
    </ROWSET>
    </UPLOAD>
    How can I disable this feature since after some time it fills up the file system?
    Thank you, best regards.
    Tonguc

    Myself I did stop (forever) the dbconsole then
    rm -r $ORACLE_HOME/myhost.mydomain.com_MYSID
    not sure if this is an acceptable workaround ;-)

  • How does one remove temporary files from Safari?  A friend logged on to her Facebook account using my iMac.  Now I can't remove her e-mail address from Facebook.  It was suggested to me that I try clearing temporary files from Safari but I can't find

    How does one remove temporary files from Safari?  A friend logged on to her Facebook account using my iMac running Mac OSX 10.7.5 and Safari 6.1.6.  Now I can't remove her e-mail address from my computer.  When I open Facebook her address shows in the user button.  I do not have a Facebook account.  It was suggested to me that I try clearing temporary files from Safari but I can't find anything that tells me how to do this.  Are temporary files the same as the cache?  It also was suggested that I try clearing Safari cache.  How do I do that?

    Check Safari/Preferences/Passwords to see if the Facebook account is there. If so, select it and remove it. If you are still having problems, Safari/Preferences/Advanced - enable the Develop menu, then go there and Empty Caches. Quit/reopen Safari and test. If that doesn't work, Safari/Reset Safari.

  • How to delete the temporary files when we log out from ESS

    Hello expert,
    In my company we are running ESS using ITS server, do you know how to delete the temporary files when we log out from ESS?
    Thanks.

    The temporary files used by ESS. For example paystub pdf file.

  • How to delete the duplicate email address in BP master data

    Hi,
    When  you get an email ids from the third party vendor and you are loading into CRM BP master data.  how to delete the duplicate email address already exits in the system.  In CRM you can create the same BP with different id.   I would like to know how to delete the email address during importing email addresses from the third party tool.
    During the campaign you are sending email to all your customers, when the customer want to unsubscibe the email address from your list, how to unsubcribe the email address and how to updat the BP master data. 
    If you are sending the email to customer, you are using html or simple text, if the customer wants only html or simple text, how you to specify in the system?
    thanks,
    arul

    Hello Arul,
    welcome to the SDN CRM Development forum.
    1. I think you should clear the data with duplicate E-Mail adresses in the external tool.
    2. Unsubscription could be done by a Marketing Attribute which could be set by using a Target Group which is created by Campaign Automation. Have a look at this Toppic. There is also a Best Practice avaliable at http://help.sap.com/bp_crmv340/CRM_DE/index.htm.
    3. Also HTML or Simple text can be mained in a Marketing Attribute. You have to use different Mail Forms to which are sent to different Target groups.
    Regards
    Gregor

  • The Microsoft Exchange Address Book was unable to log on to Exchange

    I am currently migrating a exchange 2007 to exchange 2013.
    Exchange 2013 is installed on a seperate Windows Server 2012 server.
    Exhange 2007 is installed on a  seperate Windows Server 2003 R2 server.
    I have moved some mailboxes from exchange 2007 to exchange 2013 and also created some new mailboxes on the exchange 2013 server itself. 
    OWA, ActiveSync , IMAP are all working correctly for those mailboxes , but I am not able to connect to outlook with the exchange option (local connection).
    Outlook 2013:
    When I use autodiscover to connect to the exchange server step 1 & 2 are working correctly (establishing network connection & searching for mailbox settings) but on the 3th step (logging on to the mail server) I receive the following error
    The name cannot be resolved. The Microsoft Exchange Address Book was unable to log on to Exchange. Contact you system administrator if the problem persists.
    When I filll in the exchange server manually (using the normal servername server.hq.corp.domain.local not the guid version) the check name resolves correctly and the profile creation is finishing ok. But when I try to open outlook with that profile it gives
    me the following errors :
    with cached exchange mode selected:
    Cannot start Microsoft Outlook. Cannot open the Outlook windows. The set of folders cannot be opened. 
    You must connect to Microsoft Exchange with the current profile before you can synchronize your folders with your Outlook data file (.ost)
    with cached exchange mode deselected:
    Cannot start Microsoft Outlook. Cannot open the Outlook windows. The set of folders cannot be opened. 
    Microsoft Exchange is not available. Either there are network problems or the Exchange server is down for maintenance
    When I use the Microsoft Connectivity Analyzer it fails on the following step:
    Testing the address book "Check Name" operation for user [email protected] against server [email protected]
    An error occured while attempting to resolve the name. Elapsed Milliseconds: 91 Additional Details: The address book bind operation failed with status -2147221231. NSPI Status 2147746065

    Hi,
    Please run the following command in Exchange server to get Exchange GUID:
    Get-Mailbox UserA | FL Identity,ExchangeGuid
    Then open Outlook, click File > Account Settings > Account Settings > Change (If you can’t open Outlook, go to Control Pane > Mail to change it). In Server Settings, import the [email protected] into the Server box and click Check Name
    to have a try.
    If the name is checked successfully but also can’t open the profile, please close Outlook. In the Start menu, Run command (Windows key + R), type or paste
    outlook.exe /resetnavpane  (Note: Make sure there is a space between the words.)
    Then press Enter (or OK button) to restart Outlook
    Regards,
    Winnie Liang
    TechNet Community Support

  • How to retrieve the server IP address

    Hi Experts,
    In my scenario, if some problem occur, then the XSLT mapping sends a mail to some one,subject is 'PRD', if we execute this from production or quality or development server.
    But now i want to know this mail from which server, so i want to change the subject line as 'PRD' if it is only from production system otherwise 'OTH', how to achieve this ? No hard code allow at any where.
    I have one thought, if we find the server ip address then we can recognize, but how to get the server IP address ? Is it possible ?
    Thanks
    Ramesh

    Hi,
    My source is some WSDL file, this is more than 15000 characters so i am unable to send the full file.
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
         <wsdl:types>
              <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />
                   <xsd:element name="Pip3A4PurchaseOrderRequest" type="Pip3A4PurchaseOrderRequest" />
                   <xsd:complexType name="Pip3A4PurchaseOrderRequest">
                        <xsd:sequence>
                             <xsd:element name="fromRole" type="fromRole" />
                             <xsd:element name="GlobalDocumentFunctionCode" type="xsd:string" />
                             <xsd:element name="PurchaseOrder" type="PurchaseOrder" />
                             <xsd:element name="thisDocumentGenerationDateTime" type="thisDocumentGenerationDateTime" />
                             <xsd:element name="thisDocumentIdentifier" type="thisDocumentIdentifier" />
                             <xsd:element name="toRole" type="toRole" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="fromRole">
                        <xsd:sequence>
                             <xsd:element name="PartnerRoleDescription" type="PartnerRoleDescription" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PartnerRoleDescription">
                        <xsd:sequence>
                             <xsd:element name="ContactInformation" type="ContactInformation" minOccurs="0" />
                             <xsd:element name="GlobalPartnerRoleClassificationCode" type="xsd:string" />
                             <xsd:element name="PartnerDescription" type="PartnerDescription" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="ContactInformation">
                        <xsd:sequence>
                             <xsd:element name="contactName" type="contactName" minOccurs="0" />
                             <xsd:element name="EmailAddress" type="xsd:string" minOccurs="0" />
                             <xsd:element name="facsimileNumber" type="facsimileNumber" minOccurs="0" />
                             <xsd:element name="telephoneNumber" type="telephoneNumber" minOccurs="0" />
                             <xsd:element name="PhysicalAddress" type="PhysicalAddress" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="contactName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="FreeFormText">
                        <xsd:simpleContent>
                             <xsd:extension base="xsd:string">
                                  <xsd:attribute ref="xml:lang" />
                             </xsd:extension>
                        </xsd:simpleContent>
                   </xsd:complexType>
                   <xsd:complexType name="facsimileNumber">
                        <xsd:sequence>
                             <xsd:element name="CommunicationsNumber" type="xsd:string" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="telephoneNumber">
                        <xsd:sequence>
                             <xsd:element name="CommunicationsNumber" type="xsd:string" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PartnerDescription">
                        <xsd:sequence>
                             <xsd:element name="BusinessDescription" type="BusinessDescription" />
                             <xsd:element name="GlobalPartnerClassificationCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="PhysicalAddress" type="PhysicalAddress" minOccurs="0" />
                             <xsd:element name="ContactInformation" type="ContactInformation" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="BusinessDescription">
                        <xsd:sequence>
                             <xsd:element name="GlobalBusinessIdentifier" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalSupplyChainCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="businessName" type="businessName" minOccurs="0" />
                             <xsd:element name="NationalBusinessTaxIdentifier" type="NationalBusinessTaxIdentifier" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PurchaseOrder">
                        <xsd:sequence>
                             <xsd:element name="AccountDescription" type="AccountDescription" minOccurs="0" />
                             <xsd:element name="comments" type="comments" minOccurs="0" />
                             <xsd:element name="ContractInformation" type="ContractInformation" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="DocumentReference" type="DocumentReference" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="FinancingTerms" type="FinancingTerms" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="generalServicesAdministrationNumber" type="generalServicesAdministrationNumber" minOccurs="0" />
                             <xsd:element name="GlobalGovernmentPriorityRatingCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalPurchaseOrderFillPriorityCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalPurchaseOrderTypeCode" type="xsd:string" maxOccurs="unbounded" />
                             <xsd:element name="governmentContractIdentifier" type="governmentContractIdentifier" minOccurs="0" />
                             <xsd:element name="installAt" type="installAt" minOccurs="0" />
                             <xsd:element name="isDropShip" type="isDropShip" />
                             <xsd:element name="OrderShippingInformation" type="OrderShippingInformation" minOccurs="0" />
                             <xsd:element name="ProductLineItem" type="ProductLineItem" maxOccurs="unbounded" />
                             <xsd:element name="proprietaryInformation" type="proprietaryInformation" minOccurs="0" />
                             <xsd:element name="requestedEvent" type="requestedEvent" minOccurs="0" />
                             <xsd:element name="requestedShipFrom" type="requestedShipFrom" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="SecondaryBuyer" type="SecondaryBuyer" minOccurs="0" />
                             <xsd:element name="shipTo" type="shipTo" minOccurs="0" />
                             <xsd:element name="TaxExemptStatus" type="TaxExemptStatus" minOccurs="0" />
                             <xsd:element name="totalAmount" type="totalAmount" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="AccountDescription">
                        <xsd:sequence>
                             <xsd:element name="accountName" type="accountName" />
                             <xsd:element name="AccountNumber" type="xsd:string" minOccurs="0" />
                             <xsd:element name="billTo" type="billTo" minOccurs="0" />
                             <xsd:element name="CreditCard" type="CreditCard" minOccurs="0" />
                             <xsd:element name="financedBy" type="financedBy" minOccurs="0" />
                             <xsd:element name="GlobalAccountClassificationCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="prePaymentCheckNumber" type="prePaymentCheckNumber" minOccurs="0" />
                             <xsd:element name="WireTransferIdentifier" type="xsd:string" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="accountName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="billTo">
                        <xsd:sequence>
                             <xsd:element name="PartnerRoleDescription" type="PartnerRoleDescription" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PhysicalAddress">
                        <xsd:sequence>
                             <xsd:element name="addressLine1" type="addressLine1" minOccurs="0" />
                             <xsd:element name="addressLine2" type="addressLine2" minOccurs="0" />
                             <xsd:element name="addressLine3" type="addressLine3" minOccurs="0" />
                             <xsd:element name="cityName" type="cityName" minOccurs="0" />
                             <xsd:element name="GlobalCountryCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalLocationIdentifier" type="xsd:string" minOccurs="0" />
                             <xsd:element name="NationalPostalCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="postOfficeBoxIdentifier" type="postOfficeBoxIdentifier" minOccurs="0" />
                             <xsd:element name="regionName" type="regionName" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="addressLine1">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="addressLine2">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="addressLine3">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="cityName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="postOfficeBoxIdentifier">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="regionName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="businessName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="CreditCard">
                        <xsd:sequence>
                             <xsd:element name="cardHolderName" type="cardHolderName" />
                             <xsd:element name="creditCardIdentifier" type="creditCardIdentifier" />
                             <xsd:element name="expiryDate" type="expiryDate" />
                             <xsd:element name="GlobalCreditCardClassificationCode" type="xsd:string">

  • How to specify a mapping file using annotations?

    Hi,
    i am trying to deploy a WebService (with annotations) on oc4j 10.1.3.1.0. but all i get is the following exception:
    07/03/13 12:41:52 oracle.j2ee.ws.common.tools.api.ValidationException: test.datamodel.SimpleObjectId - Duplicate type name "test.datamodel.SimpleObjectId" for Java type "{http://tdeer.de/services/internal/test/1_0}SimpleObjectId" found. To remove this error do not specify a single typeNamespace for all value types or specify a mapping file. This error could also be caused when an erroneous type has been used more than once.
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.RmiModeler.buildModel(RmiModeler.java:247)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:173)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.Processor.runModeler(Processor.java:72)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.metadata.annotation.DeploymentGenerator$DeploymentCompileTool.run(DeploymentGenerator.java:200)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.metadata.annotation.DeploymentGenerator.generateDeploymentArtifacts(DeploymentGenerator.java:131)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.metadata.annotation.EJBWebServiceAnnotationParser.parseAnnotatedBean(EJBWebServiceAnnotationParser.java:165)
    07/03/13 12:41:52      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    07/03/13 12:41:52      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    07/03/13 12:41:52      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    07/03/13 12:41:52      at java.lang.reflect.Method.invoke(Method.java:585)
    07/03/13 12:41:52      at oracle.j2ee.ws.server.deployment.oc4j.WebServiceAnnotationListener.parseAnnotatedClass(WebServiceAnnotationListener.java:85)
    07/03/13 12:41:52      at com.evermind.server.ejb.AnnotationParser.notifyAnnotationListeners(AnnotationParser.java:201)
    07/03/13 12:41:52      at com.evermind.server.ejb.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
    07/03/13 12:41:52      at com.evermind.server.ejb.EJBPackageDeployment.parseMetaData(EJBPackageDeployment.java:939)
    07/03/13 12:41:52      at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:832)
    07/03/13 12:41:52      at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:217)
    07/03/13 12:41:52      at com.evermind.server.Application.setConfig(Application.java:413)
    07/03/13 12:41:52      at com.evermind.server.Application.setConfig(Application.java:314)
    07/03/13 12:41:52      at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1853)
    07/03/13 12:41:52      at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:512)
    07/03/13 12:41:52      at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:196)
    07/03/13 12:41:52      at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
    07/03/13 12:41:52      at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
    07/03/13 12:41:52      at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
    07/03/13 12:41:52      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
    07/03/13 12:41:52      at java.lang.Thread.run(Thread.java:595)
    07/03/13 12:41:52 Caused by: oracle.j2ee.ws.common.processor.modeler.rmi.InvalidParameterException: test.datamodel.SimpleObjectId - Duplicate type name "test.datamodel.SimpleObjectId" for Java type "{http://tdeer.de/services/internal/test/1_0}SimpleObjectId" found. To remove this error do not specify a single typeNamespace for all value types or specify a mapping file. This error could also be caused when an erroneous type has been used more than once.
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.LiteralTypeModeler.addTypeName(LiteralTypeModeler.java:1249)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.LiteralTypeModeler.processClass(LiteralTypeModeler.java:290)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.LiteralTypeModeler.modelTypeLiteral(LiteralTypeModeler.java:235)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.LiteralTypeModeler.modelTypeLiteral(LiteralTypeModeler.java:181)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.LiteralTypeModeler.modelSubclasses(LiteralTypeModeler.java:1048)
    07/03/13 12:41:52      at oracle.j2ee.ws.common.processor.modeler.rmi.RmiModeler.buildModel(RmiModeler.java:210)
    07/03/13 12:41:52      ... 25 more
    The Stateless-SessionBean has one WebMethod with the following Signature:
    public Element getElement(TestObjectId1 pObjectId1, TestObjectId2 pObjectId2) throws RemoteException
    TestObjectId1 and TestObjectId2 have the same Superclass, SimpleObjectId.
    How to specify a mapping file using annotations?
    Thanks
    tdeer

    We you codegen a Policy annotated WSDL, the policies are get included in the stub. Hence you don't have to specify a separate Policy file.
    But if you need to use a separate policy then you need to set them in the AxisDescription object that you use in the ServiceClient and OperationClient.
    e.g.
    ServiceClient serviceClient = new ServiceClient();
    OperationClient operationClient = serviceClient
    .createClient(ServiceClient.ANON_OUT_IN_OP);
    FileInputStream fis = new FileInputStream("path-to-policy.xml");
    Policy servicePolicy = PolicyEngine.getPolicy(fis);
    AxisService axisService = serviceClient.getAxisService();
    axisService.getPolicyInclude().setPolicy(servicePolicy);
    If you need more information please repost this to [email protected] with a [AXIS2] subject prefix.

  • Numbers to CSV export script: how to specify the encoding?

    Hi,
    I'm using the following script to export a Numbers document to CSV:
    # Command-line tool to convert an iWork '09 Numbers
    # document to CSV.
    # Parameters:
    # - input: Numbers input file
    # - output: CSV output file
    # Attik System, Philippe Lang
    # Creation date: 31 mai 2012
    # Modification date:
    on run argv
      # We retreive the path of the script
              set myPath to (path to me)
              tell application "Finder" to set myFolder to folder of myPath
      # We get the command line parameters
              set input_file to item 1 of argv
              set output_file to item 2 of argv
      # We retreive the extension of the file
              set theInfo to (info for (input_file))
              set extname to name extension of (theInfo)
      # Paths
              set input_file_path to (myFolder as text) & input_file
              set output_file_path to (myFolder as text) & output_file
              if extname is equal to "numbers" then
        tell application "Numbers"
          open input_file_path
          save document 1 as "LSDocumentTypeCSV" in output_file_path
          close every window saving no
        end tell
              end if
    end run
    It works fine, except that I don't know how to specify the encoding of the text in the CSV file (Latin1, MacRoman, Unicode). This option is available in the export dialog of Numbers. Any hint on how to do that is welcome. (GUI Scripting?)
    Where can I find documentation on the iWork "vocabulary" available? Is there a definitive documentation somewhere? I tried to record an manual export in the script editor, without success. Script is more or less empty.
    Thanks!
    Philippe Lang

    A further note from Yvan. He's made some revisions to the script sent earlier.
    --{code}
    --[SCRIPT export to CSV with selected encoding]
    I added some features.
    (1) Defining the encoding thru the preferences file apply only if
    the application is not in use because the file is read only once in a session.
    A test urge you to quit Numbers if it is running.
    (2) info for is deprecated so it may be removed by Apple tomorrow.
    I no longer use it.
    (3) just for the fun, I added a piece of code allowing you to select the encoding on the fly.
    Thanks to the property chooseEncodingInScript, at this time the script use Unicode (UTF-8)
    (4) I'm wondering which tool is used to launch this script,
    I don't know the way to pass arguments when I run one.
    Yvan KOENIG (VALLAURIS, France)
    2012/06/13
    property chooseEncodingInScript : false
    true = the script will ask you to select the encoding
    false = the script use the embedded encoding
    on run argv
      set input_file to (item 1 of argv) as text
      set output_file to (item 2 of argv) as text
      set myPath to (path to me) as text
              tell application "System Events"
      set theProcesses to name of every application process
      set myFolder to path of container of (disk item myPath)
      set input_file_path to myFolder & input_file
      set output_file_path to myFolder & output_file
      set extname to name extension of (disk item input_file)
      end tell
              if extname is "numbers" then
                        if "Numbers" is in theProcesses then error "Please, quit “Numbers” before running this script !"
      if chooseEncodingInScript then
                                  set theList to {"Mac OS Roman", "Unicode (UTF-8)", "Windows Latin 1"}
                                  set maybe to choose from list theList with prompt "Choose the default encoding applying to export as CSV"
      if maybe is false then
      error number -128
      else if item 1 of maybe is item 1 of theList then
                                            30 -- Mac OS Roman
      else if item 1 of maybe is item 2 of theList then
                                            4 -- Unicode (UTF-8)
      else
                                            12 -- Windows Latin 1
      end if
      else
                                  4 -- Unicode (UTF-8)
      end if
                        do shell script "defaults write com.apple.iWork.Numbers CSVExportEncoding  -int " & result
      tell application "Numbers"
      open input_file_path
                                  save document 1 as "LSDocumentTypeCSV" in output_file_path
      close every window saving no
      end tell
      end if
    end run
    --{code}
    Regards,
    Barry

  • How to read the properties file available in Server File structure in webdy

    hi all,
    I have developed one webdynpro application. In this application i need to access mdm server to continue. For getting the connection i need to pass the IP addresses.
    Can i have code  how to read the properties file which is residing in the server file. with out included along with the application. keeping some where in the file structure in the server. I want to read that properties file by  maintain the iP addresses and users in  properties file based on the key i want to read like below.
    servername="abcServer"
    username="john"
    password="test123"
    Please send me the code how to read this properties file from the file structure and how to read this values by key  in webdynpro application
    Regards
    Vijay

    Hi Vijay,
    You can try this piece of code too:
    Properties props = new Properties();
    //try retrieve data from file
    //catch exception in case properties file does not exist
    try {
             props.load(new FileInputStream("c:\property\Test.properties")); //File location
             String serverName = props.getProperty("servername"); //Similarly, you can access the other properties
             if(serverName==null)
               //....do appropriate handling
         }     catch(IOException e)
                   e.printStackTrace();
    Regards,
    Alka.

  • How to extract the cobol files into owb

    Hi
    How to extract the cobol files in owb,I am using OWB9.2.
    Ex:I am having 2 records DCEC4000100 9159000050C those values are 5 bytes 'RAVI and 6 bytes '15000'.
    Using contorl file i am trying to load these into Oracle,But i am not able into insert these records into Oracle.
    Can any tell me how to handle this kind of situation?
    Regards,
    Rupak

    Good morning Ashok,
    Your data is in a SQL*Loader supported datatype, so basically it should not be a problem.
    Have you checked the Database Utilities guide (for Oracle9i for instance: http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96652/toc.htm) on how to handle this?
    I'll also repeat my previous question, have you ever been able to load data into the database using SQL*Loader (either using ASCII values or any other datatype)?
    For the OWB part, have you read "Importing Data Definitions" (typically chapter 4)? More specifically, "Specifying Field Properties" in "About Flat File Sources and Targets"?
    In "SQL*Loader Properties" it says the following:
    Type Describes the data type of the field for the SQL*Loader. You can use the Flat
    File Sample Wizard to import the following data types: CHAR, DATE, DECIMAL
    EXTERNAL, FLOAT EXTERNAL, INTEGER EXTERNAL, ZONED , AND ZONED
    EXTERNAL. For complete information on SQL*Loader field and data types, refer to
    Oracle9i Utilities. Currently, only portable datatypes are supported.
    If you check the database utitlities guide (chapter 6 Field List Reference) and look for "SQL*Loader Datatypes", you'll find (packed) decimal under the Nonportable Datatypes. This implies that OWB does not support it.
    This does not mean you can't use SQL*Loader, you'll only have to define everything separate from OWB and call it separately as well.
    Good luck, Patrick

  • In LSMW using BAPI Scenario, how to assign the same file to HEADER and ITEM

    Hi,
    i got a problem when we are in ASSIGN FILES step how to assign the same file to both HEADER and ITEM Structures?

    Hi,
    When defining the file in specify files step check the option 'Data for Multiple Source Structures'.
    Hope it helps.
    Thanks,
    Mahesh

Maybe you are looking for

  • Kernel Panic with DiskWarrior 4.1

    After upgrading my MacBook Pro (MacBookPro3,1 with 2GB RAM) to 10.5.3, DiskWarrior 4.1 will reliably trigger a kernel panic when trying to rebuild the directory of the partition on my external FireWire drive that is used for Time Machine backups. The

  • Why won't table of contents work in Pages

    I am creating a songbook with one song on each page.  I have about 65 pages.  I have applied the style "Heading 2" to all song titles at the top of each page.  I went into the TOC tab of the Inspector and where it says "select paragraph styles whose

  • Can only insert 1 cd/dvd between sleeps.

    My superdrive can only accept one cd/dvd during each session. After I eject the first cd/dvd, it will immediately eject any new media as soon as its inserted, even if its the same cd/dvd. The only way around this at the moment is to sleep the mac and

  • It isnt show message in alert AFTTER RELEASE UPGRADE

    Hello, it isnt show custom message in alert. The realease Have Been Recently upgraded from 12.0.3 to version 12.1.2. The alert is shown from the custom.pll code.

  • MS Windows and iphoto access

    Can anyone help...? I have a very large iphoto library which is shared out to other MAC users in the family... is there a way windows users can get access to the library to, it would be useful kind regards derek