Session invalidated in JDeveloper 10.1.3.04
Hi,
I have a web application. It ran properly in JDeveloper 9i (embedded OC4J).
When I migrated to JDeveloper 10.1.3.04. I always get error: session invalidated.
The following is the detailed error message. Can some one help?
500 Internal Server Error
java.lang.IllegalStateException: Session was invalidated at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpSession.getAttribute(EvermindHttpSession.java:205) at org.apache.struts.util.RequestUtils.retrieveUserLocale(RequestUtils.java:991) at org.apache.struts.util.RequestUtils.message(RequestUtils.java:1046) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294) at login.jspService(_login.java:82) [login.jsp] at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230) at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298) at java.lang.Thread.run(Thread.java:534)
Please note that I have also watched as posted in one of the previous post about JUnit.
http://www.oracle.com/technology/products/jdev/101/viewlets/101/agile_development_viewlet_swf.html
The action to run junit test class is no available in my JDeveloper.
Can someone please shed some lights on this?
Thanks,
Mel
Similar Messages
-
Send message to client before session invalidated
i am using jsp and java servlet tech. for my web application.
my problem is :
i want to send a message to client before session invalidated.
please help me to find the best way to solve my problem.You can detect session termination by putting an object in the session attributes which implements HttpSessionBindingListener. What you can't do is send a message to a client, basically because all http transactions are initiated by the client. The only way I can see you could do this is to put an applet on your web pages which periodically consults the server concerning the session state.
Then the problem is that there's no obvious way of determining if the session is about to timeout, only whether it has or not. Your applet couldn't return the session cookie (as such) because that would reset the session timeout and the session would never expire. If you could obtain the session without reseting the expiry (perhaps from SessionContext though that's depracated) you could look at getLastAccessedTime() and getMaxInactiveInterval, but I don't know that this can be done. You can't even count, on some systems, on the session remaining in memory.
If you really need to do this you may need to consider implementing sessions for yourself. I've done this for non-webapp based logins and it's not too hard. -
How to make session invalid when user refresh the page?
How to make session invalid when user refresh the page?
I have a <form> in a JSP file that has another JSP file as an action.
I have main.jsp that has <form> with action.jsp file as an action.
Now when I submit the <form>, request forwarded to action.jsp and it will take the action. But this file is taking so long, hence user refresh the page again and again, hence duplicate request processing is occuring.
I want to prevent this. -
Creating EJB 3.0 Session Bean under JDeveloper 10g.
Hello im using JDeveloper 10 g all up 2 date.
when i create EJB 2.x EJB everythink is ok .. there is a Wizzard(Designer) from which i can add methods variables and etc.
all methods are become added to the session bean / remote interefeis etc.
My Problem is when i create EJB 3.0
when i do it the Bean class is created and the Remote interfeis with @remote is created too its ok BUT I CANT see Remote interfeis in my Application Naviagation its fine under 2.1 i cannot see remote interfeis and home interfeis too but inder 2.1 there is a wizzard(Designer) under 3.0 there is nothink.
what am i wrong ? how can i make designer to work under 3.0 or how can i make Jdeveloper to show me all content of the EJBsanother strange problem.
i have an APplication server added ( JBOSS ).
when i create deployment profile (EAR ) application server is showed in the ComboBox .
But when i create Java Test Client for some EJB and when i check " Connect Remote Application server" there is 2 comboboxes
J2EE Application
App Server Connection.
first combo is ok there is EJB applicaiton
Secound is empty .. but i Have App Server.
Another think is that when i create EJB 3.0 its BAD to see J2EE app it must be J EE 5 app or just Java EE app -
Error when Create Session Bean in JDeveloper
Hi All,
I followed the steps in the SRDemo tutorial to create Session bean SRPublicFacade. I used Create Session Bean wizard. Step 1 was ok. Step 2 when it's supposed to show all the POJOs and all methods (from Queries) it hang there, and skipped to Step 3 and so on... As a result I had an empty Session Bean with only class name and no methods in it. I do have correct database connection, and I have another project with similar Session Bean sucessfully. I just don't know what happened to this project or the way I created session bean this time. Any conflict when create Session Bean to the same database or something(?) Anyone has any idea please let me know.
Thank you very much,
JohnFrank,
Yes, I compiled the project before building the session facade. I used JDeveloper 10.1.3.3.0
The thing is I once created successfully the session facade in another project, like SRdemo. Now I would like to repeat that in another project say SRdemo2, then it went wrong. It skipped step 2 in the wizard and look like it cannot detect the tables and named queries.
Thanks,
John -
Running Oracle report in Portal 3.0.8 cause session invalid
Hi,
We are runnung Oracle portal30 3.0.8 in Window 2000 environment.
In one of the jsp portlet,
We set up a href link to run Oracle Report
( /dev60cgi/rwcgi60.exe?server=... ) in another browser window.
Once the report is submitted. the session got invalid....
We need to close the browser and start again. Then everything is working
fine as long as not running the Oracle Report.
When this is done in portal30 3.0.7., there is no problem at all. Is this a known bug and is there a fix for this??
Thanks
Jonathanhello,
i am not sure but this problem sound familiar. i think it has already been posted on this forum a view days ago.
the question is, how do you run the report ? when using a URL, what happens when you use a different -non report- URL ?
regards,
the oracle reports team -
How to send message to MessageDrivenBean from Session bean in JDeveloper
HI I am trying to write a sample program using JDeveloper.
I am trying to do these steps
1) client class which gets Session bean and calls its method.
2) write Stateless Session bean with a method which gets MDB and sends message.
3) write Message Driven Bean ( which prints message recieved from Session bean )
Set up
=======
jms.xml
{JDevHome}\jdev\system9.0.5.2.1618\oc4j-config\jms.xml : changed jms.xml file and included
<topic name="Demo Topic" location="jms/theTopic">
<description>A dummy topic</description>
</topic>
<topic-connection-factory name="Demo Topic Connection Factory" location="jms/theTopicConnectionFactory">
<description>A dummy topic connection factory</description>
</topic-connection-factory>
orion-ejb-jar.xml:
edited MDB entry to
<message-driven-deployment name="MessageLogger"
destination-location="jms/theTopic" connection-factory-location="jms/theTopicConnectionFactory">
</message-driven-deployment>
Implementation
===============
In client class:
I am getting session bean like
Properties props = System.getProperties();
props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY , "com.evermind.server.rmi.RMIInitialContextFactory");
props.put( javax.naming.Context.SECURITY_PRINCIPAL , "admin" );
props.put( javax.naming.Context.SECURITY_CREDENTIALS,"welcome");
props.put( javax.naming.Context.PROVIDER_URL ,"ormi://localhost:23891/current-workspace-app");
Context ctx = new InitialContext(props);
MySessionHome home = (MySessionHome)
javax.rmi.PortableRemoteObject.narrow(obj, MySessionHome.class);
This part works fine, and I am calling method on session bean created out of home.
In Session bean:
I want to get TopicConnectionFactory and tried these two ways:
a)
getting the context by setting new environemnt values like
Properties props = System.getProperties();
props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY , "com.evermind.server.jms.EvermindConnectionFactory");
props.put( javax.naming.Context.SECURITY_PRINCIPAL , "admin" );
props.put( javax.naming.Context.SECURITY_CREDENTIALS,"welcome");
props.put( javax.naming.Context.PROVIDER_URL ,"ormi://localhost:9227/current-workspace-app");
Context ctx = new InitialContext( props);
When I try this,it is complaining that it cannot instantiate EvermindConnectionFactory.
I am not sure which factory class we have to use here.i tried all the Factory class in that package.but didn't worked.
next I used,
b)
tried to use default context in session bean to get MDB factory
String TOPIC_NAME="jms/theTopic";
String TOPIC_CONNECTION_FACTORY="jms/theTopicConnectionFactory";
TopicConnectionFactory connectionFactory = (TopicConnectionFactory)new InitialContext().lookup("java:comp/env/" + TOPIC_CONNECTION_FACTORY);
this gives
04/06/13 23:46:09 javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found in MySession
04/06/13 23:46:09 at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:93)
this may be because JMS server runs on different port than other EJBs and have different namespaces.
Can any body give info,how we can make use of Message Driven bean from a Session Bean or from a JSP page or from a simple class inside JDeveloper.
Thanks in advance.
gopalHi,
There are some hints in this forum for how to do this.
I put together and make it working.
This example creates an MD Bean and have a simple message and a client class send messages to that bean.
Steps
=====
1)
a)in {JDev Home}\jdev\system9.0.5.2.1618\oc4j-config\jms.xml
<topic name="Demo Topic" location="jms/demoTopic">
<description>A dummy topic</description>
</topic>
<topic-connection-factory name="Demo Topic Connection Factory" location="jms/theTopicConnectionFactory">
<description>A dummy topic connection factory</description>
</topic-connection-factory>
b) in current project in orion-ejb-jar.xml
go to orion-ejb-jar properties and add these values there to MDB node
destination-location=jms/demoTopic
connection-factory-location=jms/theTopicConnectionFactory
2) create a dummy session bean and a dummy client for that session bean
This sets default configuration for the client application we write
doing so we do not need to set properties to get Initial context.It makes use of
{JDev Home}\jdev\system9.0.5.2.1618\oc4j-config\.client\jndi.properties
We can directly get Contexxt ctx = new InitialContext();
3) Create MDB and put this sample code in method
onMessage()
TextMessage tm = (TextMessage) msg;
try {
String text = tm.getText();
System.err.println("Received new message : " + text);
catch(JMSException e) {
e.printStackTrace();
4) go to properties for the MDB and set Destination to Topic
5) write Client code
Context ctx =new InitialContext();
// 1: Lookup ConnectionFactory via JNDI
TopicConnectionFactory factory =
(TopicConnectionFactory) ctx.lookup("jms/theTopicConnectionFactory");
// 2: Use ConnectionFactory to create JMS connection
TopicConnection connection = factory.createTopicConnection();
// 3: Use Connection to create session
TopicSession session = connection.createTopicSession( false, Session.AUTO_ACKNOWLEDGE);
// 4: Lookup Desintation (topic) via JNDI
Topic topic = (Topic) ctx.lookup("jms/demoTopic");
// 5: Create a Message Producer
TopicPublisher publisher = session.createPublisher(topic);
// 6: Create a text message, and publish it
TextMessage msg = session.createTextMessage();
msg.setText("This is a test message from My Test Client!!! .");
publisher.publish(msg);
6) Run the server and run the client -
Recognizing session invalidating
Hi all!
Following problem: I need to recognize if a session gets invalid, because i need some further logout from another application server. i cannot wait for the garbage collector, because i do not know when - if ever - it is started or wants to delete my connection object...
thx, manuelUse a session listener:
put in your web.xml:
<listener> <listener-class>ClassNameFromYourSessionListener</listener-class>
</listener>
Create a Class implements HttpSessionListener.
You have to implement :
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent httpSessionEvent)
public void sessionCreated(javax.servlet.http.HttpSessionEvent httpSessionEvent)
and now you get it.
regards Dietmar -
Session invalidated due to version mismatch of Websphere
It is real scenario happening in my project now also.. i am looking for solution
i have one Test.jsp which is running in websphere4.0 and it is going to invoke another two.jsp which is running in
websphere5.0.The one.jsp called two.jsp after that the session getting invalidated due to new session created
after hit the two.jsp in the websphere5.0.
this was identified by tracking the different session id generated from WS4 to WS5 server called.
How can i resolve this?
where should i change server configuration for websphere5.0?
Is this server configuartion is required?
Please provide how to track and reslove this issue?
Regards
VijayVijay,
First I guess that ur both the jsp are on diferent server and in different application, i dont think you cant share the same session across multiple applications w/o some configuration.
You got two webspheres and passing execution from app1 to app2. But how app2 can come to know about the session of app1 ? I guess you are doing inter context reference. And for that you need to use some specific configuration to synchronize the session between two application. Not just synchronization but you also need to tell both the servers that this user has logged in and create session for that use. And then keep it in sync.
Bakul. -
Applet on client to help with session invalidation
Dear All,
I have a web application that when run by a user, per request, takes up approximately 40 MB of memory due to massive data structures being created, etc. Obviously, if the user leaves the site and goes elsewhere, I don't want that memory being held, even until the session times out(which I have to set at 30 minutes, due to the user community requests). It was suggested to me to create an applet that is embedded in every JSP page that constantly updates an property in a servlet basically saying "I'm here" and when that property hasn't been updated in N seconds, the servlet will call the invalidate method on the session that's not been updated.
Is this approach feasible? Is there some simpler method I could take to get the same effect? I realize the web is state-less, but I need a work-around in this case to make it act like it is.
Thanks,
Mike BrubakerYou should not need a full-blown applet. You could always use the HTTP meta-refresh tags to request that the browser poll over an interval you specify. The simplest approach would be to open a popup window that has the refresh logic. Place a button there, "logout". You could also have a message, such as, "User [username] has been logged on for [interval]."
Also, consider serializing the 40 mB memory structure to the filesystem. This would work best if the time between requests is relatively longer than in most applications. If the latency of the database routines to generate the 40 mB structure is low, and the interval between requests is relatively high, consider discarding the memory structure after the request has been completed.
- Saish
"My karma ran over your dogma." - Anon -
Jsp, struts, problem in session invalidation
Hello,
Though have seen many topics here related to this, still cudn't get a proper solution. I'm having a struts application with many jsp's. have used session.invalidate for expiring sessions. Now the problem is my jsp have both button specific action and <html:link> forwards. tried including "response.setHeader("Cache-Control", "no-cache"); //Forces caches to obtain a new copy of the page from the origin server
response.setHeader("Cache-Control", "no-store"); //Directs caches not to store the page under any circumstance
response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
response.setHeader("Pragma", "no-cache"); //HTTP 1.0 backward compatibility"
got it from one of the topics here only.
Now when i logout from any of my jsp and press back button of browser, the jsp's having struts specific action(http://...../xyz/edituser.do)works fine but forward specific jsp's(http://...../xyz/edit.jsp) is not redirecting to my login page(page not found error :- /xyz/edit.jsp). Also what if i press the browser back button more thn once????? weather this thing works on client side???at the moment in my application even the action specific logout is not working.........how can i solve this problem elegantly?????I faced same problem.
I used below code.
This code in every Authorized page.
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Cache-Control","no-store");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma","no-cache");
%>
<%
String username=(String) session.getAttribute("user");
if(null==username)
response.sendRedirect("../jsp-modLogin/login.jsp");
}This code in logout page
<%
session.removeAttribute("user");
session.invalidate();
response.sendRedirect("../index.jsp");
%>For me, It is working fine...
Check it with ur code
Regards
Ramesh -
Simple java archive type deployment is invalid in Jdeveloper 9031
Hi All,
If I choose a Simple Java archive type of deployment of a jsp tag lib project in Jdeveloper the archive does not include the directory layout recursively. Ex. I get this.
c:\> jar tvf test.jar
64 Sat Jan 01 23:53:48 PST 2000 META-INF/MANIFEST.MF
1300 Sat Jan 01 23:53:48 PST 2000 META-INF/autodate.tld
5772 Sat Jan 01 23:53:48 PST 2000 test/autodate.class
Where if I do it the archiving from the comman line. i.e
c:\> jar cvf test.jar META-INF test
I get
0 Wed Feb 26 20:52:42 PST 2003 META-INF/
68 Wed Feb 26 20:52:42 PST 2003 META-INF/MANIFEST.MF
1300 Wed Feb 26 20:12:42 PST 2003 META-INF/autodate.tld
0 Wed Feb 26 20:12:42 PST 2003 test/
5772 Wed Feb 26 20:12:42 PST 2003 test/autodate.class
The latter is a valid archive that I can use for taglib deployment. The former, i.e the Jdev deployed archive does not work. The jsp does not find the tag library.
What is the archiving tool that jdeveloper uses??
Why is it different from doing a command line archive??
Is there anyway I can instruct the deployment tool to include the directory tree in the archive??
- ManishHi Lynn,
The Archive looks exactly the same and the jsp fails to find the tld from the classpath.
64 Fri Apr 04 13:53:48 PST 2000 META-INF/MANIFEST.MF
1300 Fri Apr 04 13:36:48 PST 2000 META-INF/autodate.tld
5772 Fri Apr 04 13:42:48 PST 2000 test/autodate.class
Note, this is a problem only when using the Tag lib autodiscovery mechanism of JSP 1.2 where the tld can exist anywhere in the classpath under META-INF and the path is not explicitly specified in the jsp.
- Manish
- Manish -
I create simple session bean in jdeveloper and it has a problem in lookup
the code of bean
import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.naming.*;
public class CartClient {
public static void main(String[] args) {
try {
Context initial = getInitialContext() ;
// Object objref = initial.lookup("java:comp/env/ejb/SimpleCart");
Object objref = initial.lookup("Cart");
CartHome home =
(CartHome)PortableRemoteObject.narrow(objref,
CartHome.class);
Cart shoppingCart = home.create("Duke DeEarl","123");
shoppingCart.addBook("The Martian Chronicles");
shoppingCart.addBook("2001 A Space Odyssey");
shoppingCart.addBook("The Left Hand of Darkness");
Vector bookList = new Vector();
bookList = shoppingCart.getContents();
Enumeration enumer = bookList.elements();
while (enumer.hasMoreElements()) {
String title = (String) enumer.nextElement();
System.out.println(title);
shoppingCart.removeBook("Alice in Wonderland");
shoppingCart.remove();
System.exit(0);
} catch (BookException ex) {
System.err.println("Caught a BookException: " + ex.getMessage());
System.exit(0);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
System.exit(1);
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "admin");
env.put(Context.PROVIDER_URL, "ormi://localhost:23791CartApp");
return new InitialContext(env);
} javax.naming.NameNotFoundException: Cart not found
java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
RMIContext.java:130
java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
InitialContext.java:350
void CartClient.main(java.lang.String[])
CartClient.ja
exceptionPlease post your question in jdeveloper forum at
JDeveloper and ADF
for quick response.
Regards,
Anupama
http://otn.oracle.com/sample_code/content.html -
"Authetication session invalidated" via Radius / ACS
Hi folks.
I get these messages a lot from my ACS 4.0 box. Note the typo: authetication vs authentication. This typo is "in" the ACS messages, and even some Cisco documentation (but doesn't say what the error means)
I think the error is related to wireless PEAP auth.
Message-Type=Authen failed,Authen-Failure-Code=Authetication session invalidatedDid you ever resolve this? How?
I have the same error on a 4.2 trial version, using PEAP. EAP-TLS works just fine however. Strange. -
"Edit Session Facade" in JDeveloper
Hi,
My session facade bean in TopLink project is working well. I just added a new named query and I would like to edit session facade to expose that method. Then I would need to re-create the DataControl. I did this a couple of times and that was fine. But now it doesnot show up the "Edit Session Facade" window for me to check to include the new method. Is there a way to delete the DataControl to create a new one, or any one knows any suggestion?
Thank you,
JohnMake sure you added the method to the EJB interface as well.
Maybe you are looking for
-
Bridge CC trial on Mac Pro Mavericks
How to make your Mac run like a PC! I have downloaded Bridge and Photoshop from the creative cloud trials. I have NEVER had a program crash on my Mac. Everytime I try to open bridge I get an error and it closes. Photoshop itself seems to work but I
-
How to change the languaje in Audition?
How to change the languaje in Audition?
-
Hi, In my project, several different servlets run together and access to the same database. I have already created a connectionPool, but I don't know how to make it unique for all my Servlets, not just for the instances of one. clem
-
I cant delete singel/multiple pictures from my albums, without deleting the same picures from another album. When you press delete on a picture you get a question wich says "delete from all albums", and thats it? You cant choose to select yes or no.
-
Stop session from commit whenever DDL command takes place
After DDL command the session is commited, we know. But I don't want to let the session to commit. Pls reply immediately.