How to run the oc4j server on port 80

Hi,
We want to run Oc4j on port 80 and do not want to install OHS.
We hava a script, oc4jStartStop, that start and stop the server. It has following file permisions:
-rwsr-sr-x 1 root root 1479 sep 6 10:29 oc4jStartStop
When a non root user starts the server by executing this script we get an error:
19.09.02 09:06: Error starting HTTP-Server: Permission denied
Script starts the java process as follows:
ORION_HOME=/my/orion/catalog/j2ee/home; export ORION_HOME
java -Xmx400m -Dp6.home=$ORION_HOME/lib -jar oc4j.jar &
Any suggestion?
Regards
Mayu

In the file <OC4JHOME>/config/http-web-site.xml you can change the port number of OC4J to your preference.
<web-site port="8888" ...
Just change this to port="80"
As for your other question, I'm sorry I can't be of any help.
Ole

Similar Messages

  • How to start the oc4j server

    I install oracle 9ias 9.0.3,but i don't know how to start the oc4j server.
    thanks for any help?

    hi
    Refer "Starting and Stopping OC4J" from
    http://otn.oracle.com/tech/java/oc4j/doc_library/902/A95880_01/html/toc.htm
    hope this helps.
    shrini

  • On "Run" the OC4J Server tries to access the wrong directory.

    I have created a PL/SQL web service using the wizard in JDev. When I go to run the service I get the below error. Not sure why it is trying to access "/C:/Documents and Settings/Administrator/Desktop/jdevstudio10134/jdev/system/oracle.j2ee.10.1.3.42.70/embedded-oc4j/applications/datatags.ear" and then it obviously errors out. I have the entire JDev application to include the web service files in the E:\jdevstudio10134 and subsequent directories. Any help is great. I am sure it is something simple that I missed. I am fairly new to the web services world especially using JDev to create them. Thanks in advance....
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    E:\jdevstudio10134\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\config>
    E:\jdevstudio10134\jdk\bin\javaw.exe -client -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=1133 -classpath E:\jdevstudio10134\j2ee\home\oc4j.jar;E:\jdevstudio10134\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -XX:MaxPermSize=256m -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config E:\jdevstudio10134\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\config\server.xml
    [waiting for the server to complete its initialization...]
    Listening for transport dt_socket at address: 1133
    Debugger connected to local process.
    08/08/08 19:02:43 [SEVERE]: Error instantiating application at file:/C:/Documents and Settings/Administrator/Desktop/jdevstudio10134/jdev/system/oracle.j2ee.10.1.3.42.70/embedded-oc4j/applications/datatags.ear: Unable to get ApplicationConfig for datatags : Error creating deployment directory: IO Error: The system cannot find the path specified
    08/08/08 19:02:44 [SEVERE]: cannot update a configuration file because configuration parsing is failed. please correct the problem and restart oc4j.
    Debuggee process paused.

    Well it seems from your error message that JDeveloper is trying to create this directory here:
    C:/Documents and Settings/cyounger/Desktop/jdevstudio10134/jdev/system/oracle.j2ee.10.1.3.42.70/embedded-oc4j/applications/datatags.ear
    This is probably failing because of the space in the path (i.e. Documents and Settings).
    So the question is why is it trying to create the directory there if your JDeveloper is installed elsewhere.
    I'm going to guess that you either have an environment setting pointing to this directory (maybe something like JDEV_USER_DIR) or it is because you upgraded from another JDeveloper install that used that directory. If this is the case I would suggest a fresh install of JDeveloper and to choose "NO" when asked if you want to upgrade from a previous installation.

  • Problem on running Preconfigured OC4J server in JDeveloper 10.1.3.2

    Hi all,
    I have problem on running preconfigured oc4j server in JDeveloper 10.1.3.2. I get the error message below :
    C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\srcimage\bin>
    C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\srcimage\bin\adfp_oc4j.cmd C:\Jdev10132\jdk\jre\.. C:\Jdev10132\ C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0 -start
    wsrp not installed
    installing wsrp......
    C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\javacache alt path or file already exist
    C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\javacache\admin
    path or file already exist
    System can not find the specified path
    java.lang.RuntimeException: Instruction unknown: loadınstruction
         at com.sun.org.apache.bcel.internal.util.InstructionFinder.mapName(InstructionFinder.java:138)
         at com.sun.org.apache.bcel.internal.util.InstructionFinder.compilePattern(InstructionFinder.java:170)
         at com.sun.org.apache.bcel.internal.util.InstructionFinder.search(InstructionFinder.java:218)
         at com.sun.org.apache.bcel.internal.util.InstructionFinder.search(InstructionFinder.java:264)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.peepHoleOptimization(Mode.java:1444)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileApplyTemplates(Mode.java:1058)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.compileModes(Stylesheet.java:615)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(Stylesheet.java:730)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:335)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:410)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:791)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:619)
         at oracle.portlet.server.containerimpl.install.Main.applyTransformation(Main.java:284)
         at oracle.portlet.server.containerimpl.install.Main.install(Main.java:169)
         at oracle.portlet.server.containerimpl.install.Main.main(Main.java:126)
    ERROR: 'Instruction unknown: loadınstruction'
    FATAL ERROR: 'Could not compile stylesheet'
    oracle.portlet.server.containerimpl.install.InstallException: Error parsing stylesheet "resource/config-server.xsl"
         at oracle.portlet.server.containerimpl.install.Main.applyTransformation(Main.java:289)
         at oracle.portlet.server.containerimpl.install.Main.install(Main.java:169)
         at oracle.portlet.server.containerimpl.install.Main.main(Main.java:126)
    Caused by: javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:619)
         at oracle.portlet.server.containerimpl.install.Main.applyTransformation(Main.java:284)
         ... 2 more
    caused by: javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:619)
         at oracle.portlet.server.containerimpl.install.Main.applyTransformation(Main.java:284)
         at oracle.portlet.server.containerimpl.install.Main.install(Main.java:169)
         at oracle.portlet.server.containerimpl.install.Main.main(Main.java:126)
    System can not find the specified path
    Error: Can not find C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\j2ee\home\config\server.xml.
    Stop OC4J command finished
    Any help is appreciated...
    Thanks in advance
    Aliye

    well I have downloaded the latest version of jdk (1.6) to check with it so it solved some of the problems but still I get an error on running the oc4j server. Error I get is:
    Starting OC4J from C:\Jdev10132\j2ee\home ...
    Executing: C:\Jdev10132\jdk\jre..\bin\java -XX:MaxPermSize=128m -Xmx512m -jar "C:\Jdev10132\j2ee\home\oc4j.jar" -config C:\Jdev10132\jdev\extensions\oracle.adfp.seededoc4j.10.1.3.2.0\srcimage\j2ee\home\config\server.xml
    07/02/19 10:45:10 Error initializing server: IO error reading system
    07/02/19 10:45:10 Fatal error: server exiting
    Stop OC4J command finished.
    I couldnt understand what is the problem now..
    Thanks for your help..
    Aliye

  • How to run the form that is only installed on a PC and not using a server?

    Hi
    I am new to Oracle and have taken the forms class. But I do not understand how to run the form from my PC using XP windows. (Do not have access to a server).
    I have started the OC4J, made sure the listener was started, compiled the form and then when I run it, it automatically goes to the HTTP:
    ERROR: res://ieframe.dll/acr_depnx_error.htm#,http://kevin:8889/forms/frmservle
    I connected to the database correctly. I can process a report and it does nor try to access the internet. My only issue is running the form. I verified it compiled.
    Sorry for a basic question. Could someone please help, I tried reviewing other questions, but not sure if they are connecting to a server or not.
    I see webutil but is it required if I don't have a server? Thank you in advance.

    Regardless of the version, it appears that you may not have configured the Builder. Do the following:
    1. Open the Builder
    2. From the menu, select Edit > Preferences > Runtime
    3. In the box labeled "Application Server URL:", enter a local URL needed to run a form OR click the button labeled "Reset to Default". If you decide to manually enter a value, it would looks something like this:
    http://localhost:8889/forms/frmservlet
    4. In the field labeled "Web Browser Location:", enter the path and executable to your preferred browser. So for example if IE is your browser of choice the entry would most likely look like this:
    C:\Program Files\Internet Explorer\IEXPLORE.EXE
    5. Click on OK and retest.
    By the way, you can manually enter a URL in the browser. Clicking the RunForm button from the Builder is strictly optional. To run the "test" form directly from the browser enter the following into the browser's address field:
    http://localhost:8889/forms/frmservlet?form=test
    More information about Forms can be found on OTN:
    http://www.oracle.com/technology/products/forms/index.html

  • How to configure the .EAR to the OC4J server step by step ?

    I have configured the JavaBean of the OC4J server with the following step:
    1.create the eosp.ear with the JDeveloper's wizard
    2.copy the eosp.ear to the OC4J Server with the Path:
    J2EE_HOME/applications/
    3.modify the server.xml and add the following words:
    <application name="eosp" path="../applications/eosp.ear" auto-start="true"/>
    4.restart the OC4J server and show the information:
    Auto-deploying eosp (New server version detected)...
    5.create the new JSP and this source code is:
    <%@ page import="com.beautybeard.eosp.common.*"%>
    <%@ page import="com.beautybeard.eosp.constant.*"%>
    6.visit the JSP and show the error information:
    Error parsing JSP page /eosp/usr_profile/login.jsp
    Syntax error in source/eosp/usr_profile/login.jsp.java:5: Package com.beautybeard.eosp.common not found in import.import com.beautybeard.eosp.common.*; ^/eosp/usr_profile/login.jsp.java:6: Package com.beautybeard.eosp.constant not found in import.import com.beautybeard.eosp.constant.*; ^2 errors
    why?
    why can not find the package?
    please help me out

    Hi Sky-
    It looks like you have a web application only.
    You need to create a war file as described above. A war file is a jar'd file containing your web components, including your javabean class files, etc. JDeveloper 9i can do this for you. You've already done the hard work. Suppose that the project you have created that contains your javabeans, etc in JDev 9i is called myproject (with myproject.jpr as the project file). Right click on the myproject.jpr in the JDev navigator and select 'new...', go to Deployment Profiles and select J2EE Web Module (WAR File) - a general screen will pop up asking you to save the deployment profile (you can just use the default if you want). Once you select OK on that, you will get a screen that calls itself the J2EE Web Module Deployment Profile Settings. This is the screen that you can use to enter your information.
    Your servlet and javabean classes will go into WEB-INF/classes subdirectory that you see to your left in this window. Simply select the WEB-INF/classes entry and it will display a list of your java sources (it will only place the compiled output in this directory - there is a toggle for it).
    Once you have specified that your javabean and servlet classes go in this directory, you should be set. Go ahead and save / close. In your navigation screen under your project (myproject.jpr or whatever your project name is) you will see your files, jsps, etc and something called webapp1.deploy (if you accepted the default). If you right-click on that, you will get a menu that asks a number of things, one of which is to Deploy to EAR file. Select that entry and it will create an ear file for you. You can play with the various settings to change the name of the ear file, but that's about all you have to do. Once this is completed, you can put the EAR file on your linux box or wherever you want, adjust your server.xml and default-web-app.xml files and launch the app!
    Good luck!
    Ray
    Hi,Ray
    Thank you for giving me the detail information!
    I'm sorry that I can not give the detail and clear problem ,which make you delusoried.
    ok,now I give you my aim.
    1. I will construct my application system with JavaBean(not EJB),Servlet,JSPs (linux+IAS+JDeveloper+Oracle8i database)
    2. I will package business function with JavaBean. example:
    * CheckLogin.java
    package com.beautybeard.eosp.javabean.usrprofile;
    import com.beautybeard.eosp.common.*;
    import com.beautybeard.eosp.data.*;
    import java.io.*;
    import java.lang.*;
    public class CheckLogin{
    public CheckLogin()
    //do nothing here
    public boolean getCheckLogin(){
    3. I will control the request and response with Servlets.
    example:
    *CheckLoginSevlet.java
    package com.beautybeard.eosp.servlet.usrprofile;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import com.beautybeard.eosp.servlet.*;
    import com.beautybeard.eosp.javabean.usrprofile.*;
    public class CheckLoginServlet extends DefaultServlet
    public void service(HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException
    //use the JavaBean
    CheckLogin cl = new CheckLogin();
    if (cl.getCheckLogin){
    res.sendRedirect("login.jsp");
    }else{
    res.sendRedirect("err.jsp");
    4. I will display the result with JSPs:
    example:
    <%//login.jsp%>
    <%@ page import="com.beautybeard.eosp.common.*"%>
    <%@ page import="com.beautybeard.eosp.data.*"%>
    5. I have success on running the above steps in the 9iJDevelper(pure java) environment(OS:Windows 2000 Server), and now I will move the JSPs ,Servlets,JavaBeans to the Server(linux) without the JDeveloper's deployment wizard.
    how to configure the IAS to carry my point?
    thank you!
    Sky liu

  • How to run the payroll in Quality server..Unable to exit the payroll record

    HI Experts,
    In my Quality server the current payroll period is 6 ---2006.
    For testing purposes i want to run the payroll for next periods.
    Here i am unable to exit the payroll.It is showing message that payroll has not been run successfully for all personnel numbers.I have struck up here.
    How can run the payroll for the next period.
    Please advice me to run the payroll for later periods...
    Thanking U.
    Sairam.

    Hi Vicky,
    That is ur master data and time data is not correct, the rejected personnel no. should with the correction flag.these personnel no are stored in too called matchcode W, so u have to change the master data and time data fot that perticular personnel no. and agian release for payroll.
    if any changes required in customizing tables rather than ur infotypes then let me know.
    Hope this will give u an idea
    reward points if helpful
    Srinivas

  • How to run the Server Side Existing rule in Exchange 2010

    Hi All,
    There were requirement to create a auto forward rule for almost more than 5000 users, which we did, but the we want to apply this rules to the messages which are already in the inbox for all those users where we have created the rule.
    Right now the problem what we are facing is for each individual we have to take full access to their mailbox and execute the rule first time and then it works.
    this is becoming challenging for us to making this for all 5000 users. the other problem is those user are not regularly login to this mailbox, they are using some other Org mailbox, so even we can not communicate to all of them.
    Q1) How to run the Server Side Command which should forcefully apply whatever rules is created for that user should execute for the messages which are already in the inbox.
    Q2) or the powershell for for specific rule name, which can apply on the for all the messages which are there in the inbox.
    Any help would be appriciated!
    Thanks in adv champions!
    Ashku

    Hi Ashku,
    If these 5000 users are all users in your Exchange organization, a inbox rule can be created by the following commands:
    Get-Mailbox | foreach {New-InboxRule -Mailbox $_.Name -Name AutoForward -From [email protected] -ForwardTo UserB}
    Based on my test, the Inbox rule created in server side also cannot work on the message that have already been in the Inbox unless users click “Run Rules Now…” in their Outlook client. And the transport rule in Exchange server only works
    during the message sending process.
    Therefore, there may be no feature in Exchange server side to meet your requirement.
    Thanks for your understanding.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How to run the simple jsp on oracle 9ias application server?

    hi,
    how to run the simple jsp application jst disply the date on oracle 9ias application server?
    can any expline the steps how to do it?
    thanks
    pullareddy

    No, you need the Reports Server (as part of the Application Server or Weblogic, depending on your version).
    I try to save the report, it's saved as .jspThat depends. You can save it as a .rdf file too (so called Paper Layout). I think this option is used more often.

  • How to find the SQL Server Instances running across the given activer directory domain?

    How to find the SQL Server Instances running across the given activer directory domain?
    I have though of OSQL -L , Microsoft Assessment and Planning ( MAP ) tool and SQLPing3 (SQLSecurity) might help me.
    I would appreciate if there any other way of finding the SQL Servers / Instances running across the given active directory domain.
    Sivaprasad S
    http://sivasql.blogspot.com
    Please click the Mark as Answer button if a post solves your problem!

    Dear ,
    Very simple u find all instances through the customized sp which is get all details about inventory. Like i put the sp bellow. This is without any tool. 
    USE [master]
    GO
    /****** Object:  StoredProcedure [dbo].[DBStatus]    Script Date: 08-01-2015 19:46:11 By Damodar Patle Sr. DBA Mumbai India ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[DBStatus] 
    AS
    SELECT 
    SERVERPROPERTY('servername') AS ServerName,
    ConnectionProperty('local_net_address') AS 'local_net_address',
    ConnectionProperty('local_tcp_port') AS 'local_tcp_port',
    CONVERT(VARCHAR(25), @@VERSION) as  VERSIONSQL,
    SERVERPROPERTY('ErrorLogFileName') AS ErrorLogFilePath,
    database_id,
    CONVERT(VARCHAR(25), DB.name) AS DBName,
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'Recovery')) AS [Recovery_Model],
    create_date as DBCreate_Date, --physical_device_name,
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS DataFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS [Data MB],
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS LogFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS [Log MB],
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS MDF_File_Location,
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS  LDF_File_Location,
       user_access_desc
       FROM sys.databases DB
       ORDER BY dbName, [Log MB] DESC, NAME

  • How to run the ejb project in j2ee server

    How to run the EJB project.
    I give like
    java conveterClient converterClient.jar
    here conveterClient is class file name and converterClient.jar is deployed file
    like wise i give some exception is come
    give some help pls friends

    Navigate to the "DBOrders" module in the catalog, right click on the "ORDERS" database below and click "Export Schema Stucture". That will produce a file containing the DML needed to create the database

  • How to run the parameter form example report :pform_report.jsp

    how to run the parameter form example report : pform_report.jsp ?
    I got these error message:
    Reports Error Page
    Sat Oct 18 11:58:24 CST 2003
    javax.servlet.jsp.JspException: rwlib-1: REP-6106: (, 4 L, XML 1h��/�� ' PI with the name 'xml' can occur only in the beginning of the document.'.
    javax.servlet.jsp.JspException: rwlib-1: REP-6106: (, 4 L, XML 1h��/��
    PI with the name 'xml' can occur only in the beginning of the document.'.
         at oracle.reports.jsp.ObjectsTag.doEndTag(ObjectsTag.java:180)
         at examples.tools._pform__report._jspService(_pform__report.java:79)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:66)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:539)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:285)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:771)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:152)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:796)
         at java.lang.Thread.run(Thread.java:484)

    repost !
    please help!

  • How to configure the smtp server..

    i had an error when running the java mail program..
    this is my program
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.*;
    import java.util.Properties;
    public class MailClient
    public void sendMail(String mailServer, String from, String to,
    String subject, String messageBody,
    String[] attachments) throws
    MessagingException, AddressException
    // Setup mail server
    Properties props = System.getProperties();
    props.put("mail.smtp.host", mailServer);
    // Get a mail session
    Session session = Session.getDefaultInstance(props, null);
    // Define a new mail message
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setSubject(subject);
    // Create a message part to represent the body text
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(messageBody);
    //use a MimeMultipart as we need to handle the file attachments
    Multipart multipart = new MimeMultipart();
    //add the message body to the mime message
    multipart.addBodyPart(messageBodyPart);
    // add any file attachments to the message
    // addAtachments(attachments, multipart);
    // Put all message parts in the message
    message.setContent(multipart);
    // Send the message
    Transport.send(message);
    protected void addAtachments(String[] attachments, Multipart multipart)
    throws MessagingException, AddressException
    for(int i = 0; i<= attachments.length -1; i++)
    String filename = attachments;
    MimeBodyPart attachmentBodyPart = new MimeBodyPart();
    //use a JAF FileDataSource as it does MIME type detection
    DataSource source = new FileDataSource(filename);
    attachmentBodyPart.setDataHandler(new DataHandler(source));
    //assume that the filename you want to send is the same as the
    //actual file name - could alter this to remove the file path
    attachmentBodyPart.setFileName(filename);
    //add the attachment
    multipart.addBodyPart(attachmentBodyPart);
    public static void main(String[] args)
    try
    MailClient client = new MailClient();
    String server="smtp.canvasindia.com";
    String from="[email protected]";
    String to = "[email protected]";
    String subject="Test";
    String message="Testing";
    String[] filenames ={"c:/A.java"};
    client.sendMail(server,from,to,subject,message,filenames);
    catch(Exception e)
    e.printStackTrace(System.out);
    the error is .................
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 553 Attack detected from p
    ool 59.144.8.116. <http://unblock.secureserver.net/?ip=59.144.8.*>
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at MailClient.sendMail(MailClient.java:47)
    at MailClient.main(MailClient.java:84)
    Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 553 Attack detected fro
    m pool 59.144.8.116. <http://unblock.secureserver.net/?ip=59.144.8.*>
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
    ... 5 more
    how to configure the smtp server in my machine..
    please guide me...

    This uses gmail account, and gmail smtp
    * MailSender.java
    * Created on 14 November 2006, 17:07
    * This class is used to send mails to other users
    package jmailer;
    * @author Abubakar Gurnah
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class MailSender{
        private String d_email,d_password;
         * This example is for gmail, you can use any smtp server
         * @param d_email --> your gmail account e.g. [email protected]
         * @param d_password  --> your gmail password
         * @param d_host --> smtp.gmail.com
         * @param d_port --> 465
         * @param m_to --> [email protected]
         * @param m_subject --> Subject of the message
         * @param m_text --> The main message body
        public String send(String d_email,String d_password,String d_host,String d_port,
                String m_from,String m_to,String m_subject,String m_text ) {
            this.d_email=d_email;
            this.d_password=d_password;
            Properties props = new Properties();
            props.put("mail.smtp.user", d_email);
            props.put("mail.smtp.host", d_host);
            props.put("mail.smtp.port", d_port);
            props.put("mail.smtp.starttls.enable","true");
            props.put("mail.smtp.auth", "true");
            //props.put("mail.smtp.debug", "true");
            props.put("mail.smtp.socketFactory.port", d_port);
            props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
            props.put("mail.smtp.socketFactory.fallback", "false");
            SecurityManager security = System.getSecurityManager();
            try {
                Authenticator auth = new SMTPAuthenticator();
                Session session = Session.getInstance(props, auth);
                //session.setDebug(true);
                MimeMessage msg = new MimeMessage(session);
                msg.setText(m_text);
                msg.setSubject(m_subject);
                msg.setFrom(new InternetAddress(m_from));
                msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
                Transport.send(msg);
                return "Successful";
            } catch (Exception mex) {
                mex.printStackTrace();
            return "Fail";
        //public static void main(String[] args) {
        //    MailSender blah = new MailSender();
        private class SMTPAuthenticator extends javax.mail.Authenticator {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(d_email, d_password);
    }

  • What is the oc4j's default port?

    What is the oc4j's default port? I want to type the address in browser's address bar and see the default page of oc4j (ex.: http://localhost:8080)
    Thanks
    sávio

    hi,
    in the local machine it is 8889
    and the default in the aPP SERVER IS 7778
    you can change them but i dont know how,for the app server its easy,but I had never try to change it in the local.
    good luck

  • Running the App Server as a user other than root

    We used to use iPlanet Web Server which during installation allowed you to specify which user you wanted to run the Web Server. This was very good for security. How do you do this with the App server ?
    Thanks
    PS We are running it on Solaris 9.

    Application Server 7 expands on the flexibility offered in the web server.
    The most basic means to define app server instances with non-root users is to create an administrative domain (basically, an admin server instance) using the user ID of interest. As you create new application server instances in the admin domain, you can assign the same user ID to the instances.
    (There is an admin domain that is initially configured as part of the app server installation. If you installed the product as root, then the admin server and the initially configured app server instance are owned by root. If you do not want these instances to be owned by root, you should remove this admin domain and create a new one that is owned by a non-root user.)
    For example, with the following command, I've created a new app server config (an administrative domain) containing an admin server owned by user "ckamps":
    root@canteloupe-{}: asadmin create-domain sysuser ckamps adminuser admin adminpassword password adminport 5050 ckamps.domain3
    Created Domain ckamps.domain3 successfully
    root@canteloupe-{}:
    Then I create an app server instance within this admin domain:
    root@canteloupe-{}: asadmin create-instance domain ckamps.domain3 sysuser ckamps --instanceport 80 instance1
    Created Instance instance1 successfully
    Note the use of the "--sysuser" option to specify the user that owns both the admin domain as well as the app server instance.
    You can either use root to define the admin domain and the instances (in which case you need to specify the sysuser option to force a non-root ownership) or you can use a non-root user to define the admin domain and app server instances.  In the latter case, specification of the sysuser is not required.
    Since my instance is defined to listen on a privileged port, I'll need to set the "run as user" in the <instance-dir>/config/init.conf file (similar to magnus.conf in Sun ONE Web Server 6) AND ensure that I start the instance as root. Once the server instance starts up as root, it will automatically switch to the run as user.
    The "User" setting below is the "run as user" specified in the admin console's "Create new instance" wizard.
    <snip of init.conf>
    NetsiteRoot /usr/appserver
    ServerID instance3
    ServerName canteloupe
    PidLog /var/appserver/domains/ckamps.domain3/instance3/logs/pid
    User ckamps
    DNS off
    </snip>
    Alternatively, you can start up the newly defined admin server and create the new app server instance through the admin console.
    Hope this helps,
    Chris

Maybe you are looking for

  • Wrong sy-sysid value

    Hello, An ABAP program which makes use of sy-sysid picks up a wrong value.  The system id is TST, but it picks up production id which is PRD.  Therefore, when user runs transaction that needs to place a text file in the local directory, it is looking

  • Hi, i've made a video in final cut pro, the problem is that when i export it not the entire video is played, just the first 3 seconds

    i made a video in final cut pro x. The entire thing isn't that long, however when it comes to sharing it only the very first few seconds are playe. Thanks, Jamie

  • SL and iTunes broken iPhone sync

    I get this message when I plug my iPhone into the cradle: "The Phone [my phone's name] cannot be synced. You do not have enough access privileges for this operation." It still manages to sync most of the info, including podcasts and music. I cannot t

  • How to use Parameterized Stored Procedure in OBIEE 10 g..?

    Hi All, In my rpd, to load the data in the Physical layer, I'm using a Stored Procedure (*SQL Server Stored Procedure*). This stored procedure is using some parameters, so my intention is 1) Provide prompts for each parameter 2) Allow the user to sel

  • Bluetooth  Transfer

    Bluetooth works fine between MacBook Pro and G4, When transfering to the G4 I get a wndow. ie Incoming file transfer with a tick box Accept all, which I have to tick every time. Is there a way to disable this so it works automatically. Richard