Posts

Showing posts from September, 2015

Generate PDF Reports using iText

Image
Hi, In this blog I would like to show how to create PDF report using iText API. Below is working code to generate PDF. import com.itextpdf.text.BadElementException; import com.itextpdf.text.BaseColor; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Element; import com.itextpdf.text.Font; import com.itextpdf.text.Font.FontFamily; import com.itextpdf.text.Image; import com.itextpdf.text.PageSize; import com.itextpdf.text.Paragraph; import com.itextpdf.text.Phrase; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfPageEventHelper; import com.itextpdf.text.pdf.PdfWriter; import java.io.FileOutputStream; import java.io.IOException; import java.net.MalformedURLException; public class PDFReportGeneration {     public PDFReportGeneration() {         super();     }     public static void main(String[] args) {  

javax.xml.ws.WebServiceException: javax.xml.ws.WebServiceException: java.lang.InstantiationException: weblogic.wsee.jaxws.client.async.AsyncTransportProvider

javax.xml.ws.WebServiceException: javax.xml.ws.WebServiceException: java.lang.InstantiationException: weblogic.wsee.jaxws.client.async.AsyncTransportProvider I got below error while deploying my webCenter project to the integrated weblogic server. Reason: Due to unwanted jars in the project Library and classpath. Solution: Remove unwanted jar from the libraries and classpath. In my case weblogic.jar is present. javax.xml.ws.WebServiceException: javax.xml.ws.WebServiceException: java.lang.InstantiationException: weblogic.wsee.jaxws.client.async.AsyncTransportProvider        at weblogic.wsee.jaxws.WLSInstanceResolver.getSingleton(WLSInstanceResolver.java:36)        at weblogic.wsee.jaxws.WLSInstanceResolver.start(WLSInstanceResolver.java:55)        at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.start(WLSInstanceResolver.java:82)        at com.sun.xml.ws.server.InvokerTube.setEndpoint(InvokerTube.java:85)        at weblogic.wsee.jaxws.EndpointAwareLa

Failed to load weblogic client internal deployment descriptor. java.io.IOException.

Failed to load weblogic client internal deployment descriptor. java.io.IOException. If you are getting above error while making web service call in your java code. The cause might be with missing classes in your project path. In my case, I am trying to make web service call through java class and I got the above issue. To fix the issue, I have added wseeclient.jar to the project class path. I am using IDE JDeveloper to run my main java class. And this jar will be present in below path in my case. C:\Oracle\Middleware\wlserver_10.3\server\lib 

Send email from java code.

This blog will explain how to send email from java code. In order to send email from java code, we need to set properties of mail server and protocol. In my example I have set the authentication to false. So no authentication required before sending the email. Below is the working java code to send email. import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SendEmail {     public SendEmail() {         super();     }     public static void main(String[] args) {         SendEmail sendEmail = new SendEmail();         //here you can set array size more to send mail to more users.         String to[] = new String[1];         to[0] = "kumar@gmail.com";         sendEmail.sendEmail("dileep@gmail.com", to, "rongali@gmail.com

BEA-000362 Server failed. Reason: [Management:141268]Parsing Failure in config.xml

<Sep 6, 2015 4:21:30 PM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.5.0  Fri Apr 1 20:20:06 PDT 2011 1398638 > <Sep 6, 2015 4:21:30 PM IST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141268]Parsing Failure in config.xml on line 1, column 1: Content is not allowed in prolog.> <Sep 6, 2015 4:21:30 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED> <Sep 6, 2015 4:21:30 PM IST> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down> <Sep 6, 2015 4:21:30 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN> Process exited. If you are getting above error means, Jdeveloper is not closed properly. And config.xml is corrupted. Deleting DefaultDomain folder o