Bean advice

I want to use a JavaBean to represent a user in my application (a JSP/servlet app). But I am wondering if I have the right approach -- here is the basic idea:
My bean, UserBean, has three properties (so far):
- name (String)
- password (String)
- authorized (boolean)
In addition to the getter/setter methods that I understand are required of all beans, I have one extra method (which will probably be protected or private in the final code):
attemptAuthorization()
which basically does the work of determining whether the name and password are a valid combination to call setAuthorized().
Now, here's my two questions:
(1) Is it okay to have this non-getter/setter method? It seems to me that for the most part, beans are pretty much just getters and setters.
(2) Is it okay to have a setter method perform a side effect, such as calling the setAuthorized() setter method? Here is my code:
     * sets the <code>password</code> of the UserBean.  If the <code>name</code>
     * of the UserBean has already been set (is not null), this method attempts
     * to set the <code>authorized</code> property.
    public void setPassword(String password) {
        this.password = password;
        if (getName() != null) {
            attemptAuthorization();
    }It just seems like having methods that perform these kinds of side effects might invalidate my class from being a true javabean.
Thanks!

(1) Is it okay to have this non-getter/setter method?
It seems to me that for the most part, beans are
pretty much just getters and setters.
(2) Is it okay to have a setter method perform a side
effect, such as calling the setAuthorized()
setter method? (1) and (2) are fine. You have a bean when you have a serializable class with a no-arg Ctor and get/set for the bean's properties, which,in your case, are 3 : name, password, and authorized.
Keep in mind that adding side-effects is fine as long as you satisfy the basic requirements above. The only thing that too many of those side-effects might cause sometimes could be the re-usability of the bean in another context/JVM/machine...but that doesn't seem the case here.

Similar Messages

  • Need advice about web services and Java beans

    Hi
    I am very new to web services and to Java beans as well.
    I am trying to understand if and how a web service can use functionality I have in a Java bean. I couldn't find any documentation I can use.
    For example:
    InitialContext ic = new InitialContext();
    Adder adder = (Adder) ic.lookup("ejb/AdderJNDI");In a EJB client project (I'm working with Eclipse) if I add the EJB project to the build path, the Adder interface is recognized.
    Theoritacally I thought I can do the same in a web service server project, but the Adder interface is not recognized.
    Is there something I can read to understand how I need to use the EJB or implement the web service?
    Many thanks
    Sigal

    Okay....I think I made some errors with the original scenario:
    It basically comes down to this....I think. OCS Calendar has a set of Java classes and methods that provide an abstraction for their web services interface. I know how to create something to use these classes using an IDE like JDeveloper, but I'm not sure how that would work with HTML DB.
    I've noticed that the SQL Workshop has a place for Java sources and classes, and I've heard mentions of PL/SQL wrapping. Is there a way to import classes into an HTML DB workspace, wrap 'em up, and access them via PL/SQL?
    Thanks again,
    Jonathan

  • How can I create an EntityStore for a Database?  Advice on DB strategy?

    Hello All,
    How can I create an com.sleepycat.persist.EntityStore for a com.sleepycat.db.Database? Advice on DB strategy?
    I'm looking to create an application prototype that creates a database dynamically and can delete it programatically. Is openDatabase/removeDatabase what I'd want to use for that?
    So far, the Direct Persistence Layer is an amazing piece of technology and has the potential to make my team's application faster than we every though possible, so kudos to the author.
    I've built a high-security application using the DPL and a single database for hundreds millions of users. I'd like to attempt to create a database for each user for security and manageability purposes. Our mission statement doesn't allow us to execute queries for sensitive data across more than one user account at a time, so I don't get any benefit from having every user's objects in a single database. I'm investigating if giving each user their own database will speed up insert times and SecondaryIndex queries. It'll certainly be more secure as each database will be encrypted with a unique password.
    My design is that I have an app with dozens of com.sleepycat.persist.model.Entity beans which I persist and query on their Primary and secondary indexes. I've been accessing things through an EntityStore as illustrated in the Getting Started Guide. Can I access a database created with openDatabase through an EntityStore and com.sleepycat.persist.PrimaryIndex?
    Thanks in Advance,
    Steven
    Harvard Childrens Hospital Informatics Program

    I closed this as I found another way to solve my issue.
    Thanks,
    Steven

  • Advice on a theoretical aspect

    I will soon have to finish my diploma research paper and project. My project has to outline the efficiency of using the Oracle JDeveloper-OLAP combination in business analisys, in my case, building all sorts of reports for a company that handles renting automated coffee machines.
    I need some theoretic advice, whether I planned my tables/dimensions right, because BI-Beans shows irrelevant data, you will see why.
    The data I have is provided from the company itself. Let me describe the situation:
    The company has offices in 6 states in Romania, each of these 6 states having several locations as entered in the table GEOGRAPHY (LOCATION, LOCATION_LLABEL, LOCATION_SLABEL, STATE, STATE_LLABEL, STATE_LLABEL, COUNTRY, COUNTRY_LLABEL, COUNTRY_SLABEL), all VARCHAR2(30), LOCATION being the PRIMARY_KEY.
    Example:
    INSERT INTO ... VALUES ('ARAD','ARAD','ARAD','JUD_ARAD','Judetul ARAD','AD','ROMANIA','Tara ROMANIA','RO'); INSERT INTO ... VALUES ('NADLAC','NADLAC','NADLAC','JUD_ARAD','Judetul ARAD','AD','ROMANIA','Tara ROMANIA','RO'); INSERT INTO ... VALUES ('BORS','BORS','BORS','JUD_BIHOR','Judetul BIHOR','BH','ROMANIA','Tara ROMANIA','RO');
    Each of these 6 states has a number of clients, as described in the table CLIENT(CLIENT, CLIENT_LLABEL, CLIENT_SLABEL, LOCATION, ADDRESS, PHONE, CONTACT_PERSON, CONTRACT_DATE), CLIENT being the PRIMARY_KEY.
    Example:
    INSERT INTO ... VALUES ('BEN00093','LUKOIL CALEA NADLAC ARAD', 'LUKOIL', 'NADLAC', 'CENTURA NADLAC NR.55', '257/216555', 'DAN ACONI', '01-Jan-2003');
    Each of these clients holds a number of coffee automated machines, as described in the table MACHINE(MACHINE_NO, TYPE, TYPE_LLABEL, TYPE_SLABEL, TOP, TOP_LLABEL, TOP_SLABEL, CLIENT, LOCATION), MACHINE_NO being the PRIMARY_KEY, CLIENT and LOCATION as FOREIGN_KEYs.
    Example:
    INSERT INTO ... VALUES ('15100231', 'COLIBRI', 'Model COLIBRI', 'CO', 'Machines', 'Coffee machines', 'Machines', 'BEN00093', 'NADLAC'); INSERT INTO ... VALUES ('15100234', 'COLIBRI', 'Model COLIBRI', 'CO', 'Machines', 'Coffee machines', 'Machines', 'BEN00066', 'ARAD');
    Going back up to geographic thinking, each of the 6 states has a number of AGENTS handling by rotation any of the CLIENTS in the state (there is not a certain agent allocated to a specific client, they divide the work between themselves, sometimes one of them isn't working and the other fills in for him ...) The table AGENT(AGENT, AGENT_LLABEL, AGENT_SLABEL, STATE, STATE_LLABEL, STATE_SLABEL, COUNTRY, COUTRY_LLABEL, COUNTRY_SLABEL, PHONENO), having AGENT as the PRIMARY_KEY.
    Example:
    INSERT INTO ... VALUES ('AG007','SIRGHIE NICOLAE','Agent 007','JUD_ARAD','Agents in ARAD state','AD Agents','ROMANIA','Agents in ROMANIA','RO Agents','+40723211331');
    I also have a table TIME(TIME_MONTH, TIME_MONTH_LLABEL, TIME_MONTH_SLABEL, TIME_QUARTER, TIME_QUARTER_LLABEL, TIME_QUARTER_SLABEL, TIME_YEAR, TIME_YEAR_LLABEL, TIME_YEAR_SLABEL, TIME_END_MONTH, TIME_END_QUARTER, TIME_END_YEAR, TIME_SPAN_MONTH, TIME_SPAN_QUARTER, TIME_SPAN_YEAR) with TIME_MONTH as the PRIMARY_KEY.
    AND a table HOTDRINS(DRINK, DRINK_LLABEL, DRINK_SLABEL, TOP, TOP_LLABEL, TOP_SLABEL)
    INSERT INTO ... VALUES ('cappucino', 'Cappucino', 'Capp', 'Drinks', 'Hot drinks', 'Drinks'); INSERT INTO ... VALUES ('cappfrvanilla', 'Cappucino French Vanilla', 'Capp Fr Vanilla', 'Drinks', 'Hot drinks', 'Drinks');
    I created a fact table FAPTE(time_leaves, geography_leaves, machine_leaves, hotdrinks_leaves, client_leaves, agent_leaves, sold_quantity), all of them except sold_quantity being primary keys. The sold_quantity is computed from a separate FoxPro database used currently by the company. I threw in only the rows that matched some rellevant data, without zero's in the countless situations where a client wouldn't match the machine no. or the geography. It still resulted in 50.000 records. Here's an example:
    INSERT INTO ... VALUES ('AUG03', 'ARAD', '24200429', 'cappucino', 'BEN00048', 'AG007', 145);
    I created the dimensions accordingly to the tables, setting some obvious hierarchies in GEOGRAPHY,TIME,HOTDRINKS,MACHINES and CLIENTS, then the cube and the measure folder, refreshed the metadata and away I went in BI Beans.
    BUT, my situation creates funny results in any crosstab or table, because of many nulls and the obligation to fit all the parameters rigt manually (setting the geography dimension to a certain city, selecting the right agents to match the city, the right client to match the city or the right machine to match the client ... and so on).
    Questions:
    1. What is the point of the GEOGRAPHY dimension taken separately when I have to put geographic hierarchical organisation in AGENT, CLIENT and MACHINES also?
    2. Am I thinking this problem straight? I'm not sure whether I analyzed my problem in order to give the optimal solution. I'm thinking of setting a single dimension that would include all GEOGRAPHY, CLIENTS and MACHINES together, setting a hierarchy like Country-> State-> Location-> Client-> Machines. But then I should go up again to involve geographic thinking again and set a dimension for AGENTS with a hierarchy like Country->State->Agents.
    3. Isn't there a possibility to go inside the code for the BIBeans query and set a more specific query, with the aid of some variables. Let's say I set the values for the geography dimension, can't I save the setting in a variable and refine my query upon clients based only on that geographic area?
    4. Isn't there a possibility for BIBeans to exclude the all null lines in a table or crosstab?
    Hoping you will find some time to see this, I thank you for your attention.
    Best regards,
    Ana

    There are so many possibilities and with various pros and cons.
    I am very happy using image software (I use ShadowProtect) to backup my OS/programs drive and a directory comparison tool (I strongly endorse Beyond Compare) to backup all of my data drives.
    Why?
    - third party Win7/8 imaging tools are very fast and do a good job of allowing you to restore to a different size / type of drive in the event of a failure (i.e. 128GB SSD to 250GB hard drive); Windows has a built in backup tool but it is neither flexible or fail proof from what I've heard
    - directory comparison tool for data drives because they only need to copy what is new or changed (very fast) and you don't need any special method or software to see, copy, use your backup data
    Regards,
    Jim

  • Combining single transaction between session bean & application client

    Hi All,
    The following transaction exception was encountered when trying to combine a EmployeeSessionBean.create(Employee) method in an application client:
    Application Client output
    SEVERE: null
    javax.transaction.SystemException: org.omg.CORBA.UNKNOWN: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.UNKNOWN: WARNING: IOP00010002: Unknown user exception thrown by the server - exception: org.eclipse.persistence.exceptions.DatabaseException; message:
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    Error Code: 0
    Call: INSERT INTO EmployeeDB.Project (ID, NAME) VALUES (?, ?)
    bind => [2 parameters bound]
    Query: InsertObjectQuery(domain.Project@19d2d53) vmcid: OMG minor code: 2 completed: Maybe
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:117)
    at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:126)
    ----------END server-side stack trace---------- vmcid: OMG minor code: 2 completed: Maybe
    at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:332)
    at com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate.commitDistributedTransaction(JavaEETransactionManagerJTSDelegate.java:184)
    at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:873)
    at com.sun.enterprise.transaction.UserTransactionImpl.commit(UserTransactionImpl.java:208)
    at applicationClient(*applicationClient.java:229*)
    GF 3.1 Server log
    WARNING: A system exception occurred during an invocation on EJB EmployeeSessionBean method public void ejb.EmployeeSessionBean.create(Employee) javax.ejb.EJBException
    Caused by: javax.persistence.TransactionRequiredException
    at ejb.EmployeeSessionBean.create(*EmployeeSessionBean.java:27*)
    SEVERE: RAR5027:Unexpected exception in resource pooling
    java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    WARNING: RAR7132: Unable to enlist the resource in transaction. Returned resource to pool. Pool name: [ mysqlPool ]
    WARNING: RAR5117 : Failed to obtain/create connection from connection pool [ mysqlPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    WARNING: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.]
    WARNING: Local Exception Stack:
    Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: cannot add non-XA Resource to global JTS transaction.
    Below is the code snippet of EmployeeSessionBean & client.applicationClient:
    @Stateless
    //@TransactionManagement(TransactionManagementType.BEAN)
    public class EmployeeSessionBean implements EmployeeService {   
        @PersistenceContext(unitName="EmployeeDB-PU")
        private EntityManager manager;
        public void create(Employee employee) {
            manager.persist(employee);  // line 27
    import javax.transaction.UserTransaction;
    public class applicationClient {
    @Resource UserTransaction tx;
    @EJB private static EmployeeService bean;
    try {
        tx.begin();
        Employee employee = new Employee()
            bean.create(employee);
    } finally {
           try {
                 tx.commit();  // line 229
    }How to relinguish transaction on EmployeeSessionBean so that all transaction could take place in applicationClient side only?
    I am trying to apply examples in Pro JPA 2 to a Java EE 6 ManyToMany application.
    Your assistance would be much appreciated.
    Thanks,
    Jack

    Hi r035198x,
    Thank you for some solid advice and would rather JPA take care of all the special cases such as keeping the records unique.
    Below are the changes made as suggested in ( 1 ), ( 2 ), ( 3 ):
    @Entity
    @IdClass(EmployeePK.class)
    @Table(name="EMPLOYEE", catalog="EmployeeDB", schema="")
    public class Employee implements Serializable {
        @Id
        @Column(name="FIRSTNAME")
        private String firstName;
        @Id
        @Column(name="SURNAME")
        private String surName;
        @Id
        @Column(name="DOB")
        @Temporal(TemporalType.DATE)
        private Date dob;
        @ManyToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}, fetch=FetchType.EAGER)
        @JoinTable(name="EMPLOYEE_PROJECT", catalog="EmployeeDB", schema="",
               joinColumns={@JoinColumn(name="FIRSTNAME_ID", referencedColumnName="FIRSTNAME"),
                            @JoinColumn(name="SURNAME_ID", referencedColumnName="SURNAME"),
                            @JoinColumn(name="DOB", referencedColumnName="DOB")},
               inverseJoinColumns={@JoinColumn(name="PROJECT_ID")})
            private Set<Project> projects = new HashSet<Project>();
    @Entity
    @Table(name="PROJECT", catalog="EmployeeDB", schema="")
    public class Project implements Serializable {
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column(name="ID")
        private int id;
        @ManyToMany(mappedBy="projects", cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}, fetch=FetchType.EAGER)
            @JoinTable(name="EMPLOYEE_PROJECT", catalog="EmployeeDB", schema="",
               joinColumns={@JoinColumn(name="PROJECT_ID", referencedColumnName="PROJECT_ID")},
               inverseJoinColumns={@JoinColumn(name="FIRSTNAME_ID", referencedColumnName="FIRSTNAME"),
                            @JoinColumn(name="SURNAME_ID", referencedColumnName="SURNAME"),
                            @JoinColumn(name="DOB_ID", referencedColumnName="DOB")})
        private Set<Employee> employees = new HashSet<Employee>();
    @Stateless
    public class EmployeeSessionBean implements EmployeeService {
        @PersistenceContext(unitName="EmployeeDB-PU") private EntityManager manager;
        public void create(Employee employee)
            manager.persist(employee);
    public class applicationClient {
        @EJB
        private static EmployeeService bean;
        public static void main(String[] args) {
        Employee employee = new Employee()
        bean.create(employee);   // line 209
    } I have diverged slightly from using simple primary key (EMPLOYEE_ID) to composite key class (FIRSTNAME, SURNAME, DOB) to resemble the actual application.
    Also gone back to using non - XADatasources since I am depending on JTA to do all the hardwork on the server side.
    Unfortunately, we have hit a snag once again with the following exception still:
    Application Client Output
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:432)
    at org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:182)
    at org.glassfish.appclient.client.AppClientGroupFacade.main(AppClientGroupFacade.java:65)
    Caused by: javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446347 Maybe; nested exception is:
    org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.MARSHAL: WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream vmcid: OMG minor code: 11 completed: Maybe
    Caused by: java.io.StreamCorruptedException: WARNING: ORBIO00013: Stream corrupted
    ----------END server-side stack trace---------- vmcid: OMG minor code: 11 completed: Maybe
    at ejb._EmployeeService_Wrapper.create(ejb/_EmployeeService_Wrapper.java)
    at applicationClient(applicationClient.java:209)
    GF 3.1 Server log
    WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream
    org.omg.CORBA.MARSHAL: WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream vmcid: OMG minor code: 11 completed: Maybe
    Caused by: java.lang.NullPointerException
    WARNING: ORBIO00013: Stream corrupted
    java.io.StreamCorruptedException: WARNING: ORBIO00013: Stream corrupted
    Your valuable input would be very appreciated.
    Thanks,
    Jack

  • Error while invoking bean "presentation manager":

    Hi,
    BPEL PM version : 10.1.2.0.2
    Scenario : I have a Process1 which tries to access Another Process Process2. Process1 has a PL for a Webservice (WS1) whose end point is Process2's endpoint.
    For architectural reason's I need to keep both the processes independent and that's the only way I can call Process2 as I've no control of Process1 and can not modify it except changing the endPoint location for WS1.
    First question will this work ? If no then is there another way of doing this ?
    If yes then I'm seeing the error message posted below.
    Please advice.
    <2007-03-08 08:29:30,019> <ERROR> <default.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "presentation manager": HTML form size is larger than the preset limit: 70
    java.lang.IllegalStateException: HTML form size is larger than the preset limit: 70
         at com.collaxa.cube.xml.xsd.xerces.HtmlFormHelper.incInputCount(HtmlFormHelper.java:46)
         at com.collaxa.cube.xml.xsd.xerces.HtmlFormHelper.writeSchemaType(HtmlFormHelper.java:109)
         at com.collaxa.cube.xml.xsd.xerces.HtmlFormHelper.writeElementSimpleType(HtmlFormHelper.java:232)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:137)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeChildElementsFromElementDecl(SchemaToForm.java:374)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.writeForm(SchemaToForm.java:165)
         at com.collaxa.cube.xml.xsd.xerces.SchemaToForm.generateForm(SchemaToForm.java:104)
         at com.collaxa.cube.xml.xsd.xerces.WSDLFormHandler.writeForm(WSDLFormHandler.java:138)
         at com.collaxa.cube.xml.xsd.xerces.WSDLFormHandler.writeForm(WSDLFormHandler.java:92)
         at com.collaxa.cube.xml.xsd.xerces.WSDLFormHandler.write(WSDLFormHandler.java:76)
         at com.collaxa.cube.ejb.impl.PresentationManagerBean.getInitiateFormContent(PresentationManagerBean.java:66)
         at IPresentationManagerBean_StatelessSessionBeanWrapper62.getInitiateFormContent(IPresentationManagerBean_StatelessSessionBeanWrapper62.java:81)
         at com.oracle.bpel.client.BPELProcessHandle.getInitiateFormContent(BPELProcessHandle.java:383)
         at ngInitiateForm.jspService(_ngInitiateForm.java:243)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121)
         at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:267)
         at displayProcess.jspService(_displayProcess.java:806)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
         at com.collaxa.cube.fe.DomainFilter.doFilter(DomainFilter.java:152)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)

    Another thing I want to mention is if I run my process2 independently it works fine. So my guess is that the way I'm calling Process2 from Process1 maynot be correct. I'm not even sure if this thing will actually work or not.
    Process1 has a webservice that has http binding to call an outside servlet. I need to have another layer in between (Process2) that will call the Outside servlet. So it's Process1 calling Process2 and Process2 calling the outside servlet.
    My hands are tied that I can't change the webservice in Process1 or modify Process1 directly (I don't own this and it's shipped as standard functionality) which calls the servlet and has http binding. How can I call Process2 from the same binding and what endpoint should I use for my process ?
    Any help is highly appreciated.
    Thanks,
    Megha

  • Deploying BMP Entity Bean with primary key calss

    Hi,
    I am using EJB 2.0 with and websphere studio 5.0 and database is sql server 2000.
    My BMP Entity bean has a primary key class.From my client I am invoking the Entity Bean by calling it's findbyprimarykey method.
    The home interface of my findbyprimarykey method returns a class of type Remote.But in the Entity Bean class,the return type is the primarykey class type.
    My problem is invoking this findbyprimarykey from the client to get the remote interface so that the other business methods of the entity bean can be called.
    The control goes into the ejbFindbyPrimaryKey but when it is returing from the Entity Bean class,it gives a remote exception (as the return type in Entity Bean class and Home interface are different for the findbyprimarykey method).
    I think that somewhere in the deployment decriptor in my websphere,i have to specify the primarykey class type,which i am missing out and hence getting the error.
    Please help me out with your advice and solution.
    Thanks
    Rahul Priyadarshi

    Hi,
    Sorry to disturb you again.
    Even my code is also almost the same....i am pasting the code below...Please go through it and let me know if I have made any mistake..
    EditVendorEntityBean.....(Bean Class)
    package code.beans.EditVendor;
    import code.beans.dataAccess.*;
    import javax.ejb.CreateException;
    import javax.ejb.RemoveException;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.EJBException;
    import javax.ejb.FinderException;
    import javax.ejb.ObjectNotFoundException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    * Bean implementation class for Enterprise Bean: EditVendorEntity
    public class EditVendorEntityBean implements javax.ejb.EntityBean {
         private static Hashtable dataSources = new Hashtable();
         private String username;
    private int Vendor_ID;
    private int Category_Id;
    private String Category_Name;
    private String Vendor_Name;
    private String Vendor_Address1;
    private String Vendor_Address2;
    private String Contact_Name;
    private String Home_Phone;
    private String Work_Phone;
    private String email;
    private String faxno;
    private String userloginname;
    private boolean dirtyFlag = false;
    private EntityContext context;
    private static final String DS_NAME = "jdbc/spiPOPS";
    Connection con = null;
    Statement stmt = null;
    PreparedStatement st = null;
    ResultSet res = null;
         //***********************Business Methods*********************
    // Begin of Busines Methods
    public void setData (String[] catname, String vendorname,String vendadd1,String vendadd2,String vendcontact,String venoff,String venres,String mailid,String venfax) {
              System.out.println("in setData where Vendor Id= "+ Vendor_ID);
                   boolean status=false;
                   boolean existing=false;
                   ArrayList cat=new ArrayList();
                   try
                        cat=getcategorylist(this.Vendor_ID);
                   catch(SQLException e)
                        System.out.println("Could not get category list");
                   System.out.println("Size of cat array -->" + cat.size() + " and string array size -->" + catname.length);
                   if(catname.length>0)
                        //Removing unwanted vendor categories for a particular vendor id
                        for(int i=0;i<cat.size();i++)
                                  existing=false;
                                  String tempdata=(String)cat.get(i);
                                  for(int j=0;j<catname.length;j++)
                                       if(tempdata.equals(catname[j]))
                                            existing=true;
                                  if(!existing)
                                       try
                                            delvencat(this.Vendor_ID,tempdata.trim());
                                       catch(SQLException e)
                                            System.out.println("Could not delete record in POPS_VENDOR_CATEGORY for -->" + tempdata);
                   //Adding new vendor categories for a particular vendor
                        try
                                  for(int i=0;i<catname.length;i++)
                                       status=false;
                                       String strcat=catname;
                                       status=checkcat(this.Vendor_ID,strcat.trim());
                                       if(!status)
                                            insertvencat(this.Vendor_ID,strcat.trim());
                        catch(SQLException e)
                                  System.out.println("Could not insert or select from POPS_VENDOR_CATEGORY table");
                   this.Vendor_Name          =vendorname;
              this.Vendor_Address1     =vendadd1;
              this.Vendor_Address2     =vendadd2;
              this.Contact_Name          =vendcontact;
              this.Work_Phone               =venoff;
              this.Home_Phone               =venres;
              this.email                    =mailid;
              this.faxno                    =venfax;
                   dirtyFlag = true;
                   System.out.println("Leaving set data method");
    public Vector getData() {
         Vector vctRec=new Vector();
         ArrayList arrdatas = new ArrayList();
         arrdatas.add(""+this.Vendor_ID);
         arrdatas.add(this.Vendor_Name);
         arrdatas.add(this.Vendor_Address1);
         arrdatas.add(this.Vendor_Address2);
         arrdatas.add(this.Contact_Name);
         arrdatas.add(this.Work_Phone);
         arrdatas.add(this.Home_Phone);
         arrdatas.add(this.email);
         arrdatas.add(this.faxno);
         vctRec.addElement(arrdatas);
         ArrayList cat=new ArrayList();
              try
              System.out.println("Calling getcategorylist from getdata with vendorid-->" + this.Vendor_ID);
              cat          = getcategorylist(this.Vendor_ID);
         catch(SQLException e)
                   System.out.println("Could not get datas for category list");
         vctRec.addElement(cat);
         ArrayList allcats=new ArrayList();
         try
                        allcats          = getallcategorylist();
              catch(SQLException e)
                        System.out.println("Could not get datas for category list");
         vctRec.addElement(allcats);
              dirtyFlag = false;
         System.out.println("Before return statement in getdata with vector size -->" + vctRec.size());
              return vctRec;
    // End of Business Methods
    //**************************Entity Bean Methods*******************************
         * ejbActivate
         public void ejbActivate() {
              Vendor_ID = Integer.parseInt((String)context.getPrimaryKey());
         System.out.println("Inside ejbActivate Vendor_ID-->"+ Vendor_ID);
         * ejbLoad
         public void ejbLoad() {
              System.out.println("Inside ejbLoad ********" );
    try {
    loadRow();
    }catch (Exception ex) {
              System.out.println("Failed in loadRow()");
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
         * ejbPassivate
         public void ejbPassivate() {
         System.out.println("Inside ejbPassivate " );
    Vendor_ID = 0;
         * ejbRemove
         public void ejbRemove() throws javax.ejb.RemoveException {
              //Empty Method
         * ejbStore
         public void ejbStore() {
    System.out.println("Inside ejbStore " );
    try {
    storeRow();
    }catch (Exception ex) {
              System.out.println("Exception thrown in storeRow" + ex.getMessage());
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
         * getEntityContext
         public javax.ejb.EntityContext getEntityContext() {
              return context;
         * setEntityContext
         public void setEntityContext(javax.ejb.EntityContext ctx) {
              System.out.println("Inside setEntityContext " );
    try{
         con = getConnection(DS_NAME);
         System.out.println("DB Connection Created!!");
    catch(Exception e){
    this.context = ctx;
         * unsetEntityContext
         public void unsetEntityContext() {
    System.out.println("Inside unsetEntityContext " );
    closeDbConnection(con, res, st);
    this.context = null;
         * ejbCreate
         //code.beans.EditVendor.EditVendorEntityKey
         public code.beans.EditVendor.EditVendorEntityKey ejbCreate(String vendorid)
              throws javax.ejb.CreateException {          
              return new EditVendorEntityKey(vendorid);
              //return null;
         * ejbPostCreate
         public void ejbPostCreate(String vendorid) throws javax.ejb.CreateException {
              //Empty
         * ejbFindByPrimaryKey
         //code.beans.EditVendor.EditVendorEntityKey
         public code.beans.EditVendor.EditVendorEntityKey ejbFindByPrimaryKey(
              code.beans.EditVendor.EditVendorEntityKey primaryKey)
              throws javax.ejb.FinderException {
    try {
    if(selectByPrimaryKey(Integer.parseInt(primaryKey.getVendorId()))) {
              System.out.println("Leaving the findbyprimarykey method from the entity bean");
         return primaryKey;
         //return null;
    }else {
         throw new ObjectNotFoundException
         ("Row for id " + primaryKey + " not found.");
    }catch (Exception ex) {
    throw new EJBException("EXCEPTION IN ejbFindByPrimaryKey :- " + ex.getMessage());
         /*********************** Database Utility Routines *************************/
    private boolean selectByPrimaryKey(int priKey)
    throws SQLException {
         System.out.println("inside selectByPrimaryKey for primary key " + priKey);
    String queryStr ="SELECT VENDOR_ID FROM POPS_VENDOR WHERE VENDOR_ID = " + priKey;
    System.out.println("in selectByPrimaryKey where queryString is: "+ queryStr);
              stmt = con.createStatement();
    ResultSet result = stmt.executeQuery(queryStr);
    if(!result.next()) {
    stmt.close();
         System.out.println("Did not find "+priKey);
    return false;
    else { //Found the primaryKey
    Vendor_ID = result.getInt("VENDOR_ID");
    stmt.close();
    return true;
    private void loadRow() throws SQLException {
              System.out.println("inside loadRow ...");
              stmt = con.createStatement();
              String queryStr = "SELECT VENDOR_NAME,VENDOR_ADDRESS1,VENDOR_ADDRESS2,CONTACT_NAME,HOME_PHONE,WORK_PHONE,EMAIL_ID,FAX_NO " +
                                  "FROM POPS_VENDOR WHERE VENDOR_ID=" + Vendor_ID;
              System.out.println("Inside loadRow()***********"+queryStr);
              ResultSet result = stmt.executeQuery(queryStr);
              ArrayList catadatas=new ArrayList();
         if(!result.next())
         throw new SQLException("No record for primary key" + Vendor_ID);
              this.Vendor_ID               =Vendor_ID;
                        this.Vendor_Name          =result.getString("VENDOR_NAME");
                        this.Vendor_Address1     =result.getString("VENDOR_ADDRESS1");
                        this.Vendor_Address2     =result.getString("VENDOR_ADDRESS2");
                        this.Contact_Name          =result.getString("CONTACT_NAME");
                        this.Home_Phone               =result.getString("HOME_PHONE");
                        this.Work_Phone               =result.getString("WORK_PHONE");
                        this.email                    =result.getString("EMAIL_ID");
                        this.faxno                    =result.getString("FAX_NO");
                             System.out.println("Leaving loadrow method with loaded datas for vendor -->" + Vendor_ID);
                             stmt.close();
    private ArrayList getcategorylist(int vendor) throws SQLException{
              String queryStr ="SELECT DISTINCT(VENDOR_CAT) FROM POPS_VENDOR_CATEGORY WHERE VENDOR_ID=" + vendor;
              System.out.println("Query for the cat list --> " + queryStr);
              stmt = con.createStatement();
              ResultSet result = stmt.executeQuery(queryStr);
              ArrayList catdatas=new ArrayList();
    try{
                   while(result.next())
                        catdatas.add(result.getString("VENDOR_CAT"));
              catch (SQLException e){
                   stmt.close();
                   System.out.println("Could not retrieve datas for Category list");
              stmt.close();
              System.out.println("size off array for cat -->" + catdatas.size() + " and datas ->" + catdatas);
              return catdatas;
         private ArrayList getallcategorylist() throws SQLException{
                   //String queryStr ="SELECT DISTINCT(VENDOR_CAT) FROM POPS_VENDOR_CATEGORY";
                   StringBuffer strquery=new StringBuffer(20);
                   strquery.append("SELECT DISTINCT(CATEGORY_NAME) FROM POPS_CATEGORY");
                   stmt = con.createStatement();
                   //ResultSet result = stmt.executeQuery(queryStr);
                   ResultSet result = stmt.executeQuery(strquery.toString());
                   ArrayList catdatas=new ArrayList();
                   try{
                        while(result.next())
                                  //catdatas.add(result.getString("VENDOR_CAT"));
                                  catdatas.add(result.getString("CATEGORY_NAME"));
                   catch (SQLException e){
                             stmt.close();
                             System.out.println("Could not retrieve datas for All Category list");
                   stmt.close();
                   return catdatas;
         private void delvencat(int vendor,String vencat) throws SQLException {
              int update=-1;
              stmt = con.createStatement();
              String queryStr ="DELETE FROM POPS_VENDOR_CATEGORY WHERE VENDOR_ID = " + vendor + " AND VENDOR_CAT = '" + vencat.toUpperCase() + "'";
              System.out.println("Delete query --> " + queryStr);
              update= stmt.executeUpdate(queryStr);
              if(update!=1)
                   System.out.println("Did not find data to delete");
              stmt.close();
         private void insertvencat(int vendor,String vencat) throws SQLException {
              int update=-1;
              String queryStr ="INSERT INTO POPS_VENDOR_CATEGORY(VENDOR_ID,VENDOR_CAT)" +
                                  " VALUES(" + vendor +",'" + vencat + "')";
              System.out.println("Insert query --> " + queryStr);
              stmt = con.createStatement();
              update=stmt.executeUpdate(queryStr);
              if(update!=1)
                   System.out.println("Could not insert records in the database");
              stmt.close();
         private boolean checkcat(int vendor,String catven) throws SQLException {
              boolean datastatus=false;
              String queryStr ="SELECT VENDOR_ID FROM POPS_VENDOR_CATEGORY WHERE VENDOR_ID = " + vendor + " AND VENDOR_CAT = '" + catven.toUpperCase() + "'";
              stmt = con.createStatement();
              ResultSet result = stmt.executeQuery(queryStr);
              datastatus=result.next();
              stmt.close();
              return datastatus;
    private void storeRow() throws SQLException {
                   System.out.println("Inside ejb store");
         if (!dirtyFlag) {
         System.out.println("Skipping the UPDATE because object is not dirty");
         return;
         CallableStatement cs=null;
    try{
                        cs = con.prepareCall("EXEC POPS_VENDOR_UPDATE " + this.Vendor_ID + ",'" + this.Vendor_Name + "','" + this.Vendor_Address1 + "','" + this.Vendor_Address2 + "','" + this.Contact_Name + "','" + this.Work_Phone + "','" + this.Home_Phone + "','" + this.email + "','" + this.faxno +"'");
                        System.out.println("\n\n SQL Statement : \n " + "EXEC POPS_VENDOR_UPDATE " + this.Vendor_ID + ",'" + this.Vendor_Name + "','" + this.Vendor_Address1 + "','" + this.Vendor_Address2 + "','" + this.Contact_Name + "','" + this.Work_Phone + "','" + this.Home_Phone + "','" + this.email + "','" + this.faxno +"'");
                        cs.executeUpdate();
              catch (SQLException e){
                        cs.close();
                        System.out.     println("\n\n Error in calling stored procedure POPS_INSERT_NEW_REQUEST \n\n"+ e.getMessage() + "\n\n");
              cs.close();
              dirtyFlag = false;
         private Connection getConnection(String dbName) throws SQLException
              String configuredDataSourceName = null;
              if (dbName == null) {
                   System.out.println("Attemp to get connection failed. The requested database name is null");
              DataSource dbSource = getDataSource(dbName);
              return dbSource.getConnection();
         private DataSource getDataSource(String dbName)
              // looking from cache;
              DataSource dbSource = (DataSource) dataSources.get(dbName);
              if (dbSource == null) { //we need to find it from JNDI
                   try {
                        Context ic = new InitialContext();
                        dbSource = (DataSource) ic.lookup(dbName);
                        dataSources.put(dbName, dbSource);
                   }catch (NamingException e){
              return dbSource;
         * User calls this function to safely close an connection
         * @param connt The connection a datasource
         * @param rs The resulSet inside this connection
         * @param statement The statement associate with this connection
         private void closeDbConnection(Connection cont,ResultSet rs,Statement statement)
              if (rs != null)
              try {
                        rs.close();
                   } catch (SQLException ignored) {
                        ignored.printStackTrace();
              if (statement != null)
                   try {
                        statement.close();
                   } catch (SQLException ignored) {
                        ignored.printStackTrace();
              if (cont != null)
                   try {
                        cont.close();
                   } catch (SQLException ignored) {
                        ignored.printStackTrace();
         } //closeDbConnection
    EditVendorEntity (Remote Interface)
    package code.beans.EditVendor;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    import java.util.*;
    * Remote interface for Enterprise Bean: EditVendorEntity
    public interface EditVendorEntity extends javax.ejb.EJBObject {
         public void setData (String[] catname, String vendorname,String vendadd1,String vendadd2,String vendcontact,String venoff,String venres,String mailid,String venfax)
                   throws RemoteException;
    public Vector getData() throws RemoteException;
    EditVendorEntityHome (Home Interface)
    package code.beans.EditVendor;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import javax.ejb.DuplicateKeyException;
    import javax.ejb.EJBHome;
    import java.util.*;
    * Home interface for Enterprise Bean: EditVendorEntity
    public interface EditVendorEntityHome extends javax.ejb.EJBHome {
         * Creates an instance from a key for Entity Bean: EditVendorEntity
         public code.beans.EditVendor.EditVendorEntity create(String vendorid)
              throws javax.ejb.CreateException, java.rmi.RemoteException;
         * Finds an instance using a key for Entity Bean: EditVendorEntity
         public code.beans.EditVendor.EditVendorEntity findByPrimaryKey(
              code.beans.EditVendor.EditVendorEntityKey Vendor_ID)
              throws javax.ejb.FinderException, java.rmi.RemoteException;
    EditVendorEntityKey (Primary Key Class)
    package code.beans.EditVendor;
    * Key class for Entity Bean: EditVendorEntity
    public class EditVendorEntityKey implements java.io.Serializable {
         static final long serialVersionUID = 3206093459760846163L;
         public String primkey;
         * Creates an empty key for Entity Bean: EditVendorEntity
         public EditVendorEntityKey() {  }
         public EditVendorEntityKey(String primarykey) {     
              this.primkey=primarykey;
         public String getVendorId() {
    return primkey;
         * Returns true if both keys are equal.
         public boolean equals(java.lang.Object otherKey) {
              if (otherKey instanceof code.beans.EditVendor.EditVendorEntityKey) {
                   code.beans.EditVendor.EditVendorEntityKey o =
                        (code.beans.EditVendor.EditVendorEntityKey) otherKey;
                   return (primkey.equals(otherKey));
              return false;
         * Returns the hash code for the key.
         public int hashCode() {
              return (primkey.hashCode());
    Please go through and give me your comments and solution...
    Thanks in advance
    Rahul

  • Stateless session Bean - xml and ejb-jar.xml file ???

    Dear Experts,
    Stateless-session bean
    For Creating an ear file
    we need ejb-jar.xml and weblogic-ejb-jar.xml files
    Is these files are already available
    or we have to type these files ??
    Advance Thanks
    Rengaraj.R

    My best advice: surrender to use an IDE.
    You wonder sometimes at how much productivity (read as 'time') could be wasted by doing something that could be done automatically. For a learning experience or a once only exercise is fine but as a routine thing, not worth it.
    Cheers

  • How to realize timeout while invoking a method in remote sesssion bean using my session bean running on wls5.1

    I am using WL5.1 SP11 on a project. I have a stateless session bean inside which
    I will invoke a method defined in another stateless session bean in a remote weblogic
    server 5.1. The performance of the remote server is very low and sometimes when
    I invoke the method through RMI, I got to wait for a long time. So I want to set
    a timeout for my session bean while doing RMI call. The only parameter I could
    find in weblogic-ejb-jar.xml is the "transaction-timeout", but even if I set transaction
    attribute for my session bean, it always block there to wait for the response
    from the remote session bean. The configuation did not work.
    Is there any other solutions to my problem? Please give me some advice if anyone
    has experience on it, Thank you very much.

    I am using WL5.1 SP11 on a project. I have a stateless session bean inside which
    I will invoke a method defined in another stateless session bean in a remote weblogic
    server 5.1. The performance of the remote server is very low and sometimes when
    I invoke the method through RMI, I got to wait for a long time. So I want to set
    a timeout for my session bean while doing RMI call. The only parameter I could
    find in weblogic-ejb-jar.xml is the "transaction-timeout", but even if I set transaction
    attribute for my session bean, it always block there to wait for the response
    from the remote session bean. The configuation did not work.
    Is there any other solutions to my problem? Please give me some advice if anyone
    has experience on it, Thank you very much.

  • Problems with a java bean in Weblogic 5.1

    Hello,
              I am having a problem deploying a java bean in Weblogic 5.1:
              I have been given a .class and a .jar file for a java bean (not an EJB). I
              placed the .class file into e:\temp\WEB-INF\classes and added the following
              line to my weblogic.properties file:
              weblogic.httpd.webApp.testApp=e:/temp/
              I have also updated the web.xml file in the WEB-INF directory as follows:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 1.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>EdIface</servlet-name>
              <jsp-file>test.jsp</jsp-file>
              </servlet>
              <servlet-mapping>
              <servlet-name>EdIface</servlet-name>
              <url-pattern>EdIface</url-pattern>
              </servlet-mapping>
              </web-app>
              When I try to access my http:\\server:port\testApp\test I get an "Error
              500 - internal server error".
              Has anyone had experice with deploying a java bean with jsut the .class and
              .jar file? Where should I put the .jar file?
              I appreciate any advice!
              

    Bump

  • Jelly Bean - Email AutoSync No Longer Works

    I am at Android 4.1.1 (Jelly Bean) on my stock Samsung Galaxy S3.  Since the Jelly Bean upgrade, my e-mail will MANUALLY sync e-mails, but will no longer AUTOMATICALLY sync e-mails per the Peak/Off-Peak schedule for any of my e-mail accounts except for my Exchange account.  I have tried:
    Adjusting the Peak/Off-Peak schedules to several different times / schedules.
    Changing the period to synch from 1 Month or 100 e-mails to 1 month.
    Accessing the Email app via the Applications interface and clearing all data.Step above obviously necessitated re-entering all e-mail accounts.
    I have confirmed that Settings>Email(under Accounts Header) shows a green synch icon beside all four of my non Exchange accounts.
    I've been messing with this for a number of days now and I'm hitting a wall.  This is not a menu-based configuration issue as far as I can tell AND it worked fine under ICS. 
    In case someone wants the information to diagnose, the non-exchange Accounts:
    2 x @bellsouth.net (associated with my AT&T service, but hosted by yahoo.com service).
    1 x @yahoo.com
    1 x @gmail.com
    My settings for synchronization (for all four accounts):
    All days selected.
    Peak schedule: Every Hour
    Off-peak Schedule: Never
    Peak start @ 7:00 AM
    Peak end @ 10:00 PM
    While Roaming: Use Above Settings. 
    Any suggestions?  (Other than the usual default "Have you tried a factory reset" that would require me to spend a day trying to get everything set back up and is basically a support tree "I can't figure it out easily so let's make your life harder because I can't be bothered" type of solution.)

    Mine started @ JB, but in trying to research the problem on my own - I can confirm your observation that people are reporting sync issues across multiple platforms / e-mail providers.  What is weird about it is that on irregular occasions, one of my accounts will actually "sync."  As an example since I wrote the original post - I did get  notification of new emails in one of my accounts - I have purposely not been manually checking my accounts to see what is happening.  Interestingly, When I look at Settings>Email, it shows all of my accounts having been sync'd at 10:00 AM.  So what does that mean?  Sync is partially working, but not consistently (e-mails from across 4 hours came in when it is set to sync hourly) and even within the phone the sync status isn't being displayed correctly.  Something is clearly fubar'd I just don't know what.  (thanks for the advice though)

  • Column Not found error while trying to access databse through JSP+Java Bean

    I am trying to acees MS Access 2003 db through JSP using Tomcat 5.0.28.The code for accessing the databse is incorporated in the bean.The jsp only calls the particular method of the bean .
    Code for Java Bean:
    package ActiveViewer;
    import java.sql.*;
    import java.util.*;
    public class CompanyBean
    Connection con;
    ResultSet rs=null;
    Statement st;
         public CompanyBean(){}
         public void connect()
         try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Here4");
    con=DriverManager.getConnection("jdbc:odbc:activeviewer","","");
         System.out.println("Here1");
         catch (ClassNotFoundException e)
         System.out.println("Could not locate driver.");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
         e.printStackTrace();
         catch (Exception e)
    System.out.println("An unknown Exception has occured :: "+e);
         e.printStackTrace();
    public void disconnect()
         try
         if (con!=null)
    con.close();
         catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
         e.printStackTrace();
    public ResultSet select(String username)
    if(con!=null)
         try
    st=con.createStatement();
         rs=st.executeQuery("select * from company where username='" + username + "'");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
         e.printStackTrace();
    catch (Exception e)
    System.out.println("An Exception has occured while retrieving :: "+e);
    e.printStackTrace();
    else
    System.out.println("Connection to database was lost.");
    return rs;
    The code for JSP that uses the above bean is:
    <%@ page language="java" import="java.sql.*,ActiveViewer.* " contentType="text/html"%>
    <jsp:useBean id="conn" scope="session" class="ActiveViewer.CompanyBean" />
    <html>
    <body>
    <% String username=request.getParameter("username");
    String password=request.getParameter("password");
    System.out.println("username:"+username);
    System.out.println("password:"+password);
    conn.connect();
    ResultSet rs=conn.select(username);
    System.out.println("Below select ");
    while (rs.next())
    String dbusername=rs.getString("username");
         String dbpassword=rs.getString("password");
         if(dbusername.equals(username) && dbpassword.equals (password))
    { %> out.println("OK");
              <% }
    else { %>Invalid Username and / or Password.
    <br>Clickhere to go back to Login Page.
    <% }
    } %>
    </body>
    </html>
    I get the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Column not found
    though the database is not int he same folder as the jsp, the DSN is set correctly to pint to the db location.The jsp does print in stdout file:
    Here4 (from connect method above)
    Here 1 (from connect method above)
    Below Select (from jsp)
    This means that the jsp does connect to db but it gives the above error.Also the field name also matches that in the database and data is present in the db too.
    All other things like creating package for bean,incorporating the packakage are done.
    Can someone please help me with their precious advice?

    U're getting this error because there is no field called 'password' in ur database, the field in ur database is named 'cpassword' and not 'password'. So change the statement rs.getString("password"); to rs.getString("cpassword");

  • Looking for some advice on CEP HA and Coherence cache

    We are looking for some advice or recommendation on CEP architecture.
    We need to build a CEP application that conforms to the following:
    • HA with no loss of events or duplicate events when failing over to the backup server.
    • We have some aggregative rules that needs to see all events.
    • Events are XMLs with size of 3KB-50KB. Not all elements are needed for the rules but they are there for other systems that come after the CEP (the customer services).
    • The XML elements that the CEP needs are in varying depth in the XML.
    Running the EPN on a single thread is not fast enough for the required throughput mainly because network latency to the JMS and the heavy task of parsing of the XML. Because of that we are looking for a solution that will read the messages from the JMS in parallel (multi thread) but will keep the same order of events between the Primary and Secondary CEPs.
    One idea that came to our minds is to use Coherence cache in the following way:
    • On the CEP inbound use a distributed queue and not topic (at the CEP outbound it is still topic).
    • On the CEPs side use a Coherence cache that runs on the CEPs JVMs (since we already have a Coherence cluster for HA).
    • Both CEPs read from the queue using multi threading (10 reading threads – total of 20 threads) and putting it to the Coherence cache.
    • The Coherence cache is publishing the events to both CEPs on a single thread.
    The EPN looks something like this:
    JMS adapter (multi threaded) -> replicated cache on both CEPs -> event bean -> HA adapter -> channel -> processor -> ….
    Does this sounds sound to you?
    Are we over shooting here? Is there a simpler solution for our needs?
    Is there a best practice for such requirements?
    Thanks

    Hi,
    Just to make it clear:
    We do not parse the XML on the event bean after the Coherence. We do it on the JMS adapter on multiple threads in order to utilize all the server resources (CPUs) and then we put it in the replicated cache.
    The requirements from our application are:
    - There is an aggregative query that needs to "see" all events (this means that we need to pass all events thru a single processor and we cannot partition them to several processors).
    - Because this is a HA solution the events on both CEPs (primary and secondary) needs to be at the same order when reaching the HA inbound adapter and the processor.
    - A single thread JMS adapter is not reading the messages from the JMS fast enough mainly because it takes time to parse the XML to an event.
    - Using a multi-threaded adapter or many single threaded adapters with message selector will create a situation that the order of events on both CEPs will not be the same at the processor inbound.
    This is why we needed a mediator so we can read in multiple threads that will parse the XMLs in parallel without concerning on order of messages and on the other hand publish all the messages on a single thread to the processors on both CEPs from this shared mediator (we use a replicated cache that runs on both JVMs).
    We use queue instead of topic because if we read the messages from a topic on both CEPs it will be stored twice on the Coherence replicated cache. But if we use a queue, when server 1 read the message and put it in the Coherence replicated cache then server 2 will not read it because it was removed from the queue.
    If I understand correctly you are suggesting replacing the JMS adapter with an event bean that will read the messages from the JMS directly?
    Are you also suggesting that we will not use a replicated cache but instead a stand alone cache on each server? In this case how do we keep the same order of events on both CEPs (on both caches)?

  • Payload Swap bean not working

    Hi All,
    We are working on PI 7.11. We are trying to retrieve the attachments from the mails and convert them into files. We have enabled Keep Attachments in sender mail adapter. For swapping the payload we used payload swap bean. We referred the below blog
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    We are just trying with XML attachments.
    The problem now is the payloads are not swapping. The file contains only the body of the mail not the attachment. I dont know what I'm missing. Please advice
    Regards,
    Malini

    Hi abhishek,
    Please find below the config done in adapters
    1     localejbs/AF_Modules/PayloadSwapBean                          Local Enterprise Bean     1
    2     sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail
    1     swap.keyName     Content-Description
    1     swap.keyName     Content-Disposition
    1     swap.keyValue     MailAttachment-1
    1     swap.keyValue     attachment;filename="MailAttachment-1.xml"
    Regards,
    Malini

  • Trouble when embedding a Bean in an Office Document

    Hello all,
    I have to embed a Java Bean into an ActiveX Container like a MS Office document via the axbridge.
    Let me mention, what I have (successfully) done so far:
    - Create a Java Bean
    - Create a Jar file (incl. the manifest file)
    - Run the packager and register the Object
    - Test the control in the MS ActiveX Control Test Container
    System: Win2k, JSDK 1.4.2, JRE 1.4.2_03, Office 2000, Visual C++ 6.0 SP 3
    The ActiveX control works fine in the MS test container. When I try to embed it in another Container like a MS Office document or Macromedia Authoware, the Container Program hangs up without an error message. Also the Java Console contains no message.
    On the other side, the Control can successfully be created and used within VBA:
    Sub myTestApplet()
        Set myTest = CreateObject("TestApplet.Bean.1")
        �
        Set myTest = Nothing
    End Sub Doing so, the control works correctly, but isn�t displayed in the document.
    I tried to use different Superclasses for the Bean like Component, JComponent, Panel etc. and at last I used an empty Bean inherited from JComponent. Every try works well in the MS test container, but as soon as I try to embed it into an Office-Document the Application hangs up.
    The ActiveX Bridge from the 1.4.2 SDK/JRE Bundle doesn�t work at all, even not in the MS test container. Thus I installed the 1.4.2_03 JRE, which makes the controls work in the MS test container (but still not in other Containers).
    Can somebody help me? I have no idea for a workaround and I�m blocked now. Any advice is very welcome!
    Regards,
    Oliver

    Thank you very much for your interest at my problem.
    I try to describe exactly, what I do: I want to integrate a Java3D program into a Macromedia Authorware application. Therefore I want to convert the Java3D program into an ActiveX control (and use the ActiveX Bridge). Authorware must be able to access methods of the J3D program and the J3D program must be able to throw events to Authorware. I think this is nothing special for an ActiveX control.
    In order to avoid additional problems, I use a simple test application without Java3D (source code enclosed).
    I work on:
    WindowsXP,
    JSDK 1.4.2, JRE 1.4.2_3,
    Visual C++ 6.0 SP3 and I also tried Visual Studio .NET.
    Authorware 7
    MS Office 2000
    What have I done so far?
    - compiled the code and created a jar archive (manifest file enclosed)
    - packaged and registered the Bean as described in http://java.sun.com/j2se/1.4.2/docs/guide/beans/axbridge/developerguide/index.html
    - successfully tested the ActiveX control in the ActiveX Control Test Container. The exported methods appear (and work) correctly when I choose "invoke methods".
    Now to the problem(s): If I try to embed the control in Authorware or an office document via the ToolBox, the container program hangs up. But as already mentioned above, Visual Basic .NET embeds the control successfully. Therefore I try to create an ActiveX control in VB .NET, which integrates my Java Bean. Let's say a wrapper control. Here are the steps:
    - I opened Visual Studio .NET and created a new VB project based on template "Windows Application".
    - added the Bean to the ToolBox
    - added the Bean into the VB Form.
    - added a button into the form. The form designer created the Bean and button as:Friend WithEvents AxActiveXTest1 As AxActiveXTest.AxActiveXTest
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Me.AxActiveXTest1 = New AxActiveXTest.AxActiveXTest()
    Me.Button1 = New System.Windows.Forms.Button() - in the form designer double clicked the button and entered the following code: Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.AxActiveXTest1.appendText("Hello World")
    End Sub- test the form and click on the VB button.
    Now the error message listed above appears ("cannot invoke method 'appendText' at this time"). I have no idea, why VB crashes when I try to access a method of the Bean. Somewhere I must have made an error. Each assistance is very welcome.
    Thank you in advance and please excuse my less good English.
    Oliver
    Source code:
    1. Class ActiveXTest package de.acns.test;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.beans.*;
    import java.io.*;
    * class ActiveXTest
    public class ActiveXTest extends JPanel implements Serializable,
                                                       PropertyChangeListener
        // member variables
        private PropertyChangeSupport propertySupport;
        /** Creates new form ActiveXTest */
        public ActiveXTest() {
            propertySupport = new PropertyChangeSupport( this );
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            jButton1 = new javax.swing.JButton();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTextArea1 = new javax.swing.JTextArea();
            setLayout(new java.awt.GridBagLayout());
            jButton1.setText("Click Here!");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
            add(jButton1, gridBagConstraints);
            jScrollPane1.setMinimumSize(new java.awt.Dimension(160, 100));
            jScrollPane1.setPreferredSize(new java.awt.Dimension(160, 100));
            jTextArea1.setPreferredSize(new java.awt.Dimension(50, 50));
            jScrollPane1.setViewportView(jTextArea1);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
            add(jScrollPane1, gridBagConstraints);
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            // Add your handling code here:
            appendText("You clicked the java button.\n");
         * Public methods to export
        public void appendText( String text)
            jTextArea1.append(text);
        public void setText( String text )
            String oldValue = jTextArea1.getText();
            jTextArea1.setText( text );
            propertySupport.firePropertyChange("TEXT", oldValue,
                                               jTextArea1.getText());
        public String getText()
            return jTextArea1.getText();
         * PropertyChangeListener Support
        public void addPropertyChangeListener(PropertyChangeListener listener) {
            propertySupport.addPropertyChangeListener(listener);
        public void removePropertyChangeListener(PropertyChangeListener listener) {
            propertySupport.removePropertyChangeListener(listener);
         * static main method, enables the bean to be testet "standalone"
        public static void main( String[] args)
            // Create a new instance and add it to a JFrame
            ActiveXTest activeXTest = new ActiveXTest();
            JFrame      frame       = new JFrame("Testapplication");
            activeXTest.addPropertyChangeListener(activeXTest);
            frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE);
            frame.addWindowListener(new WindowAdapter()
                public void windowClosing( WindowEvent e )
                    System.exit(0);
            frame.getContentPane().setLayout( new GridLayout ());
            frame.getContentPane().add( activeXTest );
            frame.validate();
            frame.pack();
            frame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width 
                                 - frame.getWidth())  >> 1,
                               (Toolkit.getDefaultToolkit().getScreenSize().height
                                 - frame.getHeight()) >> 1 );
            frame.show();
         * For testing purposes only, when the bean is
         * created by the static main method
        public void propertyChange(PropertyChangeEvent evt)
            System.out.println("Property \"" + evt.getPropertyName()
                                + "\" wurde von \"" + evt.getOldValue()
                                + "\" in \"" + evt.getNewValue()
                                + "\" ge?ndert");
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextArea jTextArea1;
        // End of variables declaration
    } 2. ActiveXTestBeanInfopackage de.acns.test;
    import java.beans.*;
    * class ActiveXTestBeanInfo
    public class ActiveXTestBeanInfo extends SimpleBeanInfo {
        // Bean descriptor information will be obtained from introspection.
        private static BeanDescriptor beanDescriptor = null;
        private static BeanDescriptor getBdescriptor(){
            // Here you can add code for customizing the BeanDescriptor.
            return beanDescriptor;     }
        // Properties information will be obtained from introspection.
        private static PropertyDescriptor[] properties = null;
        private static PropertyDescriptor[] getPdescriptor(){
            // Here you can add code for customizing the properties array.
            System.out.println("ActiveXTestBeanInfo: Properties werden exportiert:");
            try
                // create the property descritpors
                properties = new PropertyDescriptor[]
                    new PropertyDescriptor( "text", de.acns.test.ActiveXTest.class )
                // For debugging purposes only
                for( int i=0; i<properties.length; i++)
                    System.out.println(properties.getShortDescription() );
    System.out.println(" ");
    catch( Exception e )
    e.printStackTrace();
    return properties; }
    // Event set information will be obtained from introspection.
    private static EventSetDescriptor[] eventSets = null;
    private static EventSetDescriptor[] getEdescriptor(){
    // Here you can add code for customizing the event sets array.
    return eventSets; }
    // Method information will be obtained from introspection.
    private static MethodDescriptor[] methods = null;
    private static MethodDescriptor[] getMdescriptor(){
    // Here you can add code for customizing the methods array.
    System.out.println("ActiveXTestBeanInfo: exportiere Methoden:");
    try
    // create the method descriptors
    methods = new MethodDescriptor[]
    new MethodDescriptor( ActiveXTest.class.getMethod("appendText", new Class[]{String.class}))
    // For debugging purposes only
    for( int i=0; i<methods.length; i++)
    System.out.println(methods[i].getName());
    System.out.println(" ");
    catch( Exception e)
    e.printStackTrace();
    return methods; }
    private static int defaultPropertyIndex = -1;
    private static int defaultEventIndex = -1;
    // Here you can add code for customizing the Superclass BeanInfo.
    * Gets the bean's <code>BeanDescriptor</code>s.
    * @return BeanDescriptor describing the editable
    * properties of this bean. May return null if the
    * information should be obtained by automatic analysis.
    public BeanDescriptor getBeanDescriptor() {
    return getBdescriptor();
    * Gets the bean's <code>PropertyDescriptor</code>s.
    * @return An array of PropertyDescriptors describing the editable
    * properties supported by this bean. May return null if the
    * information should be obtained by automatic analysis.
    * <p>
    * If a property is indexed, then its entry in the result array will
    * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
    * A client of getPropertyDescriptors can use "instanceof" to check
    * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
    public PropertyDescriptor[] getPropertyDescriptors() {
    return getPdescriptor();
    * Gets the bean's <code>EventSetDescriptor</code>s.
    * @return An array of EventSetDescriptors describing the kinds of
    * events fired by this bean. May return null if the information
    * should be obtained by automatic analysis.
    public EventSetDescriptor[] getEventSetDescriptors() {
    return getEdescriptor();
    * Gets the bean's <code>MethodDescriptor</code>s.
    * @return An array of MethodDescriptors describing the methods
    * implemented by this bean. May return null if the information
    * should be obtained by automatic analysis.
    public MethodDescriptor[] getMethodDescriptors() {
    return getMdescriptor();
    * A bean may have a "default" property that is the property that will
    * mostly commonly be initially chosen for update by human's who are
    * customizing the bean.
    * @return Index of default property in the PropertyDescriptor array
    *           returned by getPropertyDescriptors.
    * <P>     Returns -1 if there is no default property.
    public int getDefaultPropertyIndex() {
    return defaultPropertyIndex;
    * A bean may have a "default" event that is the event that will
    * mostly commonly be used by human's when using the bean.
    * @return Index of default event in the EventSetDescriptor array
    *          returned by getEventSetDescriptors.
    * <P>     Returns -1 if there is no default event.
    public int getDefaultEventIndex() {
    return defaultEventIndex;
    3. manifest file manifest.mf
    Manifest-Version: 1.0
    Name: de/acns/test/ActiveXTest.class
    Java-Bean: True

Maybe you are looking for