Search Results

Search found 1522 results on 61 pages for 'ee vin'.

Page 21/61 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Custom SessionListener, name is not bound in this context, javax.naming.NameNotFoundException

    - by mehmet6parmak
    Hi, I am trying to implement HttpSessionListener so that users of this listener can register implementation of ISessionEvent interface to session Events.code is below: public class MySessionListener implements HttpSessionListener{ @Resource ISessionEvent sessionEvent; public ISessionEvent getSessionEvent() { return sessionEvent; } public void setSessionEvent(ISessionEvent sessionEvent) { this.sessionEvent = sessionEvent; } @Override public void sessionCreated(HttpSessionEvent arg0) { sessionEvent.SessionCreated(arg0.getSession()); } @Override public void sessionDestroyed(HttpSessionEvent arg0) { sessionEvent.SessionDestroyed(arg0.getSession()); } } When user implement ISessionEvent and add as a bean, SessionCreated and SessionDestroyed functions of implementation will be called when these events occured. You can ask why dont you just write inside listeners methods, i dont i'm just trying. When i try the code above i got the following error message: javax.naming.NameNotFoundException: Name com.mehmet6parmak.sessionlistener.MySessionListener is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.catalina.util.DefaultAnnotationProcessor.lookupFieldResource(DefaultAnnotationProcessor.java:278) at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:187) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4082) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) 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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Resource annotation causes the error but i could not resolve it. Thanks All... Interface and Implementation @Resource public interface ISessionEvent { public void SessionCreated(HttpSession session); public void SessionDestroyed(HttpSession session); } @Resource public class SessionEvent implements ISessionEvent { @Override public void SessionDestroyed(HttpSession session) { System.out.println("From Session Event Callback(Destroy):" + session.getId()); } @Override public void SessionCreated(HttpSession session) { System.out.println("From Session Event Callback(Create):" + session.getId()); } } Bean Definition <context:annotation-config/> <context:component-scan base-package="com.mehmet6parmak"> </context:component-scan> <bean id="sessionEvent" autowire="byName" class="com.mehmet6parmak.sessionlistener.SessionEvent"></bean> Solution:Using the method used in link works.

    Read the article

  • correct way to turn EAR module into OSGI bundle

    - by Osw
    Greetings to all! There is a necessity to turn part of EAR (namely - war) into OSGI bundle and retain it's interoperability. Glassfish 3.0.1 already has osgi-web-container module and I succeeded to deploy standalone OSGI war. But in case of of ex-enterprise war it looks a bit difficult to me. What do I do with EJB calls from inside future OSGI war? Is it enough to replace @EJB injections with true JNDI lookups? What about APIs and libraries shared across EAR? I could split and rearrange them, but still I will have at least one jar needed by both EAR and OSGI war. Duplicate, make it as OSGI-bundle itself and make it available to ear somehow, place it GF domain's library path? Any other ideas, advices which could make that hybrid working? Many thanks in advance, Osw

    Read the article

  • setting a timeout for an InputStreamreader variable

    - by Noona
    I have a server running that accepts connections made through client sockets, I need to read the input from this client socket, now suppose the client opened a connection to my server without sending anything through the server's socket outputstream, in this case, while my server tried to read the input through the client socket's inputstream, an exception will be thrown, but before the exception is thrown i would like a timeout say of 5 sec, how can I do this? currently here's how my code looks like on the server side: try { InputStreamReader clientInputStream = new InputStreamReader(clientSocket.getInputStream()); int c; StringBuffer requestBuffer = new StringBuffer(); while ((c = clientInputStream.read()) != -1) { requestBuffer.append((char) c); if (requestBuffer.toString().endsWith(("\r\n\r\n"))) break; } request = new Request(requestBuffer.toString(), clientSocket); } catch (Exception e) // catch any possible exception in order to keep the thread running { try { if (clientSocket != null) clientSocket.close(); } catch (IOException ex) { ex.printStackTrace(); } System.err.println(e); //e.printStackTrace(); }

    Read the article

  • Framework Recommendation request: spring, struts, j2ee?

    - by Jack BeNimble
    The last time I looked at web applications, the consensus seemed to be Struts/J2EE. Now, it looks like Spring MVC/J2EE or Struts/J2EE are both viable solutions. Is this generally correct? Or is Spring MVC now the consensus choice over Struts? We have at least one guy who has worked with Struts before and wants to go with that. I'm more familiar with Struts as well, having reviewed in the past. Also, is J2EE still considered the viable solution for handling remote components? Or are there alternatives?

    Read the article

  • How to know file type without extension

    - by Ayusman
    While trying to come-up with a servlet based application to read files and manipulate them (image type conversion) here is a question that came up to me: Is it possible to inspect a file content and know the filetype? Is there a standard that specifies that each file MUST provide some type of marker in their content so that the application will not have to rely on the file extension constraints? Consider an application scenario: I am creating an application that will be able to convert different file formats to a set of output formats. Say user uploads an PDF, my application can suggest that the possible conversion formats are microsoft word or TIFF or JPEG etc. As my application will gradually support different file formats (over a period of time), I want my application to inspect the input file instead of having the user to specify the format. And suggest to user the possible formats of output. I understand this is an open ended, broad question. Please let me know if it needs to be modified. Thanks, Ayusman

    Read the article

  • How do i access EJB implementing remote interface in separate web application?

    - by Nitesh Panchal
    Hello, I am using Netbeans 6.8 and Glassfish v3.0. I created an ejb module and created entity classes from database and then created stateless session bean with remote interface. Say eg. @Remote public interface customerRemote{ public void add(String name, String address); public Customer find(Integer id); } @Stateless public class customerBean implements customerRemote{ //implementations of methods } Then i created a new web application. But now how do i access remote ejb's in my web application. I could lookup a bean with jndi name but what i want to know is, what type of object it will return? How do i typecast it in customerRemote? I don't have any class named customerRemote in my web application. So, how do i do it? Also, what about the entity class Customer? There is no such class named Customer in my web application also. All ejb's and entity classes are in separate ejb module. Please help me :(

    Read the article

  • JSF SelectOneMenuItem onselect attribute

    - by William
    I have created selectOneMenuItem(JSF).I placed my events on valueChangeListener / onchange like that <h:selectOneMenu id="ddl" value="#{Foo.attr}" onchange="submit()" valueChangeListener="#{Foo.renderFoo}"> When I select one vlaue from selectOneMenuItem then event fires.Now when I reselect that value ,then event doesn't fire (because this is the valueChangeListener event) so it doesn't fire.I want that event should fire on every selection even on again the same selection.I found onselect but unable to find that is it right and how can i use this onselect.Anyu help would be greatly appreciable

    Read the article

  • Unique serial number in a java web application.

    - by Zenzen
    I've been wondering what's the correct practice for generating unique ids? The thing is in my web app I'll have a plugin system, when a user registers a plugin I want to generate a unique serial ID for it. I've been thinking about storing all numbers in a DB or a file on the server, generating a random number and checking whether it already exists in the DB/file, but that doesn't seem that good. Are there other ways to do it? Would using the UUID be the preferred way to go?

    Read the article

  • Implementing OAuth protocol in Java

    - by Wasim
    Hi all , I'm looking for an open source library that implements the OAuth protocol , I need the server side implementation . Say I have a Social network system , and I want to give my users an OAth abiliy to my API , like facebook. Do you have any suggestion , sure examples . Thanks in advance ...

    Read the article

  • Using the Jersey client to do a POST operation

    - by Jon
    Hello, In a Java method, I'd like to use a Jersey client object to do a POST operation on a RESTful web service (also written using Jersey) but am not sure how to use the client to send the values that will be used as FormParam's on the server. I'm able to send query params just fine. Thanks in advance.

    Read the article

  • How to store the result of a JSP in a string?

    - by Spines
    I want to store the result of a JSP in a string. For example, I want to be able to call a function like: String result = ProcessJsp("/jspfile.jsp"); Also, this must be rather efficient. Making a url request to the jsp and then storing it would definitely be too slow. How could I do this? Here are my thoughts on how to do this, though I'm not sure if it would work, and I'm hoping there is something simpler: Do RequestDispatcher("/jspfile.jsp").include(hreq, hresp), but instead of putting the real HttpResponse object in there, you put your own where the getWriter() method returns something that writes to your String or a memory buffer, etc.

    Read the article

  • httpOnly Session Cookie + Servlet 3.0 (e.g. Glassfish v3)

    - by chris_l
    By default, Glassfish v3 doesn't set the httpOnly flag on session cookies (when created as usual with request.getSession()). I know, there is a method javax.servlet.SessionCookieConfig.setHttpOnly(), but I'm not sure, if that's the best way to do it, and if yes, where the best place would be to put that line. BTW, of course it can't be done in the servlet itself (e.g. in init()): java.lang.IllegalStateException: PWC1426: Unable to configure httpOnly session tracking cookie property for servlet context /..., because this servlet context has already been initialized Generally, I would prefer to use a configuration option e.g. in web.xml.

    Read the article

  • Pass Alot of Parameters on a Form to Action Struts2

    - by Neeraj
    I have been working on migrating a web application from Struts1 to Struts2. I have a simple Form with around 45 Fields (basically a grid with data). I have to capture all those in Struts2 Action.I noticed that in struts2 we have OGNL through which we just write getters setters in action itself by declaring fields locally to get those variables flowing in the request. I cannot write 45 getters/setters in my action, there must be a way to pass whole object(a POJO) from jsp to Action layer. In Struts 1, we normally get a ActionForm Object and/or get request parameters in a map and then populate. Any help or suggestions will be appreciated.

    Read the article

  • What are the differences between mapping,binding and parsing?

    - by sfrj
    I am starting to learn web-services in java EE6. I did web development before, but never nothing related to web services. All is new to me and the books and the tutorials i find in the web are to technical. I started learning about .xsd schemas and also .xml. In that topic i feel confident, i understand what are the schemas used for and what validation means. Now my next step is learning about JAX-B(Java Api for XML Binding). I rode some about it and i did also some practice in my IDE. But i have lots of basic doubts, that make me stuck and cannot feel confident to continue to the next topic. Ill appreciate a lot if someone could explain me well my doubts: What does it mean mapping and what is a mapping tool? What does it mean binding and what is a binding tool? What does it mean parsing and what is a parsing tool? How is JAX-B related to mapping,binding and parsing? I am seeking for a good answer built by you, not just a copy paste from google(Ive already been online a few hours and only got confused).

    Read the article

  • How to upload files to server using JSP/Servlet?

    - by Thang Pham
    How can I upload files to server using JSP/Servlet? I tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /> <input type="submit" /> </form> However, I only get the file name, not the file content. When I add enctype="multipart/form-data" to the <form>, then request.getParameter() returns null. During research I stumbled upon Apache Common FileUpload. I tried this: FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); // This line is where it died. Unfortunately, the servlet threw an exception without a clear message and cause. Here is the stacktrace: SEVERE: Servlet.service() for servlet UploadServlet threw exception javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:637)

    Read the article

  • EJB injection in Glassfish webapp

    - by g051051
    I've got an app that is trying to use @EJB annotation to inject remote references to EJBs in my ejb.jar file. I'm getting inconsistent results. In one case, I have a listener in web.xml that gets called and apparently has the EJB injected correctly, since I can see it connecting to the EJB and calling methods on it. In another class (a struts2 action) I get NPE when it tries to access the EJB reference. As far as I can tell, they're identical calls, in Java classes that live in the same .war file. As a work around, I added code in the constructor to lookup the EJBs by their global JNDI names, and it works fine. I just can't figure out why one @EJB works and not another.

    Read the article

  • Dealing With Java Default Level Access Specifiers

    - by Tom Tresansky
    I've seen some code in a project recently where some fields in a couple classes have been using the default access modifier without good reason to. It almost looks like a case of "oops, forgot to make these private". Since the classes are used almost exclusively outside of the package they are defined in, the fields are not visible from the calling code, and are treated as private. So the mistake/oversight would not be very noticeable. However, encapsulation is broken. If I wanted to add a new class to the existing package, I could then mess with internal data in objects using fields with default access. So, my questions: Are there any best practices concerning default access specifiers that I should be aware of? Anything that would help prevent this type of accident from re-occurring? Are are any annotations which might say something to the effect of "I really meant for these to be default access"? Using CheckStyle, or any other Eclipse plugins, is there any way to flag instances of default fields, or disallow any not accompanied by, say, a "//default access" comment trailing them?

    Read the article

  • Is there a way to combine streaming data retrieval with hibernate?

    - by Steve B.
    For the purposes of handling very large collections (and by very large I just mean "likely to throw OutOfMemory exception"), it seems problematic to use Hibernate because normally collection retrieval is done in a block, i.e. List values=session.createQuery("from X").list(), where you monolithically grab all N-million values and then process them. What I'd prefer to do is to retrieve the values as an iterator so that I grab 1000 or so (or whatever's a reasonable page size) at a time. Apart from writing my own iteration (which seems like it's likely to be re-inventing the wheel) is there a hibernate-native way to handle this?

    Read the article

  • Is it possible to transfer data between html pages driven by spring web flow?

    - by Easwaramoorthy Kanagaraj
    I am aware of passing data between jsp in spring web flow. Is it possible to transfer data between html pages driven by spring web flow. I don't want to use the HTML5 local storage capabilities. Example: Page 1: Search box for an employee id. Page 2: Search result for the employee details. Two ways that I could think: Get the employee details in page 1 by ajax and pass the result to the page two. Pass the employee id to page 2 and get the result by ajax in onload. In both case I need to pass any variable/data. I am confused in doing this. Is there anything in the Spring webflow using which I could do this? Thanks in advance, Easwar

    Read the article

  • designing multi module J2EE application

    - by user728947
    Might be my question is abstract or out of context, but i am asking here since i have little idea how this happens. I am wondering how big application/ platform break down there application in to multiple module and how they able to manage modules dependencies. For example in some E-commerce application they tend to break down it in various modules like pricing,promotions,shipping.import/export and many more. when we develop those application we hardly think about the underlying modules and how they have been designed to provides functionalists. Most of those module are not web-applications but are standalone module and not deployed in the web-app as jar files. can any one help me to understand how they break up things or is there any standard way to do this.any help/resources to get insight will really be helpful

    Read the article

  • install GlassFish on VPS

    - by ManWard
    hi i want install GlassFish into the VPS.now i need tutorial for installing GlassFish on VPS [Linux OS] and configure it.also how can i point separated domains to separated Web applications on Enterprise Server ? thanks

    Read the article

  • Unique number generation with Java Server Faces

    - by Buddhika Ariyaratne
    I am developing an application for a medical channelling centre where multiple users reserve bookings for doctors with JSF and JPA. A sequence number is unique to the Doctor, Date and Session. I tried to get a unique sequence number from counting the previous bookings and add one, but if two requests comes at the same time, two bookings get the same number causing trouble to functionality. How can I get unique number in this case? Can I use an application wide bean to generate it? (I thought it is not practicle to get the unique number from the database sequence number as there are several doctors, sessions and daily they have to have different booking number.)

    Read the article

  • Passing dynamic string in hyperlink as parameter in jsp

    - by user3660263
    I am trying to pass a dynamic string builder variable in jsp I am generating a string through code. String Builder variable has some value but i am not able to pass it in at run time.It doesn't get the value. CODE FOR VARIABLE <% StringBuilder sb=new StringBuilder(""); if(request.getAttribute("Brand")!=null) { String Brand[]=(String[])request.getAttribute("Brand"); for(String brand:Brand) { sb.append("Brand="); sb.append(brand); sb.append("&&"); } } if(request.getAttribute("Flavour")!=null) { String Flavour[]=(String[])request.getAttribute("Flavour"); for(String flavour:Flavour) { sb.append(flavour); sb.append("&&"); } sb.trimToSize(); pageContext.setAttribute("sb", sb); } out.print("this is string"+sb); %> CODE FOR HYPERLINK <a href="Filter_Products?${sb}page=${currentPage + 1}" style="color: white;text-decoration: none;">Next</a></td>

    Read the article

  • Are application servers necessary? Advantages of using one? (And other JEE questions)

    - by Mike
    Apologies for the long question.. there seems to be other similar questions on here but none really clear up my confusion. I'd be really grateful if someone could confirm or correct my understanding: Java Enterprise Edition is a set of APIs for building enterprise applications, which take away the burden of developing parts of the system that aren't actually features of the application you are trying to build (i.e. messaging, transactions etc). To do this, you can use an application server, which implements these APIs. So you could use JBoss, Glassfish, WebSphere, WebLogic etc which would provide your application with these enterprise services. However, there are many other implementations of these individual services available such as ActiveMQ for messaging, Hibernate for persistence, OpenEJB etc. You can download these implementations as Java libraries and include them in your application, and use the services they provide in a similar way to using the services provided by an application server. So if my understanding is correct, my questions are: I've read a lot of places that application servers are necessary for JEE features like EJB, but can't you just use an implementation such as OpenEJB and not need an application server at all? Are there any features that an application server provides which you cannot get from another source? Why would/wouldn't I choose an application server over a custom stack such as Tomcat, OpenEJB, ActiveMQ, and Hibernate? Is Spring a complete alternative to JEE? Does it ever require an application server or always just a servlet container? Why would someone choose Spring over JEE? Any help would be much appreciated!

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >