Sun C++ Vs Sun JAVA - Future - Which is faster

Hi,
Sometimes I am perplexed with Sun's approach. They ship SunC++12 and market for JAVA. I work on both C++ and JAVA. I started career as a JAVA developer and then shifted as a C++ developer for SUN platform. Now I work on both.
Many of Sun's article praise about JAVA and says it is faster than C++. Does that list include Sun C++ compiler too?
Can't Sun C++ developers develop an app better and faster than a Sun java App?
If for Sun everything is JAVA why they invest on C++ compilers?
Now C++ is changing and after couple of years you get C++ - 0X.
Will Sun upgrade the compiler to support thesame?
Jayaram

Dear Friend,
This excersise is absolutely pointless. It can prove nothing.
It proved C++ is powerful. You can close your eyes against truth and live in your fantacy world.
By changing int -> double you went into a muddy ground of a floating point calculations.
By moving your "toggle" objects from heap onto stack you stepped away from java semantics possibilities. No wonder C++ can win here.
Here the constructor is called only one time. Stack and heap are irrelevent. By the way margin was of couple of seconds. No C++ guy will think of JAVA semantics when programming in C++. Do you think of pointers when you program in JAVA?
Both are primitive types. Reason for moving I have specified.
Btw, its likely that compiler managed to figure out those virtual calls and inline them altogether.
I used babys of same mother. SUN. SUN CC compiler and SUN JAVA 1.6.
Its hard to say what happened in your case as you did not tell which compiler flags did you use.
Nothing hard or special in my case. It is truth. C++ WON. You can try yourself.
Its funny that you used register/inline stuff because it can hardly make any real difference in this test.
For particular C++ compiler on particular platform and compilation flags it might have an effect, but thats a third order effect of compiler bugs and inefficiencies.
Being a battle started by the benchmark person, I have the freedom to use all weapons in C++. Use whatever you have. May be you can ask SUN to put a bug in their CC compiler to prove your point. Then I will test with MSVC++ compiler.
Please not I didn't change the end output or logic. Pointers where not required So removed. I was in the office work when I did this. I am not a full time evangelist.
Compiler option. If you understand JVM then it uses onthe fly profiling, compiler optimization etc.. So I used compiler Compiler switch is very much reasonable.
Anyway, the bottom point is that different languages are suitable for different purposes.
Creatively tweaking your programming environment you can make any given combination of particular language/compiler/program to win a race.
First point is right. C++ is a general purpose language. For each specific purpose use only those parts. JAVA is a simple language suitable for normal brains.
Whats ever you tweak for JAVA it is an interpreted language. Additional layer of JVM is there. So native languages may be even pascal and Basic will win JAVA in many bench marks.
Using that car analogy - sport car on a muddy track will hardly compete with an unloaded truck. Though it doesnt mean that sport car is slower.
Again your are risking. The track is not muddy. No only increment operation is done. No floating point multiplication or division. Even if it is there you don't have eany voice to complain. It is primitive type. If still you cribb I can't help.
Java reached the point when performance is not a biggest concern. For majority of applications you win a great deal more by choosing proper algorithms than by rewriting your application on some "faster" language.
Again you are mistaken. Our MAX CPUs clock speed is getting saturated. We are going for multicore architectures. All apps are not parallel. So single core performance is important. So if you can loose the fat in your language always it is better.
Algorithems don't assure that they won't use floating point opration. And the choice of an algorithm is not propritary right of JAVA. Any language can use it.
So the point is don't compare performance of JAVA withh C++ and get patents for the same. It won't take much time for a person like me to break the patents and prove you are wrong.
If you see the url I am given, go three levels up. The test case is the one in the benchmark which had the highest margin of JAVA Win. So Your best result is ruined in a couple of hours!!!!.
Ok letme come back to the point. Why is the C++ team of Sun silent?
I feel they are not funded properly for development or they were told to keep their mouth shut.
I would like to hear from the C++ team of Sun if any one reads this belong to that team.
Reagrds,
Jayaram Ganapathy

Similar Messages

  • Java io and Java nio, which is faster to binary io?

    Anybody can advise me about java io and java nio ?
    I want to write the faster code to read and write binary files.
    I'm going to read/write
    - individual elements (int, double, etc)
    - arraylists
    - objects
    Also I'm going (or I'd want) to use seek functions.
    Thanks

    Anybody can advise me about java io and java nio ?
    I want to write the faster code to read and write binary files.Which is "faster" depends on exactly how you're using them. For example, a MappedByteBuffer is usually faster for random access than a RandomAccessFile, unless your files are so large (and your accesses so random) than you're constantly loading from disk. And it's not at all faster for linear uni-directional access than a simple FileInputStream.
    So, rather than expecting some random stranger telling you that one is faster than the other without knowing your project, perhaps you should tell us exactly how you plan to use IO, and why you think that one approach may be faster than the other.

  • Sun Java Version Mgmt, Which Version, Deployment Methods

    All,
    We are preparing to deploy the Enterprise Portal NW04s (7.0).  We've realized that we have many different versions of Sun/Microsoft Java deployed around the organization.  I'm looking for advice around a few questions. 
    1.  Which version of Sun Java should we standardize on?  We're assuming the latest which is 1.6.0_03.
    2.  How have other organizations deployed this?  Batch scripts, logon scripts??  We do NOT have SMS or other deployment tools.
    3.  Is there a way to auto detect when launching the portal if someone has the right java JRE and if not to prompt them for an upgrade?
    Thanks very much, any assistance is appreciated.
    Ethan Hill
    Greene Tweed & Co.

    JVM of end users should not create trouble. Any JVM should do good in most cases. For portal users, browser version matters the most.
    The best place to find the information you need is the platform availability matrix.
    https://websmp202.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000651812&
    Regards,
    Prasanna Krishnamurthy

  • ColdFusion compatibility with Sun Java System Application Server

    Background: A vendor that is doing a project for our
    department told us that ColdFusion MX 6.1 is not compatible with
    Sun Java System Application Server Enterprise Edition 8.1 and
    beyond. Since we are migrating our server environment to this
    release of Sun Java System Application Server Enterprise Edition,
    we face a difficult situation in that our ColdFusion applications
    will no longer run. Thus, we would like Adobe to answer a couple
    questions which will help us determine what course of action we
    ought to take.
    Q: Will applications we developed using ColdFusion MX 6.1 run
    on Sun Java System Application Server Enterprise Edition 8.1? Below
    is a detailed description of the Sun Java System Application Server
    Enterprise Edition we intend to migrate to.
    Q: Is Adobe aware of any compatibility issues with this
    configuration?
    Q: What is Adobe's support commitment regarding future
    releases of ColdFusion MX and Sun Java System Application Server
    Enterprise Edition? Does Adobe intend to continue support this
    environment?
    Configuration: Sun Java System Application Server Enterprise
    Edition 8.1_02 (build b24-p11)
    Below is the specification levels for the 8.1 server
    (J2EE1.4), note it can use J2SE 1.4.2_06 or 5.0 as the JAVA
    runtime.
    J2EE 1.4 compatible
    Components: J2SE 1.4.2_06 or J2SE 5.0
    Application and Application Client
    Enterprise JavaBeans (EJB) 2.1
    Java Servlet 2.4
    JavaServer Pages(JSP) 2.0
    J2EE Connector Architecture 1.5
    JMX 1.2
    JMS 1.1
    Java Naming and Directory Interface (JNDI) 1.2
    and Java Transaction API (JTA) 1.0
    Web Services:Java Web Services Developer Pack 1.5
    Java APIs for XML Registries (JAXR) 1.0
    Java API for XML-based Remote Procedure Calls (JAX-RPC) 1.1
    SOAP With Attachments API for Java (SAAJ) 1.2
    WS-I Basic Profile 1.0
    Other:J2EE Deployment 1.1
    J2EE Management 1.0
    Java API for XML Processing (JAXP) 1.2
    JavaMail 1.3
    Java Authentication and Authorization Service (JAAS) 1.0
    Java Authorization Contract for Containers (JACC) 1.0

    First of all, is there a reason why you are using jRockit?
    Since the issue appeared after upgrading the windows, the issue would potentially be in the interaction between JVM and OS.
    Also, there were some issues related to memory leak that were fixed in AS 8.2.
    May be you should try with a Sun JVM and AS 8.2.

  • WebUtil DLL files location with OAS v10.1.2.3 with Sun Java 1.5

    Question about the future Client (under MS Vista) which works with OAS.
    With MS Vista on the client, the certified versions are:-
    -Clientside: Sun Java 1.5_10 and above
    -OAS: v10.1.2.3 (apparently to be released in March 2008)
    See table and notes at
    http://www.oracle.com/technology/products/forms/htdocs/10gr2/clientsod_forms10gr2.html
    Our application uses Oracle Web Util 1.0.6.
    When this first starts up the server attempts to copy three DLLs (jacob.dll JNIsharedstubs.dll d2kwut60.dll ) to a particular directory (eg c:\program files\oracle\J-Initiator 1.3.1.18\bin ).
    This has been a problem for my company's infrastructure since that directory is not writeable for most end-users. We got round the problem by creating a script run just once by the end-user which placed the DLL files in position before application is first run. The application still tries so copy the files, and fails - but this does not matter.
    In the MS Vista client envt we will have the Sun Java 1.5 client instead of the J-Initiator.
    Is it clear into which directory those three DLL files will be placed with this new client-side setup?
    Thanks.
    Earlier related post: Webutils - controlling where jacob.dll and co are set on client
    Message was edited by:
    user451945

    Hello Jacob,
    Oracle itself can fix the WebUtil issue with downloading DLLs to an appropriate location. However, there's more to running a Forms application on Vista - some of which Sun needs to find a solution for:
    If Vista's User Account Control (UAC) feature is activated - which it is by default and which provides additional security compared to XP - Internet Explorer runs in protected mode, i.e. the iexplore.exe process is started with a LOW integrity level. In Vista every securable operating system "object" is assigned an integrity level - process, files, directories etc. each have an integrity level which can have the values low, normal / user, high / administrator or system. Every process started by a normal user will be assigned normal / user integrity level on process creation and thus is able to access all the files to which the user has access rights. The exception to the rule is Internet Explorer which is started with a low integrity level so if any malware / Javascript / IE extension takes control over Internet Explorer it cannot access any files or directories outside of its low integrity level "jail" because process with a lower integrity level aren't allowed to access any objects which have a higher integrity level. This means any program - including the Java plugin and any applet whether signed or not - which runs inside the iexplore.exe process cannot communicate with any process the user started (think about WebUtil's OLE2 to communicate with Office applications) and it cannot download any files to a user-specified directory (think of WebUtil's download features or even client_textio). Furthermore any processes you start e.g. through WebUtil's client_host command will inherit IE's low process integrity level and thus will not be able to do anything meaningful either. The same goes for your own DLLs which run within iexplore.exe.
    Java 1.6 Update N will change the Java plugin architecture so that the Java runtime will execute in its own process with a normal / user integrity level and communicate with Internet Explorer via IPC instead of running within the internet explorer process. If you need more information look at the early access release of Update N:
    https://jdk6.dev.java.net/6uNea.html#Overview
    I think it would help if you also opened an SR so Oracle support knows there are more customers waiting for a solution.
    Best regard
    Andreas
    Message was edited by:
    leidner

  • Sun java convergence error - Message no longer exist

    Hi
    Sun Java(tm) System Messaging Server 7.3-11.01 64bit (built Sep 1 2009)
    libimta.so 7.3-11.01 64bit (built 19:44:36, Sep 1 2009)
    Using /opt/sun/comms/messaging64/config/imta.cnf (not compiled)
    SunOS 5.10 Generic_141445-09 i86pc i386 i86pc
    We moved mailboxes from one server to another. After that we have problems with some accounts. Users see their messages in Sun Java Convergence but can't open and read it. Error appears: Message no longer exist. We tried reconstruct command but it didnt helped.
    Thanks in advance

    luk4s1984 wrote:
    Did you also transfer across the mboxlist database? Were both the source/destination Messaging Server instances down when you performed the move?I didn't move mboxlist database and bouth source and destination instances were up.This method of migrating mailboxes is bound to cause problems. Why did you choose to use this method rather then use the rehostuser command?
    Did you change the users mailhost: parameter?I didn't changed mailhost.Do both the source and destination systems have the same hostname?
    What exact reconstruct command(s) did you run?reconstruct -aIf you run "reconstruct -r user/<uid>" for one of the accounts reporting problems, are any errors reported?
    Check the imap and http log files when the error occurs -- do you see any errors?There is no errors in imap and http logs.Interesting. Which emails return "message no longer exists"?
    Newly delivered (unread) emails, emails delivery prior to migration, emails delivered after migration or some combination of all three?
    Regards,
    Shane.

  • How to make weblogic proxy to work on Sun Java system web server 7?

    Hi Every one,
    I am working on upgrade our Sun one 6.1 webserver to Sun Java system web server 7. Our website uses weblogic server to process jsp, web server only send static pages. I did all configurations as on Sun one. But somehow, the webserver does not forward "get jsp page" request to weblogic. The log record is:
    for host 10.78.124.118 trying to GET /home.jsp, send-file reports: HTTP4142: can't find /www/a/WebServer7/docs/bmd9i/home.jsp (File not found)
    home.jsp is at weblogic server.
    And redirect "NameTrans fn="redirect" from="/" url="/home.jsp"" seems does not work. when I type on IE http://32.69.253.131/ (32.69.253.131 is http listener IP), it always shows index.html page under the document root.
    Could some on can help? I am the first time to configurate web server. Thanks in advance.
    The configuration files are like:
    1. magnus.conf
    # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
    # Use is subject to license terms.
    Init fn="load-modules" funcs="wl_proxy,wl_init" shlib="/www/a/WebServer7/weblogic6.1sp6/libproxy.so"
    Init fn="wl_init"
    2. obj.conf
    # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    # Use is subject to license terms.
    # You can edit this file, but comments and formatting changes
    # might be lost when you use the administration GUI or CLI.
    #<Object name="weblogic">
    #Service fn="wl_proxy" WebLogicCluster="32.69.253.86:7210" ConnectTimeoutSecs="240" ConnectRetrySecs="60"
    #</Object>
    <Object name="default">
    <Client method="TRACE">
    AuthTrans fn="set-variable" remove-headers="transfer-encoding" set-headers="content-length: -1" error="501"
    </Client>
    #AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
    NameTrans fn="strip-params"
    NameTrans fn="redirect" from="/" url="/home.jsp"
    NameTrans fn="redirect" from="/index.jsp" url="/home.jsp"
    NameTrans fn="redirect" from="/index.html" url="/home.jsp"
    NameTrans fn="document-root" root="$docroot"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/www/a/WebServer7/lib/icons" name="es-internal"
    NameTrans fn="home-page" path="index.html"
    <If $uri =~ "/*.jsp">
    Service method="(GET|HEAD|POST|PUT)" fn="wl_proxy" WebLogicCluster="32.69.253.86:7210" ConnectTimeoutSecs="240" ConnectRetrySecs="60"
    #Service method="(GET|HEAD|POST|PUT)" type="text/jsp" fn="wl_proxy" WebLogicCluster="32.69.253.86:7210" ConnectTimeoutSecs="240" ConnectRetrySecs="60"
    </If>
    PathCheck fn="unix-uri-clean"
    PathCheck fn="check-acl" acl="default"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-compressed" check-age="off" vary="on"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain" charset="iso_8859-1"
    ObjectType fn="set-default-type" charset="iso_8859-1"
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="send-error"
    Service method="(GET|HEAD)" type="*~magnus-internal/*" fn="send-file"
    AddLog fn="flex-log" name="access"
    </Object>
    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>
    <Object name="send-precompressed">
    PathCheck fn="find-compressed"
    </Object>
    <Object name="compress-on-demand">
    Output fn="insert-filter" filter="http-compression"
    </Object>
    3.mime.types
    I add one line: type=text/jsp exts=jsp

    Quick obvious question - Are you positive you're editing the correct obj.conf? Check the config directory and see if there is a second one called something like <instance>.obj.conf (where <instance> is the name of your configured instance).
    Alternatively you can grep for object-file in the server.xml to see which obj.conf the server is using:
    # grep object-file server.xml
        <object-file>bare-php.obj.conf</object-file>Assuming that you are editing the correct obj.conf file, are you making certain to restart Web Server after making your changes?

  • Regarding Sun Java System Application Server Issue with JVM

    Regarding Sun Java System Application Server Issue with JVM
    Hi
    I have installed SJSAS9.1 on solaris system. I m trying to deploy war file which i compiled in windows enviorment by jdk1.5.0_05. Every time i got the following error :
    type Exception report
    message
    descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP
    PWC6199: Generated servlet error:
    [javac] javac: invalid target release: 1.5
    [javac] Usage: javac
    [javac] where possible options include:
    [javac] -g Generate all debugging info
    [javac] -g:none Generate no debugging info
    [javac] -g:{lines,vars,source} Generate only some debugging info
    [javac] -nowarn Generate no warnings
    [javac] -verbose Output messages about what the compiler is doing
    [javac] -deprecation Output source locations where deprecated APIs are used
    [javac] -classpath Specify where to find user class files
    [javac] -sourcepath Specify where to find input source files
    [javac] -bootclasspath Override location of bootstrap class files
    [javac] -extdirs Override location of installed extensions
    [javac] -d Specify where to place generated class files
    [javac] -encoding Specify character encoding used by source files
    [javac] -source Provide source compatibility with specified release
    [javac] -target Generate class files for specific VM version
    [javac] -help Print a synopsis of standard options
    note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1 logs.
    I have cheked jvm version on both system the only difference is :
    Solaris points to jdk 1.5.0_09
    Windows point to jdk1.5.0_05
    Even i tried to run blank jsp also but again i got the same error.
    Can any help me to sort out the problem or give me any idea so i can do something by my own.
    Thanks in Advance
    Gagan

    Do you have ANT installed and available?
    Thanks,
    Kedar

  • Help needed with Sun Java Studio Creator and EJB in a Portlet Project

    Hi
    I have created an web-application with JSF in Sun Java Studio Creator 2. The web application uses a lot of EJB's which acts as the dataProviders. In a typical jsp page i have more that one data providers(the EJB's) getting used. When i run the project everything opens up properly in the browser and the application seems to be fine.
    But when i create a JSP 168 Portlet project and do exactly the same thing for some reason the Apache Pluto(comes as the default Portlet Container with Studio Creator) conks off.
    Then i started going ahead step by step:
    1. First i created a portletpage and added only one dataProvider(EJB) and ran the project...It gets deployed properly in Pluto and the browser comes up and everything shows up fine.
    2. Just to re-confirm i did the same thing with another dataProvider(EJB). So still we have just 1 EJB in the portlet page. As expected it also worked fiine.
    3. Then when I added more that one dataProviders(EJBs) in the porlet page the Apache Pluto conks off(saying that Pluto is not available)
    I tried doing a lot of things but nothing works...Surprisingly the same thing works when u create a JSF web Application project but the same thing does not work when u create a JSR 168 JSF Portlet Project...
    Did anybody face the same problem..Is it a bug in the Studio Creator...Any help would be highly appreciated.

    Hi,
    There are a few discussion threads in the feedbackprograms portal for Creator 2 EA 2. The URL is:
    https://feedbackprograms.sun.com/login.html
    In the EA discussion forum you will find threads which discuss the concerned topic. In specific look for threads titled:
    # Deploying Portlets
    # Taking a JSC Portlet to Tomcat creates a Faces Mapping Error
    # Problem with Pluto when trying to deploy a portlet
    # Request: JSR-168 Portlet Project without JSF
    We kindly request you to post your further queries related to EA in the above mentioned forum.
    Cheers
    Giri

  • How can I clean up queue one-time on Sun Java system messaging 6.3

    Hi,
    <address>Our Email server have a problem, When I run _./imsimta qm directory tcp_local_, There are about 5 Millions of messages in the queue.</address>
    Now our Email server send messages very slowly, how can I clean up queue one-time?
    the command _./imsimta qclean_ is very slowly.
    What can I do to prevent this problem?
    our Email server version is :
    Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)
    libimta.so 6.3-6.03 (built 17:12:37, Mar 14 2008; 32bit)
    SunOS email-1 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V890
    Thank you !

    If you have more than 100,000 messages in the queue, then look at the MAX_MESSAGES parameter in [the job_controller.cnf file|http://wikis.sun.com/display/CommSuite/Job+Controller+Configuration+File]. If the parameter is not specified, it defaults to 100000. If you have more than that number of messages in the channel queues, it will take a long time for new/legitimate messages to be sent because job_controller is only considering the first 100,000 messages in the queue.
    If you get into the "imsimta qm" command do do "sum -database", it will show a summary of what job_controller has in its internal cache and therefore what job_controller is working on. If you compare that to "sum -directory" you will probably see a difference.
    If these are all legitimate messages, you need to increase MAX_MESSAGES, cnbuild, and restart job_controller.
    If they are not, then preventing this in the future will require determining how they got into your queue and correcting that.
    As for removing them, the "imsimta qm" commands allow you to select messages by various criteria and then you can "return" or "delete" them. But yes, that will take a long time if there are many messages because it is a single threaded process and it needs to open and examine each message. You may be able to accomplish the task more quickly with a shell script that works on individual channel queue subdirectories and then run multiple copies of that script in parallel. After you have cleaned out the queue, restart job_controller.
    Also, you might want to consider [the subdirs channel keyword|http://msg.wikidoc.info/index.php/Subdirs_and_nosubdirs_Channel_Options].

  • How to access JDBC Resource registered in Sun Java System App Server ?

    I want to create a stand-alone JDBC application with Java SE using Swing technologies and JNDI technology. The purpose of using JNDI technology is to avoid change of Java Source Code every time I move the database to different location. This Java application will be used in a standalone PC installed with Windows XP Professional with no LAN / WAN connection. Of course, Internet connection is available with the PC.
    I use JavaDB to store the data tables and the location of the database is D:\E-DRIVE\SAPDEV. Tomorrow, if I move this database to C:\SAPDEV or any network drive, I do not want to change the Java Source code. I want to use JNDI which, if I am not wrong, helps developers to avoid manual change of Java source code whenever the database location is changed. Changes have to be made only in the JNDI Name which contains all relevant information about the database in order to get connection no matter where the database SAPDEV is stored; it can be placed under D:\E-DRIVE directory or C:\ directory of the hard disk. To implement my intention, I started developing Java application as per the steps mentioned below:
    Step 1:
    To proceed, first, I sought the help of Sun Java System Application Server Admin Console. I created JNDI object for Connection Pool using the menu path Common Tasks->Resources->JDBC->Connection Pools.
    JNDI Name : ABAPRPY
    Resource Type : javax.sql.DataSource
    Datasource class : org.apache.derby.jdbc.ClientDataSource
    Description : ABAP Program Repository
    The Connection Pool creation has options for General, Advanced and Additional Settings tabs and I made all the settings relevant to the database I created in D:\E-DRIVE\SAPDEV.
    To confirm whether the above settings are correct, I pressed the Ping push button which is available in the General tab of the connection pool creation screen. The system responded with the message Ping Succeeded.
    Step 2:
    I created a JDBC Resource using the menu path Common Tasks->Resources->JDBC->JDBC Resources.
    JNDI Name : jdbc/SAPDEV
    Pool Name : ABAPRPY
    Description : Database Connection for SAPDEV database
    Status : Enabled
    I can see all the above settings recorded in the domain.xml which is placed in the folder
    C:\Sun\AppServer\domains\domain1\config
    Step 3:
    I have made sure that Sun Java System Application Server is up and running in the background with JavaDB server. I created a Java Program making sure the following JAR files are included in the classpath:
    appserv-admin.jar
    appserv-ee.jar
    appserv-rt.jar
    javaee.jar
    fscontext.jar
    Plus, the lib directory of JDK 1.6 & C:\Sun\AppServer\domains\domain1\config
    Source code of the program is as follows: I used NetBeans IDE to create my project file.
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.naming.*;
    import javax.activation.DataSource;
    public class JNDILookup {
    public static void main(String[] args) {
    try {
    InitialContext initCtx = new InitialContext();
    DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/sapdev>");
    } catch (NamingException ex) {
    Logger.getLogger(JNDILookup.class.getName()).log(Level.SEVERE, null, ex);
    When I attempted to compile the above program in NetBeans IDE ,no compilation error reported. But while executing the program, I got the following run-time error message:
    SEVERE: null
    javax.naming.NameNotFoundException: No object bound for java:comp/env/jdbc/sapdev> [Root exception is java.lang.NullPointerException]
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:224)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at SAPConnect.JNDILookup.main(JNDILookup.java:21)
    Caused by: java.lang.NullPointerException
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
    ... 3 more
    Now, I want to come out of this situation; at the same time, I want to preserve the settings I have made in the Sun Java System Application Server Admin Console. That is, I want to programmatically access the data source using Connection Pool created in Sun Java System Application Server Admin Console.
    I request dear forum members to provide me an appropriate solution.
    Thanks and regards,
    K. Rangarajan.

    jay44 wrote:
    Bare in mind I am attempting the context.lookup() from inside the container (my code is in a session bean). I have accessed the server and have my bean "say hello" first to verify the bean works OK, then I call a method with this rather standard code:
    String jndiDataSourceName ="Second_EJB_Module_DataBase";
    Logger.getLogger(DynamicPU.class.getName()).log(Level.INFO,"Programatically acquiring JNDI DataDource: "+ jndiDataSourceName);
    InitialContext ctx;
    try {
    ctx = new InitialContext();
    ds =(DataSource)ctx.lookup("java:comp/env/jdbc/"+jndiDataSourceName);
    } catch (NamingException ex) {
    Logger.getLogger(DynamicPU.class.getName()).log(Level.SEVERE, null, ex);
    return "Exception generated trying to preform JDBC DataSource lookup. \n"+ex.toString();
    But when I run the code the server log shows the initial context is created Ok, but an exception is thrown becasue the resource name is not found:
    (and i have tried vriations of ctx.lookup("jdbc/"+jndiDataSourceName) etc etc
    You are fine here. It works in container because the InitialContext properties have been supplied already. That was the link I forwarded earlier. The InitialContext you create locally needs to locate the container JNDI. That is what the properties specify.
    Where I am confused is where you indicate the stack below is from the server log. So, you initiate a standalone (java main method) application, create an InitialContext, and you see the results in your app server log?
    LDR5010: All ejb(s) of [EJB_Module_1] loaded successfully!
    Programatically acquiring JNDI DataDource: Second_EJB_Module_DataBase
    The log message is null.
    javax.naming.NameNotFoundException: Second_EJB_Module_DataBase not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:192)...
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    This is strange since I can see this resource (a JDBC connection named Second_EJB_Module_DataBase) is configured on the server from the server's admin console.
    That is why you can obtain a lookup from within the container (app server).
    For this lookup to work it may be that one must map the name inside an ejb-jar.xml deployed with the application, but I have also read some resources like jdbc connection should have a default name. Does anyone know if my lookup() should work without using an ejb-jar.xml mfile to explcitly map the reource for my application?
    Both EBJ's and data sources can be referenced via JNDI. It's a remote lookup (that is normally optimized if it is running in the same JVM). You should not have any dependencies on a JDBC data source being set-up on ejb-jar.xml. That file can of course impact your EJB's. However, data sources are normally set-up on a container-specific basis (e.g., you probably did it through a console, but there is a spec somewhere about how to set up a data source via a resource the app server looks for; it varies from app server to app server). However, once you have that container-specific data source set-up, JNDI operates vendor-neutral. You should be able to take the code above and move it to JBoss or Weblogic or Tomcat or whatever (this is an ideal, in practice, the vendors sometimes put a data source in a name you would not expect, but again, you can use their JMX console to see what the JNDI name is).
    (As I stated above if I have to use a deployment discriptor to get at this JNDI datasource, then solution is not "programmatic" as newly configured datasources could not be accessed without redeploying the entire application).
    As JSchell alluded to, you will always have at least something vendor-specific. JNDI itself (the code you wrote) is totally portable. However, you have to set the various JNDI environment properties to a given vendor's spec. Ideally, you should not need a vendor's actual InitialContext application, but it's a possibility. Once you can safely cast to Context, you should be vendor-neutral (if not, demand your money back).
    So that is exactly where I am stuck, trying to get the lookup to work and wondering if it should work without and xml file mapping the resource for my app.
    What we ended up doing for standalone was to provide our own JNDI. If you look at the open source project JOTM, there are examples on how to use that with XBean (if integrating with Spring, as we did), you can easily set up a data source that runs standalone exactly as you get in the container. Another benefit is you get full JTA/JTS support and the ability to run XA transactions. (This might all be alphabet soup, but the app server gives it to you, and this is the way we ended up doing the same: JNDI + JTA + JTS + XA). It ends up the same application code uses a "vanilla" InitialContext and all we have to do is write one or two xml files (one for our app server, a couple for JOTM), and our actual code works the same.
    I still think you have a shot at getting to the container's JNDI, just not using their full-blown app server JAR.
    I think there must be a simple way to do this with an ejb-jar.xml, I am no expert in JNDI, I could be missing something simple, I will keep at it and post an answer here if I come up with it.
    Thanks, jayIt is simple to code. Getting it to integrate with your app server, yes, that can be challenging. But it has nothing to do with EJB's. Write a simple test. Using nothing but DataSource and InitialContext. Let us know where you get stuck.
    - Saish

  • Error while running Sun Java Webserver 6.1 configtest option

    hi all,
    Need help on the following. My environment is Liunx OS and Sun Java Webserver installed on Linux
    I added the following lines to Sun Java Webserver's magnus.conf file to include my NSAPI filter.
         Init fn="load-modules" shlib="/space/esnta068-1/SUNWwbsvr/plugins/vgnnsapi6.so" funcs="vgn_init,vgn_nametrans"
         Init fn="vgn_init" PZN_AUTO_COOKIE_TRACKING="true" PZN_AUTO_URL_TRACKING="true"
    and the magnus.conf file after adding the above is as follows. I made necessary changes to obj.conf file also.
    # The NetsiteRoot, ServerName, and ServerID directives are DEPRECATED.
    # They will not be supported in future releases of the Web Server.
    NetsiteRoot /space/esnta068-1/SUNWwbsvr
    ServerName esnta068.aus.lab.com.
    ServerID https-esnta068.aus.lab.com.
    RqThrottle 128
    DNS off
    Security off
    PidLog /space/esnta068-1/SUNWwbsvr/https-esnta068.aus.lab.com./logs/pid
    User hsangava
    StackSize 131072
    TempDir /tmp/https-esnta068.aus.lab.com.-a0fe7799
    Init fn=flex-init access="$accesslog" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
    Init fn="load-modules" shlib="/space/esnta068-1/SUNWwbsvr/bin/https/lib/libj2eeplugin.so" shlib_flags="(global|now)"
    # for Visitor Profiling Plug-in
    Init fn="load-modules" shlib="/space/esnta068-1/SUNWwbsvr/plugins/vgnnsapi6.so" funcs="vgn_init,vgn_nametrans"
    Init fn="vgn_init" PZN_AUTO_COOKIE_TRACKING="true" PZN_AUTO_URL_TRACKING="true"
    When I use the following command at managed server's directory I am getting 'configuration test failed' error as follows
         [root@esnta068 https-esnta068.aus.lab.com.]# ./start -configtest
         Sun ONE Web Server 6.1SP2 B04/07/2004 17:54
         [14/Sep/2005:06:22:03] info (12656): CORE1116: Sun ONE Web Server 6.1SP2 B04/07/2004 17:54
         failure: configuration test failed
         [root@esnta068 https-esnta068.aus.lab.com.]#
    When I try to start the server I am getting following error in the error log.
    [14/Sep/2005:06:25:14] info (12724): CORE1116: Sun ONE Web Server 6.1SP2 B04/07/2004 17:54
    [14/Sep/2005:06:25:14] catastrophe (12724): CORE3260: Server crash detected (signal SIGSEGV)
    [14/Sep/2005:06:25:14] info (12724): CORE3261: Crash occurred in NSAPI SAF load-modules
    If I remove the lines related to my filter in magnus.conf file, configtest passed and Server is working fine.
    Can anyone help me resolve these issues?
    Regards
    Harish

    As you suggested I have used the same compiler to compile the source files, later I configured the same in magnus.conf.
    In core dump, I ended up with the following errors.
    (gdb) where
    #0 0xb5ccae52 in std:: list<std:: pair<VgnHTTPRequestHandler*, bool> (*)(std:: map<std:: string, std:: string, vgn_iless, std:: allocator<std:: pair<std:: string const , std:: string> > > const& ), std:: allocator<std:: pair<VgnHTTPRequestHandler*, bool> (*)(std:: map<std:: string, std:: string, vgn_iless, std:: allocator<std:: pair<std:: string const, std:: string> > > const& ) > >:: begin (this=0xb5cdaa60) at stl_list.h:365
    #1 0xb5ccf48a in std:: list<std:: pair<VgnHTTPRequestHandler*, bool> (*)(std:: map<std:: string, std:: string, vgn_iless, std:: allocator<std:: pair<std:: string const, std:: string> > > const& ) , std:: allocator<std:: pair<VgnHTTPRequestHandler*, bool> (*)(std:: map<std:: string, std:: string, vgn_iless, std:: allocator<std:: pair<std:: string const , std:: string> > > const& )> >:: push_front (this=0xb5cdaa60, __x=@0xbfff4e00)
    at stl_list.h:471
    #2 0xb5ccd557 in VgnHTTPRequestHandler:: registerHandlerFactory (
    fp=0xb5ccc030 <VgnVisitorIDHandler:: create(std:: map<std:: string, std:: string, vgn_iless, std:: allocator<std:: pair<std:: string const, std:: string> > > const& ) > ) at VgnHTTPRequestHandler.h:99
    #3 0xb5ccc029 in RegisterFactory (this=0xb5cdaa64,
    fp=0xb5ccc030 <VgnVisitorIDHandler:: create(std:: map<std:: string, std:: string, vgn_iless, std:: allocator<std:: pair<std:: string const, std:: string> > > const& ) > ) at VgnHTTPRequestHandler.h:111
    #4 0xb5ccbfe5 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ../common/VgnVisitorIDHandler.cpp:10
    #5 0xb5ccc006 in global constructors keyed to _ZN19VgnVisitorIDHandler15registerFactoryE () at VgnHTTPRequestHandler.h:51
    #6 0xb5cd4385 in __do_global_ctors_aux () from /space/esnta068-1/SUNWwbsvr/plugins/vgnnsapi6.so
    #7 0xb5cc6115 in _init () from /space/esnta068-1/SUNWwbsvr/plugins/vgnnsapi6.so
    #8 0xb75f7921 in dlinit_internal () from /lib/ld-linux.so.2
    #9 0xb689d522 in dl_open_worker () from /lib/tls/libc.so.6
    #10 0xb75f76d6 in dlcatch_error_internal () from /lib/ld-linux.so.2
    #11 0xb689cf9c in dlopen () from /lib/tls/libc.so.6
    #12 0xb696cffb in dlopen_doit () from /lib/libdl.so.2
    #13 0xb75f76d6 in dlcatch_error_internal () from /lib/ld-linux.so.2
    #14 0xb696d4b6 in dlerrorrun () from /lib/libdl.so.2
    #15 0xb696cfa4 in dlopen@@GLIBC_2.1 () from /lib/libdl.so.2
    #16 0xb74b2c7c in dll_open2 () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #17 0xb74ef0e8 in mark_func_cacheable () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #18 0xb74ef34f in load_modules () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #19 0xb74c0e00 in func_exec_str () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #20 0xb74c0f65 in INTfunc_exec () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #21 0xb74bdeba in conf_is_late_init () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #22 0xb74bdf4d in INTconf_run_init_functions () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #23 0xb7526e00 in WebServer::Run () from /space/esnta068-1/SUNWwbsvr/bin/https/bin/../lib/libns-httpd40.so
    #24 0x0804879f in ?? ()
    #25 0xb67a5768 in __libc_start_main () from /lib/tls/libc.so.6
    #26 0x08048671 in ?? ()
    Current language: auto; currently c++
    Could you help me anything to resolve the errors and go ahead of this step?

  • Sun Java System Portal Server 6.0 FAQs

    Sun Java System Portal Server 6.0 FAQs.
    Author: Sanjeev Agarwal
    Q. How to connect to external URLs from Sun ONE Portal Server? I want to use URL Scrapper for some of external sites/URLs.
    Ans:
    You can connect to external URLs if you have a Proxy Server running.
    If you are using Web Server addition of Sun ONE the Portal Server then
    go to /opt/SUNWam/servers/https-hostname.domainname/config/ dir
    In the jvm12.conf file, enter the followings:
    http.proxyHost=proxyservername.domainname
    http.proxyPort=80 (or the appropriate proxy server port number)
    https.proxyHost=proxyservername.domainname
    https.proxyPort=80 (or the appropriate proxy server port number)
    If you are using Sun ONE AppServer addition of Sun ONE Portal Server then
    go to /var/opt/SUNWappserver/domains/domain1/<server-instance>/config dir
    In the server.xml file, enter the followings:
    <jvm-options>-Dhttp.proxyHost=proxyservername.domainname </jvm-options>
    <jvm-options>-Dhttp.proxyPort=80 (or the appropriate proxy server port number) </jvm-options>
    <jvm-options>-Dhttps.proxyHost=proxyservername.domainname </jvm-options>
    <jvm-options>-Dhttps.proxyPort=80 (or the appropriate proxy server port number) </jvm-options>
    After this modification restart the server.
    Q. Explain all the processes (solaris 8 and S1 Portal Server 6.0) which runs when I start the Sun ONE Portal Server.
    Ans.
    These are the processes that a running Portal Server installation (Sun ONE WebServer addition, without SRAP) generally has by default.
    1. Directory server processes:
    - ns-slapd (LDAP server instance)
    - uxwdog (admin server process) (parent process)
    --- ns-httpd
    ----- ns-httpd
    2. Auth Helper processes:
    - doUnix
    3. Web-Server/Identity-Server/Portal-Server processes:
    As the Portal Server and Identity Server runs as web application on the Web Server, so they share the same JVM and processes.
    - uxwdog (web server admin server process) (parent process)
    --- ns-httpd
    ----- ns-httpd
    (for each web server instance)
    - uxwdog (parent process)
    - ns-httpd
    - ns-httpd
    or (in case of MaxProc=n )
    - uxwdog (parent process)
    --- ns-httpd
    ----- ns-httpd
    ----- ns-httpd
    ----- n
    Q. I have created a custom Provider but getting this error when I access the desktop, what do I do?
    > error in the desktop.debug file:
    > ERROR: DesktopServlet.handleException()
    > java.util.MissingResourceException: Can't find bundle for base name CustomTabContainerProvider,
    Ans:
    It needs a resource bundle for the custom provider. You need to create a file CustomTabContainerProvider.properties (as mentioned in the error message) and put it into the /etc/opt/desktop/classes directory. If you are not using any properties defined in this resource file then it can be a empty file. Have a look on the properties files that bundled containerProviders uses in dir <portal-install-dir>/SUNWps/web-apps/https-<host.domain>/portal/WEB-INF/classes.
    As you are extending JSPTabContainerProvider class, you can just copy the file JSPTabContainerProvider.properties from the above directory after renaming it to the <defined-provider-name>.properties (in your case CustomTabContainerProvider.properties) and move it into /etc/opt/desktop/classes directory.
    Q. what is actually multiple instances of Portal Server means?
    Ans:
    Multiple instance of Portal Server means, you will have more http listeners for the same desktop contents and the same identity profiles stored in a single Directory Server which all the instances share.
    In simple words you can have your Portal Server listening on different http ports, but uses same configuration, desktop and identities.
    It can help you to share the load for Portal Server http requests. The alternate methods are to create more web server virtual server processes (maxProc=n, but in this case the listening port will be 1 only) or use some hardware load balancer.
    You can achieve more from multiple instances if you have a multi level organization, you can change the look and feel of all the instances, images, services, components and can assign each instance to different organization or sub-organization.
    Q. How do I check the availability of the Sun ONE Portal Server/Identity Server services.
    Ans:
    You can check the availability of Sun ONE Identity Server services from following urls.
    http://<host.domainname>:<port>/amserver/sessionservice
    http://<host.domainname>:<port>/amserver/loggingservice
    To know the availability of components of Sun ONE Portal Server like Desktop/providers/Rewriter/Netmail you have to login into desktop. These are not services, but just the programming identities which will work if your Web Server and Identity Server is running.
    Just go to URL http://<server>:<port>/portal/dt , if it shows up that means your portal server is fine, and these entities will work for sure.
    Q. I am able to add the yahoo channels to existing users. But I am getting the weather for London not for local New Jersey. My language pref is to en|en_US and also the server is the default U.S server and not europe. How do I add the cities I want to see on weather channel?
    Ans:
    A Portal user himself (after login) can select what cities he want to see in weather channel.
    Steps:
    - click the edit button of weather channel
    - click on the area you belong to from Available Sections
    - select the cities from Available Cities select box and add them to Your Choices.
    - click finished from select city page and then again click finished from select area page.
    It will come back to the Portal Desktop and you will see all the cities you have selected in the weather channel.
    Q. How to use getContent() method to use in custom jsp providers (developed by ourselves) so that it can be used to retrieve a jsp page. I have already placed the JSP file in the directory structure /etc/opt/SUNWps/desktop/default/channel_dir. But still the jsp is not being displayed.
    Ans:
    You don't have to do anything in the custom JSPProvider's getContent method except the call { return super.getContent(request,response); } . If all you want is just to show your jsp, then create a channel from the default JSPProvider, and edit the property contentPage of that channel from samplecontent.jsp to your jsp name, save the changes and login again. You should see your JSP.
    Q. I want to remove all the buttons (help/edit etc.) from all the channels/one particular channel in my desktop?
    Ans:
    You can hide any buttons you want from any channel.
    These steps show how to hide all the buttons.
    1. Create a channel say "myNetlet" from netlet provider.
    2. Set the channel title to "myNetlet"
    3. Go to the dir /etc/opt/SUNWps/desktop/default/JSPTableContainerProvider and edit the file providerCommands.jsp, and modify the last line :
    from :
    <%=minMaximizeCommand%><%=helpCommand%><%=editCommand%><%=detachAtachCommand%><%=removeCommand%>
    to:
    <% if ( !(title.equals("myNetlet"))){ %><%=minMaximizeCommand%><%=helpCommand%><%=editCommand%><%=detachAtachCommand%><%=removeCommand%><% } %>
    4. Clean the dir mentioned below which contains compiled JSPs. /var/opt/SUNWps/https-<host>.<domain>/portal/tmp/_jsps/_etc/_opt/_SUNWps/_desktop/_default_en/_JSPTableContainerProvider/_html and reload the page.
    Relogin, and you would not see any buttons on "myNetlet" channel. You can customize this logic as per your needs.
    Q. How to change the title of SampleJSP Channel. I tried to change the channel properties title value via iplanet directory Server Access Management GUI. But it is not getting reflected.
    Ans:
    Through Admin console you can change the channel property "title", and as soon as you refresh the page (Shift reload) of relogin in the portal it get's reflected.
    The reason to this problem may be due to the channel property "title" is having "propagate" value as false and you are setting the channel title in the org level display profile not in the user level display profile.
    So better you change the channel name in user's display profile also.
    For this login into admin console and go to :
    - View: "User Management" -> click on organization -> Show: Users
    - click on the blue arrow of that user
    - click on Edit in section Desktop (this will open a window)
    - then change the channel properties same way you do for Organization display profile.
    Q. Login Problem with SunOne Portal 6.0.
    I was able to download and install sun one portal 6 on Solaris 8. The sample portal page came up after installation. However whenever I try to login to the Login channel with "amadmin" and the passphrase I used during installation, it takes me to another page - iPlanet/LDAP authentication page. Here I tried using the same login, but fails every time (the same login page appears). The url that shows is "http://<hostname>/amserver/login?module=dproadmin&goto=/amconsole/base/AMAdminFrame"
    I tried registering myself as a new user as well. This too fails.
    Ans:
    Make sure you are giving fully qualifying the hostname in the url which invoked the desktop. This in fact is documented in the administration documentation. If the hostname is not fully-qualified, the login page goes into an endless mode. Again, the correct url is "http://<fully-qualified-hostname>/portal". Once you get to the desktop, the login and the new user registration works.
    Q. How to send variables/parameters from 1 app to another app deployed on Sun ONE Portal Server? It may be the apps or different JSPs of JSP provider channel.
    How to achieve inter channel communication in Sun ONE Portal Server?
    Ans:
    You can use servlet context object or session, or may be the request object itself to store the information from one channel and use that in another channel. The use of either of these 3 approaches may depend on your requirements. Using session, the information will be available to that user's channels only, using request, the information will be available for that user and that request only and by using ServletContext you can share the information across users and sessions. You can obtain DesktopServlet's ServletContext object inside JSP/JSPProvider.
    Q. I am trying to modify the default desktop JSPs in TableContainerProvider and TabCotntainerProvider dirs, but it is not picking my modified JSPs ? what do I do?
    Ans:
    One easiest way to 100% ensure that it updates all your new jsp pages is to remove all the compiled jsps so that with next request the Sun ONE Portal Server compiles all the jsps and will make sure that your modification will be taken care of in next request.
    Go to /var/opt/SUNWps/https-<instance_name>/portal/tmp/_jsp/_etc/_opt/_SUNWps/_desktop/_default_<locale>/ and remove everything. and access the Portal server, it will be little slow as it has to compile all the JSPs again. Here you will find directories in the name of Containers and Channels, so if you are modifying any particular Container/Channel you can just delete that only. This approach can help a lot during development time.
    Q. What is the location of compiled JSPs in Sun ONE portal Server and what servlet spec does it supports?
    Ans: The Portal server 6.0 runs on Sun ONE Web Server 6.0 sp2, which supports only jdk 1.3 and servlet spec 2.2 only. The Sun ONE Portal Server keeps the compiled jsps of desktop and channels in : /var/opt/SUNWps/https-<instance_name>/portal/tmp/_jsp/_etc/_opt/_SUNWps/_desktop/_default_<locale>/ dir as per the channels/container names.
    Servlet 2.3 is supported if you run the Portal Server edition that runs on Sun ONE Application Server 7.0.
    Q. How do I change jdk for Sun ONE Portal Server to another jdk? I want to change the JDK of only one of my Portal Server instances, is it possible? how?
    Ans:
    Yes you can achieve both.
    A. To change the JDK for all the server instances:
    Open <portal-install-dir>/SUNWam/servers/https-admserv/start-jvm file and modify the first line
    NSES_JDK=/usr/java_1.3.1_04; export NSES_JDK
    to
    NSES_JDK=<your-jdk-location> ; export NSES_JDK
    then open <portal-install-dir>/SUNWam/servers/https-<instance-name>/config/jvm12.conf file of all the server instances and add a line
    jvm.option=-server after the first line
    B. To change the JDK for a particular server instances:
    Make a another copy of the start-jvm file rename it and modify the jdk location in it as mentioned above.
    Open the start script from <portal-install-dir>/SUNWam/servers/https-<instance-name> dir and modify these lines :
    if test -r {SERVER_ROOT}/https-admserv/start-*
    then
    for STARTSCRIPT in {SERVER_ROOT}/https-admserv/start-*
    modify this to
    if test -r {SERVER_ROOT}/https-admserv/<changed_name_of_start-jvm-file>
    then
    for STARTSCRIPT in {SERVER_ROOT}/https-admserv/<changed_name_of_start-jvm-file>
    Note: As Portal Server 6.0 uses Web server 6.0 sp2, jdk 1.4 is not supported.
    Q. How do I create a custom login page or a link, which will just log me into the portal server.
    Ans:
    You can create a custom page in your jsp page, just add this portion of html into your web page :
    <FORM action="http://<server>:<port>/amserver/login?module=<login-module>&page=1" method=post name=login_form2 target=_top>
    Login page using <login-module><br>
    <P>Enter UserId<BR><INPUT name=TOKEN0 size=22></P>
    <P>Enter Password<BR><INPUT name=TOKEN1 size=22 type=password></P>
    <P><INPUT name=Submit type=submit value=Submit> </P>
    </FORM>
    The <login-module> can be LDAP or Unix or Membership which ever you have enabled. Or instead of this you can create a link. For example for LDAP auth module :
    "<a href="http://<server>:<port>/amserver/login?module=LDAP&page=1&TOKEN0=user&TOKEN1=password" target=_top> Login into Portal </a>"
    where user and password are the user credential for the portal server.
    Q. Can I install a portal server pointing to another Identity server? I want to install few postal servers (on different machines) pointing to same identity server, is it possible?
    Ans:
    No, right now the Sun ONE Portal Server is tightly integrated with Sun ONE Identity Server so you can't just install only Sun ONE Portal Server and point it to another Sun ONE Identity Server. You can have a common Directory server if you want.
    Q. I have an application which takes input in from anonymous user and then to complete the request the user than has to login. I am having problem in passing the taken input from anonymous page to logged in user. all the request parameters are lost when I log in. How do i get the request parameters after I log in
    Ans:
    You can create a custom login page and submit the form to "/amserver/login" with a hidden parameter "goto" through which you basically specify which url to go after you log in. So you can use this mechanism to create a query string with all your request parameters you want to pass after login. For example:
    You can create a jsp which take few inputs from user and to complete the request you have to login so it posts the input form to a login jsp and stores the parameters taken from user in a hidden field (goto) :
    <FORM action="/amserver/login?module=LDAP&page=1" method=post name=login_form2 target=_top>
    Login page using LDAP<br>
    <P>Enter UserId<BR><INPUT name=TOKEN0 size=22></P>
    <P>Enter Password<BR><INPUT name=TOKEN1 size=22 type=password></P>
    <INPUT TYPE=HIDDEN NAME="goto" VALUE="/portal/dt?param1=<%=request.getParameter("param1")%>&param2=<%=request.getParameter("param2")%>">
    <P><INPUT name=Submit type=submit value=Submit> </P>
    </FORM>
    After you login through this page both the param1 and param 2 will be available in the request object after you login and you can retrieve them in your application or jsp.
    Q. I have few System.out.println in my jsp which i am using in my JSP provider channel, but when I look at the portal server's /var/opt/SUNWam/debug/desktop.debug file, none are there. I looked at the web server's access and error logs too, but it is not there also. Can somebody tell me how do it get those ? Do we have any other mechanism to put debug logs ?
    Ans
    By default the binary which web server runs is uxwdog which eats up System.out.println output. If you want to see the System.out.println then you need to change the product binary from the start script of the portal server instance.
    - Go to <portal-install-dir>/SUNWam/servers/https-<instance-name> and open the start script
    - Change the PRODUCT_BIN=uxwdog to PRODUCT_BIN=ns-httpd , save the file
    - Run the script ./start to start the portal server
    Note : with ns-httpd ON the server will not leave that shell, and in the same window/shell you will be able to see all your System.out.println statements. To close the server you have to kill the server process with "kill -9 pids" command
    Alternate way is to use api inside your application or jsp:
    <%@page import="com.sun.portal.providers.jsp.JSPProvider, com.sun.portal.providers.*, com.sun.portal.providers.containers.*, com.sun.portal.providers.context.*" %>
    <% JSPProvider p=(JSPProvider)pageContext.getAttribute("JSPProvider");
    ProviderContext pc = p.getProviderContext(); %>
    <%-- after that you can use these lines any where in your jsp --%>
    <%
    pc.debugError("your error msg");
    pc.debugMessage("your msg");
    pc.debugWarning("your warning msg");
    %>
    The particular mgs will be shwon in /var/opt/SUNWam/debug/desktop.debug file as per your "debugLevel" parameter setting in /etc/opt/SUNWps/desktop/desktopconfig.properties file. By default the debugLevel is set to error so only pc.debugError("error msg") will be shown.
    Q. Multipart form (file upload) processing in providers? Is it supported
    Ans:
    The Sun ONE Portal Server's DesktopServlet does not have the ability to process a request with the content encoding type of multipart/form-data. DesktopServlet does not pass the input stream for the request on to the Provider.
    To accomplish handling of multipart/form-data type requests, it is necessary to create a companion servlet or JSP that process the multipart/form-data. This servlet can then pass control back to the Portal channel. The data from the file can be shared between the servlet and the provider by using static Java members or by storing the data in a back-end database and then passing a reference to the data over to the provider.
    Q. After installing the Portal Server I am trying to login as admin, but it is failing and coming back to login page every time. How do I login?
    Ans:
    The Default Admin user is 'amadmin' and the password is the PASSPHRASE you give during Portal Server installation. Try login using these credentials.
    Also in the browser give the complete URL for the Portal Server like : Http://<myhost>.<mydomain>:<port>/amserver/login or Http://<myhost>.<mydomain>:<port>/amconsole. You can't login into portal server's IDSAME console by giving IP Address or just the hostname, also your machine should be listed in the DNS server so that it can resolve the name.
    Q. I installed Sun ONE Portal Server 6.0 some time back, and now I want to know all the installation parameters and user/passwords for whole portal installation. How do I do that?
    Ans:
    The Default Admin user is 'amadmin' and the password is the PASSPHRASE you give during Portal Server installation. Also in the browser give the complete URL for the Portal Server like : Http://<myhost>.<mydomain>:<port>/amserver/login or Http://<myhost>.<mydomain>:<port>/amconsole. You can't login into portal server's IDSAME console by giving IP Address or just the hostname, also your machine should be listed in the DNS server so that it can resolve the name.
    In case you have forgotten the port numbers and PASSPHRASE that you give during installation, you still can see all the information for each component of your Portal Server Installation. The Portal server and it's components like Directory Server, Web Server and IDSAME are installed as Solaris package so the system has all the information for these packages.
    Portal Server : See file /var/sadm/pkg/SUNWps/pkginfo
    Directory Server : See files /var/sadm/pkg/SUNWamds/pkginfo and /var/sadm/pkg/SUNWamdsc/pkginfo
    Web Server : See file /var/sadm/pkg/SUNWamws/pkginfo
    Identity Server : See file /var/sadm/pkg/SUNWamsam/pkginfo
    Note: In any case you should never edit/modify these files.
    Q. Controlling the display of the help (?) button.
    Where are the links/image elements defined for the help/edit/minimize buttons? the leafWrapper.jsp pulls the hashtable out of the HttpRequest, and that hashtable is being used by providerCommands.jsp:
    Hashtable commands = (Hashtable)request.getAttribute("provider_cmds");
    Any idea where this is being set?
    Ans:
    - You can remove the help/edit button of any channel by adding the line into the Channel's properties by editing the Xml of display profile in the admin console.
    <String name="helpURL" value="" advanced="false" merge="replace" lock="false" propagate="true"/>
    <Boolean name="isEditable" value="false" advanced="false" merge="replace" lock="false" propagate="true"/>
    The Attribute 'provider_cmds' is set into /etc/opt/SUNWps/desktop/default/JSPTableContainerProvider/tablecolumn.jsp :
    <dttable:getProviderCommand id="provider_cmds" scope="request" />, and after that only the leafwrapper.jsp is included, but the Hashtable is generated by a class com.sun.portal.providers.util.ProviderCommands.java and made available through taglib classes. So you can't change the generated contents/string in the Hashtable.
    But you can change the default 'alt' text displayed and the images linked to the help/edit icons. As this modification is at Provider level, it will change the icons for all the channels in the desktop.
    Please see the file:
    /opt/SUNWps/web-apps/https-<host>.<domain>/portal/WEB-INF/classes/JSPTABLEContainerProvider.properties.
    Here you will find the mapping. The image location are given from the context root of portal server which is by default : /opt/SUNWps/web-apps/https-<host>.<domain>/portal.
    Q. I have a number of web applications needed to integrate to portal server. Any pointers or tips of what my option is?
    Ans:
    You can very well integrate all your web application with Portal server. Portal Server 6.0 has web container same as Sun ONE web server 6.0 Sp2, which runs on Jdk-1.3.
    If your web applications are just Servlets/Jsps then you can very well port them on Portal server's webserver which supports war module deployment. (infect for Web server the Portal server and Identity server is like a war module.)
    There can be two possibilities in this case, either you put the whole of your application on portal server and make the link available into the desktop via 'Application Provider Channels' or you can create a client to your web application into portal server.
    If your web application is on Sun ONE Application server 7.0 and needs authentication, you can also have SSO. If you just want to show the link of your web application into desktop then you can either use URL Scrapper to show the first page of your web application or use Bookmark channel to provide just the url.
    The easiest way to make a client of your web application is to use JSP Channel using JSPProvider and put your logic into the samplecontents.jsp file or you can create your own custom Provider extending JSPProvider. There can be a lot of different configurations, depending on the web application you want to integrate and your needs
    Q. I removed few channels from the org level display profile but still they are coming to the desktop of users, I had accessed the desktop before. why?
    Ans:
    If you still see any channel after you remove it from the display profile at organization lever, that means you have to edit the user's display profile. So go to admin console and select User from Show: menu and click on the blue arrow near the user. In the right frame under the 'Desktop' category click on the Edit link (right side). This will open user's display profile in a window. Now edit it as per your requirements.

    Unfortunately Web Server 6.0SP2 is no longer available for download.
    If you must use Web Server 6.0, you should use the most current Service Pack. It is backward compatible and contains many performance and security fixes.

  • Can not start Messaging server in Sun Java System Messaging Server 6 2005Q1

    Hi all,
    I installed Sun Java System Messaging Server 6 2005Q1 from Solaris 10 DVD on Solaris 10.
    After the installation, I got directory server, admin server running but messaging server not running. I can not start Messaging server (start smtp, http, pop, imap). I found in directory which I installed messaging server but I could not see script "start-msg" and "stop-msg".
    # pwd
    /opt/SUNWmsgsr/sbin
    # ls
    MoveUser ha_ip_config imquotacheck imsdirmig mkbackupdir
    UpgradeMsg5toMsg6.pl hashdir imsbackup imsexport readership
    configure imexpire imsconnutil imsimport reconstruct
    control-params.txt iminitquota imscripter imsrestore relinker
    deliver immonitor-access imsdaaci mboxutil useconfig
    Any idea what might have gone wrong?
    Thanks.

    Thanks.
    I have a problem when I configure the Messaging Server (by running the /opt/SUNWmsgsr/sbin/configure script):
    Hostname mailtest for this machine is not a fully qualified domain name. Please
    correct this before attempting to configure Messaging Server. Please make sure
    that your DNS is working properly.
    <Press ENTER to continue> {"<" goes back, "!" exits}
    Can you help me fix this problem?
    Thanks.

  • Some general questions about Sun Java Communications Suite

    Hello Everybody,
    We are a small group of individuals (2 Java developers and 1 Linux expert and Web Application developer), located in Germany.
    We are fully new to �Solaris� and Sun Java Communications Suite and know, that it�s a highly professional software system for large scale deployment. However we plan to install (64 Bit version) and manage it in a small network environment, consisting of a Server (4 GB RAM, RAID 5, AMD Dual CPU) based on Solaris 10 (X86) and *20* clients based on Win XP, Solaris and Linux.
    It�s a network of a non-profit organization, providing social services to local society.
    At clients we will use the Communications Express and the needed services are: Calander, Mail and Address book. (no need of Outlook Connector, Instant Messaging, Document Management, etc.)
    Our long-term aim is - after learning of professional architecting, deployment and management of Communications Suite - to provide integration and development services to organizations (schools and small / medium sized Business) and public in cooperation with ISP or infrastructure-providers like Sun Microsystems.
    Now, our main questions are:
    *1.-* Is the Server phy. recourse enough to deliver the mentioned services of Communication Suite to 20 clients without problems?
    *2.-* Isn�t Communications Suite oversized for such small network mentioned above or better, if we use another collaboration software system like Opengroupeware (http://opengroupware.org/) ? Opengroupeware is developed using non-java lang and therefore doesn�t match our strategy.
    *3.-* Does the Communications Suite download-pack includes all necessary components of Sun Java ES (Directory Server, Access Manager, etc.) or these components are to be downloaded separately?
    *4.-* What is the difference between the Sun Java System Messaging Server and the Sun Java System Message Queue?
    We appropriate very much your answers and any further useful information regarding our project.
    Thanks
    Asghar

    1> I believe your hardware can support 20 users (you might need to tune the Web Server heap size) - I had a Sparc 2x450mhz w/ 2GB of ram supporting 50+ users quite comfortably - with roughly half using POP and the other half IMAP/webmail. Ideally though, for best performance you would want to break up the main servers (LDAP, WEB, and MS) between hosts) - probably not necessary for 20 users. Having all on one machine simplifies things too (but also makes it a single-point-of-failure). Your disk obviously is important, the faster the better - that it's redundant is also nice - larger deployments might use much fancier storage systems to provide speed and redundancy, and use an the App Server instead of the Web Server as a container for Comms Express.
    2> I don't think it's "oversized" - might you mean overkill? In this case I don't think overkill is a bad thing. Why not have very capable software, even if you don't really need it -is how I see things.
    3> I believe you get all you need in the download. Though I've never tried the 64bit version (which I am guessing is only really necessary for larger deployments where you want to obtain maximized performance for heavier loads). I recommend following the single host evaluation document to get the hang of the install.
    4> I'm not sure - though the Messaging install I believe requires the MQueue stuff, I think it's sort of an API for messaging, also available separately, but used by JES Messaging system?
    Good Luck,
    s7

Maybe you are looking for