yogesh srinivasan

Ranch Hand
+ Follow
since Jun 08, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by yogesh srinivasan

I have two interface Bean1Remote, Hello implemented by Session bean

package com;

@Remote
public interface Bean1Remote { ..

public interface Hello { ..


@Stateless(name="bean1" , mappedName="saibean1")
public class Bean1 implements Bean1Remote, Hello {


I want to override the remote interface from Bean1Remote to Hello in the deployment descriptor

<enterprise-beans>
<session>
<ejb-name>TestBean</ejb-name>
<ejb-class>com.Bean1</ejb-class>
<mapped-name>raibaba</mapped-name>
<business-remote>com.Hello</business-remote>
</session>
</enterprise-beans>

but.....

1. The override didnt work and it picks only the com.Bean1Remote
2. When i removed the remote annotation from the com.Bean1Remote interface the override happend

IS the expected behaviour of EJB 3.0? Sorry for a detailed post i have no options


I tried it and deployment is successful but unable to trigger multiple ejb uniquely.
Please give my some information about this ?
In that case you cant use session time out method [setMaxInactivInterval].

1. Poll an AJAX request and manually calulate the timeout period

if(CurrentTime - HtpSession.getCreationTime - timeOut) = TIMEOUT - [alter_period]) {
sendalert response to rest timeout.
}else if(CurrentTime - HtpSession.getCreationTime - timeOut) = TIMEOUT){
invalidate
}

2. write another filter resetTimeOut

if(request = isNot[AJAX timeout request]
- reset timeout variable


This is the best i got.
14 years ago
Is Servlets by default a single threaded model or multi threaded model ?
Hi Guys Sorry for the late reply,

I tried deleting the folder HelloWeb from tomact_home/work/catalina/localhost and restart tomcat, but still i got the same exception.
I tomcat is picking up the applications from the tomcat_home/webapp folder as my other applications are working fine. Still no luck
15 years ago
Hi I'm getting the following excepiton while start my tomcat server

May 21, 2009 12:01:48 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\javatest\webApp\HelloWeb\build\web does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3855)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4024)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
May 21, 2009 12:01:48 PM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
May 21, 2009 12:01:48 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
May 21, 2009 12:01:48 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/HelloWeb] startup failed due to previous errors
May 21, 2009 12:01:48 PM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/HelloWeb] has not been started


But there is no folder called "HelloWeb" under my tomcat_home\webapps, how could this exception be resolved.
15 years ago
Please explain me the difference between url-encoding and url-rewriting and how both of this be implemented in servlets?
Now it would be easy to explain your question if you could understand why its possible to bookmark a GET method page. Say if google search engine uses GET method to send your search request for "JavaRanch". You could get a response page from its site for your search and the link would be something like http://www.google.com/search?hl=en&q=javaranch&aq=f&oq=. Since its a GET request and your request data is sent along with the url and now you bookmark this link and when ever you call back the link your browser is going to send back your request with the search data and this is going to end up with the same page. Now to answer your question say if google uses POST method for its search then your search data is not sent through the url and its through the request body and even if you bookmark the result page it dosnt contain any information about what you have searched other than the resource location. This is the reason why we cant bookmark a POST method request.
thats so cool but i cant make any thing from it and thats why i'm here. I would like to reframe my question "How are the attributes variables and attributes differ in custom tag?
I had the following c:set code which sets an bean attribute from another attribute
<c:set var="bean2" scope="session" value="${bean1}">

</c:set>

and was able to view the property name ${bean2.name}

but if i try setting the bean through the body like below

<c:set var="bean2" scope="session">
${bean1}
</c:set>

I get the following excepiton

org.apache.jasper.JasperException: Exception in JSP: /test1/test2/jsp1.jsp:32

29: after cset call
30:

31:
32: TEST BEAN NAME${bean2.name}
33:
34:
35:

javax.servlet.ServletException: Unable to find a value for "name" in object of class "java.lang.String" using operator "."
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.test1.test2.jsp1_jsp._jspService(jsp1_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Please help me out.

how variables and attributes differ in tags, and were do i get more information about variables used in tags
yeah i'm able to see the exception.....in the logs...i was trying to look the server console for the exception...
I tried forwarding my servlet to a jsp after flushing my response. I didnt get any IllegalStateException and just was able to see the output of the servlet and the jsp output is ignored



I dont know why the exception has not caught
I created a class User.java which is a bean class and deployed it under web-inf\classes folder.
I tried to create an instance of it from an jsp and it container was unable to find it, but it works fine when accessed from a servlet.

-----

<html>
<body>
Hai this is jsp
${userAttrib.uname}

for property
<%-- jsp:useBean id="userAttrib" class="User"/>

<jsp:getProperty name="userAttrib" property="uname"/ --%>
<% User obj= new User(); %>
<% obj.setUname("kaka"); %>
Scriplet obj username is <%=obj.getUname() b%>
</body>
</html>


-----------


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:
JSP FileName:/test.jsp
Java FileName:/C:/tomcat/work/Catalina/localhost/book//org/apache/jsp\test_jsp.java

An error occurred at line: 9 in the jsp file: /test.jsp
User cannot be resolved to a type
6: <%-- jsp:useBean id="userAttrib" class="User"/>
7:
8: <jsp:getProperty name="userAttrib" property="uname"/ --%>
9: <% User obj= new User(); %>
10: <% obj.setUname("kaka"); %>
11: Scriplet obj username is <%=obj.getUname() %>
12: </body>





15 years ago
JSP