Chirag Borkar

Greenhorn
+ Follow
since Mar 01, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chirag Borkar

I guess we are using Spring 3.0.2 but i have observed one thing,

There are 3 jars available in my classpath...

1) spring-context-support-2.5.6.jar
2) spring-context-support-2.5.6.SEC01.jar
3) spring-support-2.0.8.jar

And all of this jar contains the JavaMailSenderImpl.class in it.

Do you think it might cause an issue of this?
13 years ago
Ohh k I got it solved...

In the NotificationServiceImpl Class i have changed the data type to the "mailSender" variable.

Earlier it was : private MailSender mailSender;

Now it is : private JavaMailSender mailSender;

And it started working...However interface JavaMailSender extends MailSender...so it must work...

I have also tried by keeping its data type of the JavaMailSenderImpl still it was showing same error.

But anyways...Thank you very much for all you response.

Appreciated.
13 years ago
Ya surely.....I have properly bundled it as the Service assembly and
I m using sericemix for deploying it....
13 years ago
Hello All,

I am a new to spring framework.

I want to send an email to user for alert purpose.

I have want to expose this as a cxf web service.

After creating classes from WSDL2Java plug in i have implemented necessary methods in my NotificationServiceImpl class.

Following is my XML configuration.

XML:
===

<bean class="com.pmc.ws.notificationservice.NotificationServiceImpl">
<property name="mailSender" ref="mailSender"/>
<property name="messageTemplate" ref="messageTemplate"/>
</bean>


<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="10.60.10.210"/>
<!-- Uncomment if you need to authenticate with your SMTP Server -->
<property name="username" value="Live.Server@abc.in"/>
<property name="password" value="abc123"/>
<property name="port" value="25"/>
<property name="javaMailProperties">
<value>
mail.smtp.auth=true
</value>
</property>
</bean>

<bean id="messageTemplate" class="org.springframework.mail.SimpleMailMessage" scope="prototype">
<property name="from" value="Live.Server@abc.in"/>
</bean>


Following is my NotificationServiceImpl class
=============================

/**
* Please modify this class to meet your needs
* This class is not complete
*/

package com.pmc.ws.notificationservice;

import java.util.logging.Logger;

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

/**
* This class was generated by Progress FUSE Services Framework 2.2.x-fuse-SNAPSHOT
* Tue Jul 20 10:22:34 IST 2010
* Generated source version: 2.2.x-fuse-SNAPSHOT
*
*/

@javax.jws.WebService(
serviceName = "NotificationService",
portName = "NotificationServiceSOAP",
targetNamespace = "http://www.ws.pmc.com/NotificationService/",
endpointInterface = "com.pmc.ws.notificationservice.NotificationService")

public class NotificationServiceImpl implements NotificationService {

private static final Logger LOG = Logger.getLogger(NotificationServiceImpl.class.getName());
private MailSender mailSender = null;
private SimpleMailMessage messageTemplate = null;

public MailSender getMailSender() {
return mailSender;
}
public void setMailSender(MailSender mailSender) {
this.mailSender = mailSender;
}
public SimpleMailMessage getMessageTemplate() {
return messageTemplate;
}
public void setMessageTemplate(SimpleMailMessage messageTemplate) {
this.messageTemplate = messageTemplate;
}
public void prepareAndSendEmail (){
messageTemplate.setTo("chirag.borkar@abc.in");
messageTemplate.setSubject("Testing Notification Service");
messageTemplate.setText("TAAAAADDDDDDDDDd");
getMailSender().send(messageTemplate);
}
/* (non-Javadoc)
* @see com.pmc.ws.notificationservice.NotificationService#notifyByEmail(com.pmc.ws.notificationservice.GenericRequest genericRequest ,)com.pmc.ws.notificationservice.EmailMessage emailMessage ,)java.lang.String messageType ,)java.util.List<com.pmc.ws.notificationservice.PlaceHolder> placeHolder )*
*/
public com.pmc.ws.notificationservice.GenericResponse notifyByEmail(com.pmc.ws.notificationservice.GenericRequest genericRequest,com.pmc.ws.notificationservice.EmailMessage emailMessage,java.lang.String messageType,java.util.List<com.pmc.ws.notificationservice.PlaceHolder> placeHolder) {
LOG.info("Executing operation notifyByEmail");
System.out.println(genericRequest);
System.out.println(emailMessage);
System.out.println(messageType);
System.out.println(placeHolder);
try {
com.pmc.ws.notificationservice.GenericResponse _return = new GenericResponse();
_return.setResponseCode(1);
_return.setResponseMessage("testing");
_return.setResponseStatus("Seding test email");
prepareAndSendEmail();
return _return;
} catch (Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}

}



When I deploy it i am getting following exception.
================================

<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token />
<loc-message>Error creating bean with name 'org.apache.servicemix.cxfse.CxfSeEndpoint#0' defined in file [C:\apache-servicemix-4.2\data\jbi\Notification-sa\sus\Notification-se-su\xbean.xml]: Cannot create inner bean 'com.pmc.ws.notificationservice.NotificationServiceImpl#0' of type [com.pmc.ws.notificationservice.NotificationServiceImpl] while setting bean property 'pojo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.pmc.ws.notificationservice.NotificationServiceImpl#0' defined in file [C:\apache-servicemix-4.2\data\jbi\Notification-sa\sus\Notification-se-su\xbean.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mailSender' of bean class [com.pmc.ws.notificationservice.NotificationServiceImpl]: Bean property 'mailSender' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?</loc-message>
<stack-trace><![CDATA[org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.servicemix.cxfse.CxfSeEndpoint#0' defined in file [C:\apache-servicemix-4.2\data\jbi\Notification-sa\sus\Notification-se-su\xbean.xml]: Cannot create inner bean 'com.pmc.ws.notificationservice.NotificationServiceImpl#0' of type [com.pmc.ws.notificationservice.NotificationServiceImpl] while setting bean property 'pojo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.pmc.ws.notificationservice.NotificationServiceImpl#0' defined in file [C:\apache-servicemix-4.2\data\jbi\Notification-sa\sus\Notification-se-su\xbean.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mailSender' of bean class [com.pmc.ws.notificationservice.NotificationServiceImpl]: Bean property 'mailSender' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:87)
at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(ServiceUnitImpl.java:104)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.deploySUs(ServiceAssemblyInstaller.java:207)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:85)
at org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:352)
at org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:282)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1350)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1301)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:362)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272)
at org.apache.felix.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:54)
at org.apache.felix.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:41)
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
at org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:50)
at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:229)
at org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:162)
at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:101)
at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:79)
at org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
at org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:181)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.pmc.ws.notificationservice.NotificationServiceImpl#0' defined in file [C:\apache-servicemix-4.2\data\jbi\Notification-sa\sus\Notification-se-su\xbean.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mailSender' of bean class [com.pmc.ws.notificationservice.NotificationServiceImpl]: Bean property 'mailSender' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1279)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
... 42 more
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'mailSender' of bean class [com.pmc.ws.notificationservice.NotificationServiceImpl]: Bean property 'mailSender' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:801)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1276)
... 48 more



Any Help will be appreciated.

Thanks & Regards,
Chirag Borkar







13 years ago
Hi Michale,

Thank you very much for replying.

Actually I have already tried that method, but still its not bringing focus back in my textBox.

I have tried following method also.

public void manuallyRequestFocus()
{
if(textBox.isVisible()){
textBox.setFocusable(true);
boolean getFocus = false;
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
if(!(getFocus = textBox.requestFocusInWindow()))
{
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
if(!(getFocus = textBox.requestFocusInWindow()))
{
System.out.println("*********Failed to get the focus after 2 trials");
}
}
textBox.validate();
}
}
14 years ago
Hello All,

We have an Swing awt base application which is internally calling the External browser using the JBrowser.dll

When we come back from the any external web application we get some values to process back.

After processing those values we are redrawing the view of the Swing application. However at this point of time we are not able to get the focus on the desired textBox and our key board stops working.

We have noticed that the virtual keypad that we have on the application is working fine. This issue is generated on the random basis.

If somebody have face this issue or know something or have some suggestion then it will be good help.

Thanks in advance.
14 years ago