Null values passed into the servlet

Hi all,
I keep getting null values for all the params that I pass into the servlet i.e. sqltype, producttype, process, instance etc....I have attempted to print some of them out on the screen but I keep getting the 'NullPointerException' error message...can anyone tell me what it is that I have down wrong in the below code?
If I run the servlet with method calls that have hardcoded arguments in them it works but not when I pass in the params from the URL...I am absolutley puzzled!
Help!
package blotter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.db.util.WriteToLogFile;
import blotter.cache.*;
Servlet to extract an object that has already been placed
in the cache by GetBondPrices servlet from the cache.
public class ExtractSecurityObject extends HttpServlet
     String sqlType = "";
     String productType = "";
     String instance = "";
     String process = "";
     String asOfDate = "";
     String currencyCode = "";
     String curveId = "";
     String results = "";
     private String debug;
private PrintWriter out;
     private WriteToLogFile logFile;
     // called when servlet first initialised
     public void init(ServletConfig config) throws ServletException
          super.init(config);
     // method called for each get request
     public void doGet( HttpServletRequest request, HttpServletResponse response )
               throws ServletException, IOException
          String toWrite = " ";
// Get the object identifier from the parameters passed in
          sqlType = request.getParameter("sqltype");
productType = request.getParameter("producttype").toUpperCase();
          instance = request.getParameter("instance");
          process = request.getParameter("process");
          asOfDate = request.getParameter("asofdate");
          curveId = request.getParameter("curveid");
          currencyCode = request.getParameter("ccy").toUpperCase();
          out.println(currencyCode);
          if ( request.getParameter("debug") !=null)
               debug = request.getParameter("debug");
          else
               debug ="";
          // set the mime type to html
response.setContentType( "text/html" );
out = response.getWriter();
out.println("<HTML>");
          try
          // write some parameters to a log file
          toWrite = toWrite + "<li>" + getServletInfo() + " at " + new Date() + " " + sqlType + " " +
                    productType + " " + instance + " " + process + " " + asOfDate + " " + curveId + " " +
                    currencyCode;
     CachedObject o1 = (CachedObject)CacheManager.getCache("EB_" + currencyCode + productType + asOfDate);
if(o1 == null){
          CacheSecurityObject cso = new CacheSecurityObject();
               if((request.getParameter("sqltype") == null) && (request.getParameter("instance") != null)){
results = (String)cso.putSecurityinCache(null, request.getParameter("producttype"), request.getParameter("instance"), request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
//results = (String)cso.putSecurityinCache(null, "yc", "frafu", "official", "20011105", "baceod", "sek");
out.println(results);
               } else {
//results = (String)cso.putSecurityinCache("bondtypes", "bond", null, "official", "20011105", "baceod", "eur");
results = (String)cso.putSecurityinCache(request.getParameter("sqltype"), request.getParameter("producttype"), null, request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
out.println(results);
          else{
               out.println(((String)o1.object).toString());
// general catch for all exceptions
          catch(Exception exception)
               out.println( "Exception: The item that you requested was not found in the cache" + "<BR>" );
               toWrite = toWrite + "Exception : " + exception.getMessage() + "\n" ;
          finally
// write to logfile
          logFile = new WriteToLogFile();
          logFile.setSourceDirName("blotter");
          logFile.setQuery(request.getQueryString());
          logFile.setServletPath(request.getServletPath());
          if (toWrite!=null)
          logFile.writeLog(getServletInfo(),toWrite);
out.println("</HTML>");
          out.close();
     // need the class name for log file
     public String getServletInfo()
     return this.getClass().getName();
}

That section of the code references a cache to extract an item that has been requested by the user. If the item is not in the cache i.e. if(o1 == null) then it will call a class that generates that object and places that object into the cache. The second time the user makes the same call then they will be handed a cached copy of that object which is aimed to make the whole servlet call faster.
That section of the code works fine coz I have tested that separately. It is the reading in of the arguments that is causing the problem.

Similar Messages

  • Requirements to put my own value object into the context

    Hello,
    are there any requirements to put my own value object into the context?
    I got following exception
    An error has occurred:
    "Failed to process the request."
    Please contact your system administrator.
    Hide details
    Web Dynpro product information:
    Product: null, Vendor: SAP AG, Version: null, Build ID: 6.3006.00.0000.20040617153350.0000, Build Date: Mon Aug 16 09:18:37 CEST 2004
    Error stacktrace:
    java.lang.ClassCastException
         at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:186)
         at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.DropDownByKeyAdapter.setViewAndNodeElement(DropDownByKeyAdapter.java:230)
         at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:230)
         at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:63)
         at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.TableAdapter$ContentCell.getContent(TableAdapter.java:1295)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableCellRenderer.render(SapTableCellRenderer.java:57)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRowRenderer.renderSapTableRowFragment(SapTableRowRenderer.java:67)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRowRenderer.render(SapTableRowRenderer.java:33)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableDefaultBodyRenderer.renderSapTableDefaultBodyFragment(SapTableDefaultBodyRenderer.java:96)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableDefaultBodyRenderer.render(SapTableDefaultBodyRenderer.java:29)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRenderer.renderSapTableFragment(SapTableRenderer.java:394)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRenderer.render(SapTableRenderer.java:49)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutCellFragment(GridLayoutRenderer.java:609)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutRowFragment(GridLayoutRenderer.java:312)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutFragment(GridLayoutRenderer.java:250)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.render(GridLayoutRenderer.java:57)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:235)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:41)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.renderViewContainerFragment(ViewContainerRenderer.java:93)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.render(ViewContainerRenderer.java:33)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutCellFragment(GridLayoutRenderer.java:609)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutRowFragment(GridLayoutRenderer.java:312)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutFragment(GridLayoutRenderer.java:250)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.render(GridLayoutRenderer.java:57)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:235)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:41)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.renderViewContainerFragment(ViewContainerRenderer.java:93)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.render(ViewContainerRenderer.java:33)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:32)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:454)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:286)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:178)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:632)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:57)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:139)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:101)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:45)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:383)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:333)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:311)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:811)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:235)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:144)

    Hi Jurgen,
    Can you please explain what you are trying to do in detail. Do you want to create a Node dynamically in the context or, you want to populate a Node in a Context???
    The stack trace, does not reveal what you want to do with the value object!
    Thanks and Regards,
    Vishnu Prasad Hegde

  • Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778.Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding.

    Hi, 
    I created a simple plugin and since i wanted to use Early Binding i added Xrm.cs file to my solution.After i tried registering the plugin (using the Plugin Registration Tool) the plugin does not gets registered and i get the below mentioned Exception.
    Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this
    operation may have been a portion of a longer timeout.
    Server stack trace: 
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
       at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)
       at Microsoft.Crm.Tools.PluginRegistration.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)
    Inner Exception: System.TimeoutException: The HTTP request to 'https://demoorg172.api.crm.dynamics.com/XRMServices/2011/Organization.svc' has exceeded the allotted timeout of 00:01:59.9430000. The time allotted to this operation may have been a portion of a
    longer timeout.
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    Inner Exception: System.Net.WebException: The operation has timed out
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    And to my Surprise after i remove the Xrm.cs file from my solution the Plugin got registered!
    Not understanding what exactly is the issue.
    Any Suggestions are highly appreciated.
    Thanks,
    Shradha
      

    Hello Shardha,
                            I really appreciate that you have faced this issue.This is really very strange issue and basically it occurs because of big size of your early bound class and slow internet
    connection.
                            I would strictly recommend you to reduce the file size of your early bound class and then register.By default early bound class is created for all the entities which are
    present in CRM(System entities as well custom entities).Such kind of early bound classes takes lots of time to register on server and hence timeout exception comes.
                            There is some standard define to reduce the size of early bound class.Please follow the link to get rid from big size of early bound class.
    Create a new C# class library project in Visual Studio called SvcUtilFilter.
    In the project, add references to the following:
    CrmSvcUtil.exe(from sdk)   This exe has the interface we will implement.
    Microsoft.Xrm.Sdk.dll  (found in the CRM SDK).
    System.Runtime.Serialization.
      Add the following class to the project:
    using System;
    using System.Collections.Generic;
    using System.Xml.Linq;
    using Microsoft.Crm.Services.Utility;
    using Microsoft.Xrm.Sdk.Metadata;
    namespace SvcUtilFilter
        /// <summary>
        /// CodeWriterFilter for CrmSvcUtil that reads list of entities from an xml file to
        /// determine whether or not the entity class should be generated.
        /// </summary>
        public class CodeWriterFilter : ICodeWriterFilterService
            //list of entity names to generate classes for.
            private HashSet<string> _validEntities = new HashSet<string>();
            //reference to the default service.
            private ICodeWriterFilterService _defaultService = null;
            /// <summary>
            /// constructor
            /// </summary>
            /// <param name="defaultService">default
    implementation</param>
            public CodeWriterFilter( ICodeWriterFilterService defaultService )
                this._defaultService = defaultService;
                LoadFilterData();
            /// <summary>
            /// loads the entity filter data from the filter.xml file
            /// </summary>
            private void LoadFilterData()
                XElement xml = XElement.Load("filter.xml");
                XElement entitiesElement = xml.Element("entities");
                foreach (XElement entityElement in entitiesElement.Elements("entity"))
                    _validEntities.Add(entityElement.Value.ToLowerInvariant());
            /// <summary>
            /// /Use filter entity list to determine if the entity class should be generated.
            /// </summary>
            public bool GenerateEntity(EntityMetadata entityMetadata, IServiceProvider services)
                return (_validEntities.Contains(entityMetadata.LogicalName.ToLowerInvariant()));
            //All other methods just use default implementation:
            public bool GenerateAttribute(AttributeMetadata attributeMetadata, IServiceProvider services)
                return _defaultService.GenerateAttribute(attributeMetadata, services);
            public bool GenerateOption(OptionMetadata optionMetadata, IServiceProvider services)
                return _defaultService.GenerateOption(optionMetadata, services);
            public bool GenerateOptionSet(OptionSetMetadataBase optionSetMetadata, IServiceProvider services)
                return _defaultService.GenerateOptionSet(optionSetMetadata, services);
            public bool GenerateRelationship(RelationshipMetadataBase relationshipMetadata, EntityMetadata otherEntityMetadata, IServiceProviderservices)
                return _defaultService.GenerateRelationship(relationshipMetadata, otherEntityMetadata, services);
            public bool GenerateServiceContext(IServiceProvider services)
                return _defaultService.GenerateServiceContext(services);
    This class implements the ICodeWriterFilterService interface.  This interface is used by the class generation
    utility to determine which entities, attrributes, etc. should actually be generated.  The interface is very simple and just has seven methods that are passed metadata info and return a boolean indicating whether or not the metadata should be included
    in the generated code file.   
    For now I just want to be able to determine which entities are generated, so in the constructor I read from an XML
    file (filter.xml) that holds the list of entities to generate and put the list in a Hashset.  The format of the xml is this:
    <filter>
      <entities>
        <entity>systemuser</entity>
        <entity>team</entity>
        <entity>role</entity>
        <entity>businessunit</entity>
      </entities>
    </filter>
    Take a look at the methods in the class. In the GenerateEntity method, we can simply check the EntityMetadata parameter
    against our list of valid entities and return true if it's an entity that we want to generate.
    For all of the other methods we want to just do whatever the default implementation of the utility is.  Notice
    how the constructor of the class accepts a defaultService parameter.  We can just save a reference to this default service and use it whenever we want to stick with the default behavior.  All of the other methods in the class just call the default
    service.
    To use our extension when running the utility, we just have to make sure the compiled DLL and the filter.xml file
    are in the same folder as CrmSvcUtil.exe, and set the /codewriterfilter command-line argument when running the utility (as described in the SDK):
    crmsvcutil.exe /url:http://<server>/<org>/XrmServices/2011/Organization.svc /out:sdk.cs  /namespace:<namespace> /codewriterfilter:SvcUtilFilter.CodeWriterFilter,SvcUtilFilter
    /username:[email protected] /password:xxxx
    That's it! You now have a generated sdk.cs file that is only a few hundred kilobytes instead of 5MB. 
    One final note:  There is actually a lot more you can do with extensions to the code generation utility. 
    For example: if you return true in the GenerateOptionSet method, it will actually generated Enums for each CRM picklist (which it doesn't normally do by default).
    Also, the source code for this SvcUtilFilter example can be found here. 
    Use at your own risk, no warranties, etc. etc. 
    Please mark as a answer if this post is useful to you.

  • Java Install,  Cannot insert a key value pair into the secure store fails,

    Dear All,
    I'm doing Java Intallaion in BI7 on CI and in the midle of installtions we encounter,
    TRACE      [iaxxejsexp.cpp:199]
               EJS_Installer::writeTraceToLogBook()
    NWException thrown: nw.secureStore.cannotInsertIntoSecureStore:
    Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    ERROR      2008-04-23 11:36:21
               CJSlibModule::writeError_impl()
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    TRACE      [iaxxejsbas.hpp:460]
               EJS_Base::dispatchFunctionCall()
    JS Callback has thrown unknown exception. Rethrowing.
    ERROR      2008-04-23 11:36:21 [iaxxgenimp.cpp:731]
               showDialog()
    FCO-00011  The step insertAdminDataInSecStore with step key |NW_Addin_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|8|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|4|0|insertAdminDataInSecStore was executed with status ERROR .
    TRACE      [iaxxgenimp.cpp:719]
               showDialog()
    There's any want in here can help us Please,
    Thanks and Best Regards,
    Chrisna

    The clean way to Uninstall JAVA is through SAPINST. 
    Make user you drop only the JAVA Schema ID (SAPSR3DB)
    If you want to uninstall manually, follow as mentioned below :
    1. Stop the central services instance and all dialog instances of your SAP system:
    a) Log on to the corresponding instance host as user <sapsid>adm.
    b) Execute the following commands:
       To stop the central services instance:
                 stopsap r3 <SCSinstanceName>
       To stop a dialog instance:
                stopsap r3 <DialogInstanceName>
    2. Stop the J2EE Engine of the central instance:
    a) Log on to your SAP system.
    b) Call transaction SMICM.
    c) Choose Administration J2EE Instance (local) Send Hard Shutdown
    2. Drop the J2EE DB schema (the db schema for this one SAP SID) BE VERY CAREFUL, do not drop the DB schema for another existing system or
    the ABAP schema.
    a. Log on as user ora<dbsid>.
    b. Start sqlplus and connect to the database. Enter:
    sqlplus /nolog
    c. SQLPLUS>connect / as sysdba
    d. Enter the following command to delete the database objects of the database schema:
    SQLPLUS> drop user SAP<SCHEMA_ID>DB cascade;
    e. Enter the following command to get the file name of the corresponding data file in the file system:
    SQLPLUS> select file_name from dba_data_files where \
    tablespace_name = ’PSAP<SCHEMA_ID>DB’;
    f. Enter the following command to delete the tablespace of the database schema:
    SQLPLUS> drop tablespace PSAP<SCHEMA_ID>DB including contents;
    g. Exit sqlplus:
    SQLPLUS> exit
    3. Remove folder "data" at: /sapmnt/QO1/global/security/data
    4. Remove folder "SDM" at: /usr/sap/<sid>/<Central instance>/SDM
    5. Remove folder "j2ee" at:  /usr/sap/<sid>/<Central instance>/j2ee
    6. Revert CI instance profile to their original state (backup copies should exist) # they should be in the state before the start of the JavaAdd In
    7. If lines beginning with the following parameters appear, delete these lines from the default profile, /usr/sap/<SAPSID>/SYS/profile/DEFAULT.PFL:
    j2ee/dbname =
    j2ee/dbtype =
    j2ee/dbhost =
    j2ee/dbadminurl =
    j2ee/scs/host =
    j2ee/scs/system =
    j2ee/ms/port =
    8. If lines beginning with the following parameters appear, delete these lines from the central instance pro?le and from all dialog instance pro?les,
    /usr/sap/<SAPSID>/SYS/profile/<SAPSID>_<INSTANCE_NAME>_<host_name>:
    exe/j2ee =
    exe/jlaunch =
    rdisp/j2ee_start_control =
    rdisp/j2ee_start =
    rdisp/j2ee_timeout =
    rdisp/j2ee_libpath =
    rdisp/frfc_fallback =
    jstartup/trimming_properties =
    jstartup/instance_properties =
    jstartup/protocol =
    jstartup/vm/home =
    jstartup/max_caches =
    jstartup/release =
    j2ee/dbdriver =
    9. Delete the central services instance
    10. Restart ABAP and Install JAVA Add-in
    Edited by: Shaji Jacob on Apr 27, 2008 11:46 AM

  • Cannot insert a key value pair into the secure store fails; see output of l

    Hi,
    how can I fix this problem ?
    SAPNW2004sJavaSP9_Trial\SAP_NetWeaver_2004s_SR_1
    jdkversion 142_09 .
    ERROR 2008-07-10 13:13:31
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log: SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    Regds
    sas

    Hi Arzu,
    thank you for your replying.
    The current OS I am using is Microsoft Windows XP
    Service Pack 2.
    The very last installation was made with JDK version 142_12.
    However it was pointless. I can try to reinstall with
    the mentioned newest JCE policy files .
    Can tell me from where I can obtain these above
    JCE policy files ?
    Regards
    Erdem Sas

  • Dashboard prompt value is not passing into the report

    Hi,
    I am using OBIEE 10g. The problem is in Oracle BI Answers
    I have a prompt and its related report. In the prompt, in one of the column, I am using sql result. The sql query is a co-related sub query where i have used 2 tables. employee_data and employee_region. The reason for using sub-query is that there is no data_center column in the employee_data table. It has the records for all the data_center e.g USA, UK,IND,AUSTRALIA etc So, I used the sub query with condition which will give the result on a particular data center (here it is USA) and this sub query's output is input for the main query. And the prompts works fine and gives correct result
    The sql query used for the column in the prompt (in Oracle BI Answers) as
    SELECT EMPLOYEE_DATA.ENAME FROM EMPLOYEE WHERE EMPLOYEE_DATA.ENAME IN (SELECT EMPLOYEE_REGION.ENAME FROM EMPLOYEE WHERE EMPLOYEE_REGION.DATA_CENTER = 'USA')Now in the report, there are 2 coulmns. - EMPLOYEE_DATA.ENAME and EMPLOYEE_REGION.DATA_CENTER
    I have used the main column EMPLOYEE_DATA.ENAME for filter as 'prompted'.
    The problem is the value from the prompt is not passing from the prompt to the report, what I found. Because, instead of showing the result for 'USA' data_center, It also shows other data_center 's (UK,IND,AUSTRALIA) data.
    How filter condition I should use for EMPLOYEE_DATA.ENAME column in the report so that the prompt value will pass to the report properly ?
    Thanks
    Edited by: Kuldip on Feb 21, 2013 6:17 AM

    Hi Kuldip,
    There are 2 ways of doing it.
    1. Nice and good: For the section where the report is put have a condition to display only if it returns rows. For details please refer to :
    http://bischool.wordpress.com/category/guided-navigation/
    2. The easy way: Add a "No Result" view to your report and add few spaces in the text.
    Let me know if this helped.
    Regards,
    Jay

  • Null Value returned into Hashtable  from Vector (after 1.5 compilation )

    Sorry i posted the Question with a misleading heading into another thread .
    Hi , in the given peice of Code , date1 is a vector while date2 is a hashtable .
    I am storing the date from the vector in a hashtable .
    The code works fine for java 1.4 but Null value gets stored after compiling in 1.5.
    There is no error during compilation .
    Hashtable date2 = (Hashtable) date1.elementAt(0);
    cat.debug("date2"+date2.get("TO_CHAR(TO_DATE(TO_CHAR(RES_DT,DD-MON-YYYY)),DD-MON-YYYY)"));"TO_CHAR(TO_DATE(TO_CHAR(RES_DT,DD-MON-YYYY)),DD-MON-YYYY)") is the key , there is no error in that .
    cat.debug is log4j function used to write log to an text file.
    From searchin the net i got the i would have to typecast (not sure if am using the right technical term ) .
    protected Hashtable<Object,Object> lNVPair = new Hashtable<Object,Object>();
        protected Vector<Object> lNVKeys = new Vector<Object>();But how am i suppose to use it in the above state where with declaration i am assigning value at same time ?..
    Hashtable<Object,Object> date2 = (Hashtable<Object,Object>) date1.elementAt(0);

    Here is more details about date1 :
    Vector date1 = mDao.getDate(lcrnno,ltxntype,lbranchCd);Value of date1 is filled by calling a function which in turns queries the database .
    Details about the function are below .
    public Vector getDate(String pcrnno,String ptxntype,String br_cd)//throws SQLException
              Vector lResult=null;
              ResultSet lresult = null;
       try {
                                              Hashtable linner=new Hashtable();
                         lResult=new Vector();
              //String lstrquery declared  containing the query to be executed .
             mPstmt = mConn.prepareStatement(lstrquery);
           lresult = mPstmt.executeQuery();
         ResultSetMetaData lrsmd=null;
        lrsmd=lresult.getMetaData();
       int lcolCount=lrsmd.getColumnCount();
      cat.debug("Number of fields:"+lcolCount);
    while(lresult.next())
              linner=new Hashtable();
           for(int i=1;i<=lcolCount;i++) {
                   String lkey=lrsmd.getColumnName(i); //column name to be used as key
                   String lvalue=lresult.getObject(i).toString(); //value
                      linner.put(lkey,lvalue); //populating the hashtable
          }//end of for
                             lResult.add(linner); //adding to vector
      }//end of whileNote I have not added the part of code where query string created and parameters passed .
    Hope that should be enough details ...

  • How do I convert a Vector to be passed into the session

    Hi I have a vector in a JSP that I need to pass on to a second JSP. I use the following command to do that just as I pass normal other strings:
    session.setAttribute("MyVector",vecData);
    But the follwoing error is been thrown by Tomcat.
    Incompatible type for method. Can't convert void to java.lang.Object.
    out.print(session.setAttribute("ResultsSet",set));
    ^
    I guess I have to convert it explicitly into an object and then how do I do that? could someone please help me fast on this?
    if this doesn't work is there some other way to send this vector to my other page? I am currently sending enough strings using the above method, but for Vectors it doesn't seem to work though I am told that a session object can carry any object unlike the request object that carries only strings. Please help!!!!

    Hi Calin thank you so much for taking ur time to help me with my problem.
    well let me explain my requirement fully in detail. JSP1 has a form on it for the user to fill in. its in the form of a table with multiple rows. say as in entering product details one after the other in an invoice.
    I want each of these rows taken in and passed into JSP2.
    What I do is pack each row of the table into a hashtable using a 'for' loop.
    Then I add each record (within the 'for' loop) to a Vector. After the 'for' loop, outside of it, I set this Vector to the session as :
    session.setAttribute("RecordSet",vecRecordSet);
    Well let me copy paste and extract of the coding from my source which shows what I have done.
    Vector set=new Vector();
    for (int i=0;i<Integer.parseInt(request.getParameter("NoOfRecords"));i++)
    Hashtable Record=new Hashtable();
                   Record.put("ReminderStatus",ReminderStatus);
                   Record.put("CustomerNo",CustomerNo);
                   Record.put("CustomerName",CustomerName);
                   Record.put("Address",address);
                   Record.put("ContractNo",ContractNo);
                   Record.put("MachineID",MachineID);
                   Record.put("ModelNo",ModelNo);
                   Record.put("Description",description);
                   Record.put("SerialNo",SerialNo);
                   Record.put("ContractValue",ContractValue);
                   Record.put("NoOfServices",NoOfServices);
                   Record.put("ContractStartDate",ContractStartDate);
                   Record.put("ContractEndDate",ContractEndDate);               set.add(Record);
         session.setAttribute("ResultsSet",set);//SHERVEEN
    well don't worry about the for loop condition up there cos it works for the main functionality that exists within the for loop. but what seems to go wrong is when I add records to the hashtable and when I pack it to the Vector "set"
    I hope I have not done something wrong as a principle over here.
    And btw the error that I showed u before, is pointed at a row which exists in the file that is generated when compiled. the out.println part is generated in that file during compilation and I don't know why.
    I hope I have given u information for u to make some sense of my requirement and thank u a million once again for ur effort to help me out. I am grateful to all of u.

  • Grouping to display null values for all the missing dates

    Hi SAP,
    I am trying to display '0.00' value for all the missing dates in my crystal reports as follows:
    17-Jan-14     40.00
    18-Jan-14       0.00
    19-Jan-14       0.00
    20-Jan-14     80.00
    However, my crystal report is showing as follows:
    17-Jan-14     40.00
    18-Jan-14       0.00
    19-Jan-14
    20-Jan-14     80.00
    The missing dates with no data are group together and my '0.00' value is not. Kindly advise me the solution. The formula is shown as per attached.
    Thank you.
    Regards.

    Hi,
    Thanks for your reply.
    Fyi, I am using a formula field in crystal report to display "0.00" for days in between as follows:
    whileprintingrecords;
    if Days_Between({Command.DocDate},next({Command.DocDate}),'dd-MMM-yy') = "" then "" else "0.00"
    There is another formula field in crystal report to display the missing dates in between as follows:
    whileprintingrecords;
    Days_Between({Command.DocDate},next({Command.DocDate}),'dd-MMM-yy')
    Below is my report custom functions:
    Function Days_Between (datefield as datetime, nextdatefield as datetime, format as string)
    ' This function is only used to display what data is missing within a specified date range...output type is text
    dim thisdate as date
    dim nextdate as date
    dim output as string 'output is the text display
    dim daysbetween as number
    dim looptimes as number
    looptimes = 0
    daysbetween = 0
    output = ""
    thisdate = datevalue(datefield) + 1
    nextdate = datevalue(nextdatefield)
    if nextdate - thisdate > 1 then daysbetween = nextdate - thisdate else daysbetween = 1
    do
    if nextdate - thisdate > 1 _
    then output = output + totext(thisdate, format) + chr(10) _
    else _
    if nextdate - thisdate > 0 _
    then output = output + totext(thisdate, format)
    looptimes = looptimes + 1
    thisdate = thisdate + 1
    loop until looptimes = daysbetween
        Days_Between = output
    End Function
    The issue arise when when there is more than one missing dates in between but the null values ("0.00") displayed is only for the first missing dates and not for all the missing dates.
    Regards,
    Ting Wei 

  • SSIS package fails when Configuration value has value saved into the package

    when a package is migrated from dev to QA and to PROD sometimes it fails since the variables have values in them saved into the package.
    what we do is clear these values manually and restart the job.
    Is there a way we can clear the variables when saving the package or at least programmatically?
    eddy.a

    Hello Arthur
    Thank you for your response. I should start by apologizing by not making myself clear. We do use indirect configuration that work cross environments however this is the issue that we have:
    when the package is first created say you create a DB Variable called A and you enter value A in the variable to test the package. After the package development is tested, you change the configuration values to fetch data whether from an excel file or from
    an XML.
    when you run on environment A the package runs fine however when you move over to environment B it seems that first it validates against A then overwrites B - if environment A is not there anymore the package sometimes fails.
    we are changing these manually for now but I was wondering if there's a way to prevent it.
    thanks
    eddy.a

  • How do I get a byte array from an object passed into the JNI?

    This is what my java code looks like:
    public class streamedData
    protected byte[] m_value = null;
    public byte[] getByteArray ()
    return m_value;
    /* code not pertaining to this question snipped. */
    jclass streamedDataClass = env->GetObjectClass(jstreamedData);
    // Get methodIDs for the various NPKI_Extension methods
    value = env->GetMethodID(streamedDataClass, "getByteArray", "()[B");
    lstreamedData->value = (unsigned char *)malloc (lstreamedData->length);
    if (lstreamedData->value == NULL)
    return INSUFFICIENT_MEMORY;
    memset (lstreamedData->value, 0, lstreamedData->length);
    memcpy (lstreamedData->value, env->CallByteMethodA(streamedDataClass, value, NULL), lstreamedData->length);
    This is not working.
    My question is, how do I get a copy of or read m_value in the JNI layer? Do I have to make the byte array public and access it as a field ID?
    Any help would be appreciated. Why oh why can't there be a CallByteArrayMethod????

    My question is, how do I get a copy of or read m_value in the JNI layer? Do I have to make the byte array public and access it as a field ID?
    You can retrieve a handle to the byte array, through a method call, as you're doing now, or by directly accessing it through GetFieldID.
    In the case of the method call, you'll want to do:jmethodID getByteArrayMethod = env->GetMethodID(streamedDataClass, "getByteArray", "()[B");
    jbyteArray byteArray = static_cast<jbyteArray>( env->CallObjectMethod( jstreamedData, getByteArrayMethod ) );In the case of field access, you can do:jfieldID m_valueFieldID = env->GetFieldID( streamedDataClass, "m_value", "[B" );
    jbyteArray byteArray = static_cast<jbyteArray>( env->GetObjectField( jstreamedData, m_valueFieldID ) );Once you have byteArray, you need to access it using the array operations:lstreamedData->value = env->GetByteArrayElements( byteArray, 0 );
    // Do what you want to do, then release the array
    env->ReleaseByteArrayElements( byteArray, lstreamedData->value, 0 );As always, Jace, http://jace.reyelts.com/jace, makes this easier. For example,void printByteArray( jobject jstreamedData ) {
      streamedData data( jstreamedData );
      JArray<JByte> byteArray = streamedData.m_value();
      for ( int i = 0; i < byteArray.length(); ++i ) {
        cout << byteArray[ i ];
    }God bless,
    -Toby Reyelts

  • Null values returned when using request.getParameters(

    I have a html form which allows the user to choose options and select a file to upload. When I use method=Post I get null values returned. When I use method=Get I get my parameter values fine.. but I get an error.
    "Posted content type isn't multipart/form-data"
    I would like to know why I am getting null values returned when using Post. I am using the following to get the values from the name=value passed to the servlet.
    String strIndustry = request.getParameter("frmIndustry");
              String strCompany = request.getParameter("frmCompany");
              String strCollabType = request.getParameter("frmCollaboration");
    I have another form where the user can search information in a database that works just fine w/ either Get or Post
    Or perhaps I am using oreilly MultipartRequest incorrectly??? but I copied it directly from another discussion.. ???
    any thoughts
    Thanks

    taybon:
    you could do it like this. in this case, you submit your form with the parameters (industry, company, collaboration), and upload your file at the same time. and in the target servlet, you can build your MultipartRequest object like this:
    MultipartRequest multi = new MultipartRequest(request, temp_location, 50 * 1024);where variable temp_location stands for a temporatory diretory for file uploading.
    and then you get your parameters, so you can build the directory with them. and after that, you can move your file to that directory using File.renameTo();
    but as i've suggested in my previous posting, i just recommend you upload your file in a separate form. and then you can perform an oridianry doPost form submit with those parameters. or you may have problems with the file uploading. (this is just my personal experiences with Multipart).
    there is one other thing i'd like to mention, file.renameTo() won't work if you need to move files to a network drive in windows. it won't work if you move files across file systems in unix.
    Song xiaofei
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • How to hide the parameters passed into servlet or make it read only

    Hi,
    I am calling a servlet to downlaod files, using
    <a href="../servlet/DownloadFile?directory=<%=attachmentPath%>&fileName=<%=fileName%>">But this will display all the paramters passed , of course as I am using hyper link. However I can not use
    <form> to call the servlet because otherwise I got nested form anyway.
    So the users would be able to change the directory and file names to download files I do not like them to download. Somebody would suggest hardcode the directory and filename, but these two parameters are dynamic, so I have to pass them into the servlet everytime I call it.
    Any advice to disable the users to change or even view the two parameters on the address bar?
    Thanks
    </a>

    Here some code snippets to give you an idea of what I do.
    Let's say you want to retrieve a file from your server, and you need to pass the full directory path info in your URL. You might have code as follows:
    String fileName = "/server/SomeUltraSecretHiddenDirectory/ImportantSecretFile.doc";
    Click <a href="/fileservlet?fileName=<%=URLEncoder.encode(fileName)%>">HERE</a> to download file.Using the above code, ANYONE can retrieve this file if they know the URL. Also, they could try to change the URL paths to find other files. In other words, it's NOT SECURE.
    Now, try it this way (all exception handling is left out):
    private static final byte[] salt = { (byte)0xd4, (byte)0xa3, (byte)0xff, (byte)0x9e,
    (byte)0x12, (byte)0xc7, (byte)0xd0, (byte)0x84 };     
    String fileName = "/server/SomeUltraSecretHiddenDirectory/ImportantSecretFile.doc";
    base64Encoder = new BASE64Encoder();
    base64Decoder = new BASE64Decoder();
    // get key object
    SecretKey key = null;               
    PBEKeySpec keySpec = new PBEKeySpec("somesecretkeystring");
    SecretKeyFactory kf = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
    key = kf.generateSecret(keySpec);     
    // get parameter spec
    PBEParameterSpec paramSpec = new PBEParameterSpec(salt, 1000);
    // create cipher
    Cipher c = Cipher.getInstance("PBEWithMD5AndDES");
    c.init(Cipher.ENCRYPT_MODE, key, paramSpec);     
    // take string and get encrypt it (base-64 encode it to get rid of non-printable characters
    byte[] aResult = c.doFinal(fileName.getBytes("UTF-8"));
    String strResult = base64Encoder.encodeBuffer(aResult);
    // print the link
    Click <a href="/fileservlet?fileName=<%=URLEncoder.encode(strResult)%>">HERE</a> to download file.
    // on the server side, do the following to decrypt the link
    String encryptedFileName = request.getParameter("fileName");
    // create decryption cipher (i'm skipping a lot of the init code this time - see above for code example)
    Cipher c = Cipher.getInstance("PBEWithMD5AndDES");
    c.init(Cipher.DECRYPT_MODE, key, paramSpec);
    // decrypt string
    byte[] aResult = c.doFinal(base64Decoder.decodeBuffer(encryptedFileName));
    String strResult = new String(aResult, "UTF-8");Now you have the decrypted String. Your link will be unreadable and unbreakable. 100% safe as long as your key password is safe. I hope that gives you an idea of what you can do with cryptography!
    A few notes:
    - Most of the above code is in separate methods that can be easily reused (especially encrypt() and decrypt())
    - All exception handling has been left out
    - The above code was patched together from memory, so don't expect it to work as is (that's my disclaimer :)
    - You'll need the JCE libraries to use this functionality.
    - For REALLY sensitive data (such as passwords), make sure you use one-way encryption (hashes) if you don't ever need to decrypt it again.
    Michael

  • Changing the value of a parameter that has been passed into an SSRS 2008 R2 report

    I support 200+ reports that all use stored procedures and have many drill downs with built in URLs.
    I want to do the below to avoid creating a brand new parameter that I will have to add to literally hundreds of places.
    We have what I'll call Param1 that receives a value from the user.  That Param1 is passed to the stored procedure(s) for the report and also embedded in any Action URLs for drill downs to other reports from that report.  All works great.
    Now I have a need to concatenate a string to whatever value they supplied which provides context for the environment in which they are running.  The reason I want to do this instead of creating a new parameter is because I need this in all my reports
    and as stated above I would have to make 100s of changes to make that happen.  If I can figure out a way to concatenate a value to the existing Param1 value I can greatly reduce the number of changes.
    I can't seem to be able to find a way to modify the value on an existing parameter that is passed into the report prior to report execution.
    I get an error when I simply try to concatenate something to the parameter in its Default property.
    I can't find a way to update a parameter value in the Report Code block.  There don't appear to be any methods available on the Parameter Collection to set the value of a parameter.
    Any ideas?
    Thanks!
    Nathan 

    Create a new parameter. Mark it internal, set it's value by expression to:
    =User!UserId+"MyNewValue"
    and pass it to the proc?
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Problem when passing string array in sessions showing null value

    i am trying to pass a string array but it is showing me the null value
    i think the the problem is seem to be in session.settAttribute("subject['"+i+"']",subject) in 2.login_action.jsp
    or in String sub1=(String) session.getAttribute("subject[0]"); in 3.user_home.jsp
    i have following three pages
    1.login.html
    2.login_action.jsp
    3.user_home.html
    1.login.html
    <html>
    <body>
    <form method="post" action="login_action.jsp">
    Username<input type="text" name="username"></input>
    <br>
    Password<input type="password" name="password"></input>
    <input type="submit" value="login"></input>
    </form>
    </body>
    </html>
    2.login_action.jsp
    <%@ page contentType="text/html"%>
    <%@ page import="java.sql.*" %>
    <%!
    String user,pwd;
    String subject[]=new String[10];
    int i,totalsubject;
    %>
    <%
    try
    user=request.getParameter("username");
    pwd=request.getParameter("password");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:ods","scott","tiger");
    PreparedStatement ps = con.prepareStatement("select password from users where username='"+user+"'");
    ResultSet rs = ps.executeQuery();
    if(rs.next())
    if(rs.getString("password").equals(pwd))
    session.setAttribute("username",user);
    PreparedStatement ps2 = con.prepareStatement("select subject_id from allot_teachers where staff_id='"+user+"'");
                        ResultSet rs2 = ps2.executeQuery();          
                             while(rs2.next())
                             i=0;
                             subject[i]=rs2.getString(1);
    // if i display here the subjects in out.println(subject[i]) it is working fine
    // but in next redirected page it is showing null
                             session.setAttribute("subject['"+i+"']",subject[i]);
                             //out.println(subject[i]);
                             i++;
    response.sendRedirect("user_home.jsp");
    else
    out.println("error invalid username or password");
    else
    out.println("error invalid username or password");
    con.close();
    catch(Exception e)
    out.println(e);
    %>
    3. user_home.jsp
    <%@ page contentType="text/html"%>
    <%@ page import="java.sql.*" %>
    <html>
    <%
    String user,pwd,cat,cat1;
    String username=(String) session.getAttribute("username");
    if(username==null)
    response.sendRedirect("login.html");
    //just tried for first two subjects
    String sub1=(String) session.getAttribute("subject[0]");
    String sub2=(String) session.getAttribute("subject[1]");
    //here it is printing null
    out.println(sub1);
    //here it is printing null
    out.println(sub2);
    %>
    <form method="post" action="logout.jsp">
    <input type="submit" value="Logout"></input>
    </form>
    </html>
    Cheers & Regards
    sweety

    The name in getAttributre doesnt match the name in setAttribute.
    Note "subject[0]" is a string containing 10 chars, "subject" is a string containing 7 chars.
    Here is your code:
    session.setAttribute("subject",subject);
    String sub1=(String) session.getAttribute("subject[0]");

Maybe you are looking for

  • Anyone ever hook up zen micro without a battery using an external power supp

    Just wondering if it's possible. I guess you need to know the pinouts for the 4 contacts (I've got the 6GB version without video). What kind of specs would you need on the power supply? Hope somone has some info, Thanks

  • Error processing CFX custom tag "CFX_iMSMail".

    Hi I am testing a CF application and this is the error I get., when I am trying to 'register for a certain event'. Error processing CFX custom tag "CFX_iMSMail". 'The CFX custom tag "CFX_iMSMail" was not found in the custom tag database. Please be su

  • Extended IDocs filling code?

    Hi all, I have created an extension to an IDoc SISCSO01 and using the process code SD10.Where exactly should I write the code to fill the extended segments? Can we use customer exits in Function module of the process code to write the code? If so whi

  • Wifi on macbook pro does not work

    Any idea where is that airport express card on my macbook 15inch duo 2.4 pro late 2009.? Where can I find a detailled guide on the parts in that laptop? Where can I buy used or new parts to replace them? Thanks

  • Nokia 3120C

    My husband bought my 3120C in UAE last year, my problems encountered are: 1. Everytime i received text from my husband, his text is not complete there is "some text are missing". 2. I always received text from husband late, ex. based from the text i