Search Results

Search found 82 results on 4 pages for 'hoang pham'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • TTRequestLoader always raises "TTDASSERT failed: _cacheKey == request.cacheKey"

    - by Hoang Pham
    I run the TTCatalog application from the Three20 library and encountered this error when click on the "Photo Thumbnails" of the "Three20 Catalog": TTDASSERT failed: _cacheKey == request.cacheKey I look at the breakpoint and see that it is on line 119 of TTRequestLoader.m of the method addRequest. I know that it failed to do the assertion of the cacheKey, but why this error appears even on the sample application, does anyone encounter the same error? What is the workaround of this? Thanks, P/S: I downloaded the Three20 from the git directory just yesterday. So I assume this be the newest one.

    Read the article

  • Add share button in magiczoomplus

    - by duyen hoang
    I am creating a WordPress site using Artisteer and various plugins to show off some photo galleries. I have also purchased a e-commerce WordPress theme that I have included as a subdirectory. In this theme they have a share button that I like the functionality of. I want to replicate the button in the front section of the site within the gallery pages. See the attached links to see what I am talking about. http://rrestricted.com/eshop/20mens/jay-chillin http://rrestricted.com/gallery/jay-3 The first link has the share button (loveheart icon) and the second the gallery that I want to add the button to. If you click on the images in the gallery you will see a large lightbox come up. I want to add the Share button just above the navigation buttons. This is my require from a customer. I was searched magiczoomplus.js, but I can't add it.

    Read the article

  • Grails validateable not work for non-persistent domain class

    - by Hoàng Long
    I followed the instruction here: http://www.grails.org/doc/latest/guide/7.%20Validation.html and added into config.groovy: grails.validateable.classes = [liningtest.Warm'] Then added in src/groovy/Warm.groovy (it's a non-persistent domain class): package liningtest import org.codehaus.groovy.grails.validation.Validateable class Warm { String name; int happyCite; Warm(String n, int h) { this.name = n; this.happyCite = h; } static constraints = { name(size: 1..50) happyCite(min: 100) } } But it just doesn't work (both "blank false" & "size: 0..25") for the "hasErrors" function. It always returns false, even when the name is 25. Is this a Grails bug, if yes, is there any work-around? I'm using Grails 1.3.3 UPDATE: I have updated the simplified code. And now I know that constraint "size" can't be used with "blank", but still does not work. My test class in test/unit/liningtest/WarmTests.groovy package liningtest import grails.test.* class WarmTests extends GrailsUnitTestCase { protected void setUp() { super.setUp() } protected void tearDown() { super.tearDown() } void testSomething() { def w = new Warm('Hihi', 3) assert (w.happyCite == 3) assert (w.hasErrors() == true) } } And the error I got: <?xml version="1.0" encoding="UTF-8" ?> <testsuite errors="1" failures="0" hostname="evolus-50b0002c" name="liningtest.WarmTests" tests="1" time="0.062" timestamp="2010-12-16T04:07:47"> <properties /> <testcase classname="liningtest.WarmTests" name="testSomething" time="0.062"> <error message="No signature of method: liningtest.Warm.hasErrors() is applicable for argument types: () values: [] Possible solutions: hashCode()" type="groovy.lang.MissingMethodException">groovy.lang.MissingMethodException: No signature of method: liningtest.Warm.hasErrors() is applicable for argument types: () values: [] Possible solutions: hashCode() at liningtest.WarmTests.testSomething(WarmTests.groovy:18) </error> </testcase> <system-out><![CDATA[--Output from testSomething-- ]]></system-out> <system-err><![CDATA[--Output from testSomething-- ]]></system-err> </testsuite> UPDATE 2: When I don't use Unit test, but try to call hasErrors in the controller, it runs but return false value. (hasErrors return false with Warm('Hihi', 3) ). Does anyone has a clue?

    Read the article

  • How to improve IntelliJ code editor speed?

    - by Hoàng Long
    I am using IntelliJ (Community Edition) for several months, and at first I'm pleased about its speed & simplicity. But now, after upgrading to version 10, it's extremely slow. Sometimes I click a file then it takes 5 - 15 seconds to open that file (it freeze for that time). I don't know if I have done anything which cause that: I have installed 2 plugins(regex, sql), and have 2 versions of IntelliJ on my machine (now the version 9 removed, only version 10 remains). Is there any tips to improve speed of code editor, in general, or specifically IntelliJ? I have some experience when using IntelliJ: 1. Should open IntelliJ a while before working, cause it needs time for indexing. Don't open too many code tabs Open as less other program as possible. I'm using 2 GB RAM WinXP, and it just seems fairly enough for Java, IntelliJ & Chrome at the same time.

    Read the article

  • Where to keep a querystring parameter in session ?

    - by hoang
    Users will get to my site using a specific parameter, e.g. : http://www.mysite.com/whatever/?keepTrackOfThisValue=foo or http://www.mysite.com/who/cares/?keepTrackOfThisValue=bar I would like to store the value of this peculiar parameter in Session everytime I found it in the QueryString. I'm currently using the Session_Start event in Global.asax in order to store this but I would like to override the value each time the parameter value change, which is not possible my way. Where would you do this ?

    Read the article

  • How to use Grails Spring Security Plugin to require logging in before access an action?

    - by Hoàng Long
    Hi all, I know that I can use annotation or Request mapping to restrict access to an ACTION by some specific ROLES. But now I have a different circumstance. My scenario is: every user of my site can create posts, and they can make their own post public, private, or only share to some other users. I implement sharing post by a database table PERMISSION, which specify if a user have the right to view a post or not. The problem arises here is that when a customer access a post through a direct link, how can I determine he/she have the privilege to view it? There's 3 circumstances: The post is public, so it can be viewed by anyone (include not-login user) The post is private, so only the login-owner can view it The post is sharing, it means only the login-user that is shared and the owner can view it. I want to process like this: If the requested post is public: ok. If the requested post is private/sharing: I want to redirect the customer to the login page; after logging in, the user will be re-direct to the page he wants to see. The problem here is that I can redirect the user to login controller/ auth action, but after that I don't know how to redirect it back. The link to every post is different by post_id, so I can't use SpringSecurityUtils.securityConfig.successHandler.defaultTargetUrl Could anyone know a way to do this?

    Read the article

  • "Blank SQL" error with phppgadmin

    - by Hoàng Long
    Here is my problem: I export a database A_DB using "export" function of Phppgadmin. The dump file A_dump.sql includes both the database structure and data. Then I try to create another blank database B_DB, and import A_dump.sql into it. Every time I do that, the transaction failed with no error reported: SQL error: In statement: Is there some logs that I can find in phppgadmin that would allow me to investigate this problem? I have tried searching for an hour, but still not find anything.

    Read the article

  • How to using String.split in this case?

    - by hoang nguyen
    I want to write a fuction like that: - Input: "1" -> return : "1" - Input: "12" -> return : ["1","2"] If I use the function split(): String.valueOf("12").split("") -> ["","1","2"] But, I only want to get the result: ["1","2"]. What the best way to do this? Infact, I can do that: private List<String> decomposeQuantity(final int quantity) { LinkedList<String> list = new LinkedList<String>(); int parsedQuantity = quantity; while (parsedQuantity > 0) { list.push(String.valueOf(parsedQuantity % 10)); parsedQuantity = parsedQuantity / 10; } return list; } But, I want to use split() for having an affective code

    Read the article

  • PetStore 2.0 - java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/Pet

    - by Harry Pham
    I download PetStore 2.0 from https://blueprints.dev.java.net/servlets/ProjectDocumentList?folderID=5315&expandFolder=5315&folderID=0. I tried to build them in netbean 6.8 and I got this error SEVERE: Exception while preparing the app java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/PetstoreDB' in SerialContext [Root exception is javax.naming.NameNotFoundException: PetstoreDB not found] Seems like it cant find 'jdbc/PetStoreDB'. So I went back to the website and it look like I have to build the database via Ant script. So at the PetStore home directory, I run this command ant setup ant run And I got the same error when I try ant run [exec] Deprecated syntax, instead use: [exec] asadmin --port 4848 --host localhost --passwordfile /Users/KingdomHeart/.asadminpass --user admin deploy [options] ... [exec] com.sun.enterprise.admin.cli.CommandException: remote failure: Exception while preparing the app : java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/PetstoreDB' in SerialContext [Root exception is javax.naming.NameNotFoundException: PetstoreDB not found] [exec] [exec] [exec] Command deploy failed. Any idea what happen?

    Read the article

  • JSF: initial request and postback request?

    - by Harry Pham
    Please take a look at this below line of code in JSF <h:inputText id="name" value="#{customer.name}" /> Quote from java.sun.com For an initial request of the page containing this tag, the JavaServer Faces implementation evaluates the #{customer.name} expression during the render response phase of the lifecycle. During this phase, the expression merely accesses the value of name from the customer bean, as is done in immediate evaluation. For a postback request, the JavaServer Faces implementation evaluates the expression at different phases of the lifecycle, during which the value is retrieved from the request, validated, and propagated to the customer bean. I am not sure I understand initial request vs postback request. Does the client browser make two different request to the webserver?

    Read the article

  • Rally Rest .NET API throws KeyNotFoundException when posting a new defect without required field value

    - by Triet Pham
    I've tried to post a new defect to Rally via Rest .net api by the following code: var api = new RallyRestApi("<myusername>", "<mypassword>", "https://community.rallydev.com"); var defect = new DynamicJsonObject(); defect["Name"] = "Sample Defect"; defect["Description"] = "Test posting defect without required field value"; defect["Project"] = "https://trial.rallydev.com/slm/webservice/1.29/project/5808130051.js"; defect["SubmittedBy"] = "https://trial.rallydev.com/slm/webservice/1.29/user/5797741589.js"; defect["ScheduleState"] = "In-Progress"; defect["State"] = "Open"; CreateResult creationResult = api.Create("defect", defect); But the api throws a weird exception: System.Collections.Generic.KeyNotFoundException was unhandled Message=The given key was not present in the dictionary. Source=mscorlib StackTrace: at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Rally.RestApi.DynamicJsonObject.GetMember(String name) at Rally.RestApi.DynamicJsonObject.TryGetMember(GetMemberBinder binder, Object& result) at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Rally.RestApi.RallyRestApi.Create(String type, DynamicJsonObject obj) at RallyIntegrationSample.Program.Main(String[] args) in D:\Projects\qTrace\References\Samples\RallyIntegrationSample\Program.cs:line 24 The problem is when i checked out the trace log file of Rally, it showed exactly what wrong in the posting request: Rally.RestApi Post Response: { "CreateResult": { "_rallyAPIMajor":"1", "_rallyAPIMinor":"29", "Errors":["Validation error: Defect.Severity should not be null"], "Warnings":[] } } Instead of given the proper CreateResult object with according errors information in its property, the Rally Rest .Net Api throws an unexpected exception. Is that a mistake in Rally rest .net api or should i do any extra steps to get the CreatResult seamlessly in case of any errors returned by Rally service? Many thanks for your helps.

    Read the article

  • jqGrid's setSelect does not work after reloadGrid

    - by Viet Pham
    Hi, setSelection does not select the row, whose id is 2, right after a reloadGrid. $("#training").setGridParam({url: 'index.php?func=trainingmgr&aAction=refreshData'}); $("#training").trigger("reloadGrid"); $("#training").jqGrid('setSelection', "2?); However, setSelection can select the row, whose id is 2, when you take this line out: $("#training").trigger("reloadGrid"); Anybody experiences the same issue? Thanks

    Read the article

  • How to add line break for UILabel?

    - by Harry Pham
    Let see that I have a string look like this: NSString *longStr = @"AAAAA\nBBBBB\nCCCCC"; How do I make it so that the UILabel display the message like this AAAAA BBBBB CCCCC I dont think, '\n' recognize by UILabel, so is there anything that I can put inside NSString, so that UILabel know that it has to create a line break there? Thank you very much in advance

    Read the article

  • Apache Commons FileUpload Does not behave like expected

    - by Harry Pham
    I just want to assure you guys that before I post this, I have read couple of similar post but none solved my problem. So here it is. I use Ajax taglib for my form since it wont refresh my screen <%@ taglib uri="WEB-INF/taglib.tld" prefix="a" %> <a:AjaxUpload action="UploadServlet"> <input type="file"> <input type="submit" value="Upload"> </a:AjaxUpload> If this is in any confused you guys, then you can think of the above code will create these form, but send request asynchronously. <form action="UploadServlet" enctype="multipart/form-data" method="post"> <input type="file"> <input type="submit"> </form> My first question is, if I add name="file" inside the <input> to make it become like this, <input type="file" name="file">, my servlet will throw an exception. It wont if I take it out. Here is the exception: 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) My second question is: On the server side, I check the request to see if it is isMultipartContent, and it is. But then when I parseRequest() and store into List<FileItem> items, the items.size() is 0. Here is my Servlet code FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List<FileItem> items = null; if(request.getContentType() != null && request.getContentType().toLowerCase().indexOf("multipart/form-data") > -1){ if(upload.isMultipartContent(request)){ items = upload.parseRequest(request); //It got to here, but items.size is 0. why????????????? } }

    Read the article

  • Primefaces, JavaScript, and JSF does not work well together or am I doing something wrong

    - by Harry Pham
    Here is something so simple <p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/> <input id="tom"/> When u click on the Tom, the textbox get focus. Great, now try this <p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/> <h:inputText id="tom"/> <br/> when I click nothing happen, I check firebug, I see document.getElementById("tom") is null When I try to use jQuery $('#tom').focus(), nothing happen, no error, but did not get focus either. This is the response (not sure if this is the response from the server) when I see from firebug <?xml version="1.0" encoding="utf-8"?> <partial-response> <changes> <update id="javax.faces.ViewState"><![CDATA[455334589763307998:-2971181471269134244]]></update> </changes> <extension primefacesCallbackParam="validationFailed">{"validationFailed":false}</extension> </partial-response>

    Read the article

  • Create Hello World with RESTful web service and Jersey

    - by Harry Pham
    I follow tutorial here on how to create web service using RESTful web service and Jersey and I get kind of stuck. The code is from HelloWorld3 in the tutorial I linked above. Here is the code. I use Netbean6.8 + glassfish v3 RESTGreeting.java create using JAXB. This class represents the HTML message in Java package com.sun.rest; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlElement; @XmlRootElement(name = "restgreeting") public class RESTGreeting { private String message; private String name; /** * Creates new instance of Greeting */ public RESTGreeting() { } /* Create new instance of Greeting * with parameters message and name */ public RESTGreeting( String message, String name) { this.message = message; this.name = name; } /** Getter for message * return value for message * */ @XmlElement public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } /* Getter for name * return name */ @XmlElement public String getName() { return name; } public void setName(String name) { this.name = name; } } HelloGreetingService.java creates a RESTful web service that returns an HTML message package com.sun.rest; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import javax.ws.rs.Consumes; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; @Path("helloGreeting") public class HelloGreetingService { @Context private UriInfo context; /** Creates a new instance of HelloGreetingService */ public HelloGreetingService() { } /** * Retrieves representation of an instance of com.sun.rest.HelloGreetingService * @return an instance of java.lang.String */ @GET @Produces("text/html") public RESTGreeting getHtml(@QueryParam("name") String name) { return new RESTGreeting( getGreeting(), name); } private String getGreeting() { return "Hello "; } /** * PUT method for updating or creating an instance of HelloGreetingService * @param content representation for the resource * @return an HTTP response with content of the updated or created resource. */ @PUT @Consumes("text/html") public void putHtml(String content) { } } However when i deploy it on Glassfish, and run it. It generate an exception. I try to debug using netbean 6.8, and figure out that this line return new RESTGreeting(getGreeting(), name); in HelloGreetingService.java cause the exception. But not sure why. Here is the stacktrace javax.ws.rs.WebApplicationException at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:268) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1029) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:637)

    Read the article

  • Upload big file to servlet?

    - by Harry Pham
    I try to upload file using Apache Common File Upload. The servlet throw an exception FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); //This line is where it died Edit: Here is my console log 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

  • CSS: How to refer to a tag

    - by Harry Pham
    I know how to refer to a tag with an id or class in css <table id="cooltable"> <tr> <td></td> <td></td> </tr> </table> so in css, u refer this <table> by table#cooltable{ ... } However, if I want to refer the <td> in <table> in css, how do I that?

    Read the article

  • Problem with detecting the value of the drop down list on the server (servlet) side

    - by Harry Pham
    Client code is pretty simple: <form action="DDServlet" method="post"> <input type="text" name="customerText"> <select id="customer"> <option name="customerOption" value="3"> Tom </option> <option name="customerOption" value="2"> Harry </option> </select> <input type="submit" value="send"> </form> Here is the code on the Servlet Enumeration paramNames = request.getParameterNames(); while(paramNames.hasMoreElements()){ String paramName = (String)paramNames.nextElement(); //get the next element System.out.println(paramName); } When I print out, I only see, customerText, but not customerOption. Any idea why guys? What I hope is, if I select Tom in my option, once I submit, on my servlet I should able to do this: String paramValues[] = request.getParameterValues(paramName); and get back value of 3

    Read the article

  • JavaEE : "Access to default session denied" when sending mail using smtp.gmail.com

    - by Harry Pham
    I am trying to write email authentication feature for my website and I encounter some issues. I got java.lang.SecurityException: Access to default session denied, when I try to do Session.getDefaultInstance. Here are my codes: private static final String SMTP_HOST_NAME = "smtp.gmail.com"; private static final String SMTP_PORT = "465"; private static final String emailSubjectTxt = "Email Confirmation"; private static final String emailFromAddress = "[email protected]"; private static final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; ... String sendTo = "[email protected]"; boolean debug = true; Properties props = new Properties(); props.put("mail.smtp.host", SMTP_HOST_NAME); props.put("mail.smtp.auth", "true"); props.put("mail.debug", "true"); props.put("mail.smtp.port", SMTP_PORT); props.put("mail.smtp.socketFactory.port", SMTP_PORT); props.put("mail.smtp.socketFactory.class", SSL_FACTORY); props.put("mail.smtp.socketFactory.fallback", "false"); //It dies at the next line Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("myUserName", "myPassword"); } }); session.setDebug(debug); //Set the FROM address Message msg = new MimeMessage(session); InternetAddress addressFrom = new InternetAddress(emailFromAddress); msg.setFrom(addressFrom); //Set the TO address InternetAddress[] addressTo = new InternetAddress[1]; addressTo[0] = new InternetAddress(sendTo); msg.setRecipients(Message.RecipientType.TO, addressTo); //Construct the content of the email confirmation String message = "Test Content" // Setting the Subject and Content Type msg.setSubject(emailSubjectTxt); msg.setContent(message, "text/plain"); Transport.send(msg);

    Read the article

  • Netbean6.8: Cant deploy an webapp with Message Driven Bean

    - by Harry Pham
    I create an Enterprise Application CustomerApp that also generated two projects CustomerApp-ejb and CustomerApp-war. In the CustomerApp-ejb, I create a SessionBean call CustomerSessionBean.java as below. package com.customerapp.ejb; import javax.ejb.Stateless; import javax.ejb.LocalBean; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @Stateless @LocalBean public class CustomerSessionBean { @PersistenceContext(unitName = "CustomerApp-ejbPU") private EntityManager em; public void persist(Object object) { em.persist(object); } } Now I can deploy CustomerApp-war just fine. But as soon as I create a Message Driven Bean, I cant deploy CustomerApp-war anymore. When I create NotificationBean.java (message driven bean), In the project destination option, I click add, and have NotificationQueue for the Destination Name and Destination Type is Queue. Below are the code package com.customerapp.mdb; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.jms.Message; import javax.jms.MessageListener; @MessageDriven(mappedName = "jms/NotificationQueue", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) public class NotificationBean implements MessageListener { public NotificationBean() { } public void onMessage(Message message) { } } If I remove the @MessageDriven annotation, then I can deploy the project. Any idea why and how to fix it?

    Read the article

  • Dispatch request to an Async Servlet from managed bean generate exception

    - by Thang Pham
    when a button click, I need to have stuff running in my background, so I have a async Servlet. From my managed bean, if I do redirect, it works great (meaning that it execute my run() method inside my class that extends Runnable correctly). Like this String url = externalContext.getRequestContextPath() + "/ReportExecutionServlet"; externalContext.redirect(url); But if I switch to dispatch, like this externalContext.redirect("/ReportExecutionServlet"); it fail when I try to obtain the AsyncContext AsyncContext aCtx = request.startAsync(request, response); The error is below Caused By: java.lang.IllegalStateException: The async-support is disabled on this request: weblogic.servlet.internal.ServletRequestImpl Any idea how to fix this please? NOTE: This is how to execute my async servlet, just in case: AsyncContext aCtx = request.startAsync(request, response); //delegate long running process to an "async" thread aCtx.addListener(new AsyncListener() { @Override public void onComplete(AsyncEvent event) throws IOException { logger.log(Level.INFO, "ReportExecutionServlet handle async request - onComplete"); } @Override public void onTimeout(AsyncEvent event) throws IOException { logger.log(Level.WARNING, "ReportExecutionServlet handle async request - onTimeout"); } @Override public void onError(AsyncEvent event) throws IOException { logger.log(Level.SEVERE, "ReportExecutionServlet handle async request - onError"); } @Override public void onStartAsync(AsyncEvent event) throws IOException { logger.log(Level.INFO, "ReportExecutionServlet handle async request - onStartAsync"); } }); // Start another service ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(10); executor.execute(new AsyncRequestReportProcessor(aCtx));

    Read the article

  • Netbean6.8: Cant deploy an app if I have Message Driven Bean

    - by Harry Pham
    I create an Enterprise Application CustomerApp that also generated two projects CustomerApp-ejb and CustomerApp-war. In the CustomerApp-ejb, I create a SessionBean call CustomerSessionBean.java as below. package com.customerapp.ejb; import javax.ejb.Stateless; import javax.ejb.LocalBean; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @Stateless @LocalBean public class CustomerSessionBean { @PersistenceContext(unitName = "CustomerApp-ejbPU") private EntityManager em; public void persist(Object object) { em.persist(object); } } Now I can deploy CustomerApp-war just fine. But as soon as I create a Message Driven Bean, I cant deploy CustomerApp-war anymore. When I create NotificationBean.java (message driven bean), In the project destination option, I click add, and have NotificationQueue for the Destination Name and Destination Type is Queue. Below are the code package com.customerapp.mdb; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.jms.Message; import javax.jms.MessageListener; @MessageDriven(mappedName = "jms/NotificationQueue", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) public class NotificationBean implements MessageListener { public NotificationBean() { } public void onMessage(Message message) { } } If I remove the @MessageDriven annotation, then I can deploy the project. Any idea why and how to fix it?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >