Vikas Taank

Greenhorn
+ Follow
since Oct 08, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vikas Taank

Hi Friends,
I am exposing an EJB2.1 stateless bean as a web service.




My Service Interface:


I am trying to access My service from my Web Application LIke this:


But I am getting the following exception:



I am new to Web services. Please tell me the way I can call the EJB web services from My Web Client.

Thanks IN advance.

15 years ago
Yes
when I run the following command from command prompt:

ping studentjobexchange.com

Pinging studentjobexchange.com [206.188.212.77] with 32 bytes of data:
Reply from 206.188.212.77: bytes=32 time=56ms TTL=48
Reply from 206.188.212.77: bytes=32 time=53ms TTL=48
Reply from 206.188.212.77: bytes=32 time=53ms TTL=48
Reply from 206.188.212.77: bytes=32 time=58ms TTL=48

i

but when i ping smtp.studentjobexchange.com
I am getting this.
Pinging smtp.studentjobexchange.com.netsolmail.net [205.178.146.50] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

This is weird , Howsit running from my machine.

I am just curious if it has got something to do with firewall or port.
Moreover how do I know that smtp server is running on the machine where i have deployed my web app and moreover the port number at which, it is running.
I have already given the properties that I ma using and with the same properties , I am able to send mails from my local machine.

Thanks in advance
16 years ago
I am using the following properties to send the mail using java mail API.

props.put("mail.smtp.host", "smtp.studentjobexchange.com");
props.put("mail.smtp.starttls.enable","true");
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.port","587");
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "true");

my domian is studentjobexchange.com.

while sending mail from this domain, I am getting the following exception:



DEBUG: not loading file: /usr/java/jre1.6.0_06/lib/javamail.providers
DEBUG: java.io.FileNotFoundException: /usr/java/jre1.6.0_06/lib/javamail.providers (No such file or directory)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: not loading file: /usr/java/jre1.6.0_06/lib/javamail.address.map
DEBUG: java.io.FileNotFoundException: /usr/java/jre1.6.0_06/lib/javamail.address.map (No such file or directory)
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.studentjobexchange.com", port 587, isSSL false
javax.mail.MessagingException: Unknown SMTP host: smtp.studentjobexchange.com;
nested exception is:
java.net.UnknownHostException: smtp.studentjobexchange.com
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1389)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
at javax.mail.Service.connect(Service.java:310)
at javax.mail.Service.connect(Service.java:169)
at javax.mail.Service.connect(Service.java:118)
at javax.mail.Transport.send0(Transport.java:188)
at javax.mail.Transport.send(Transport.java:118)
at com.bramha.sje.util.SendMail.sendMail(SendMail.java:88)
at com.bramha.sje.views.SaveUserBean.save(SaveUserBean.java:352)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
at org.ajax4jsf.Filter.doFilter(Filter.java:175)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:128)
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:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: smtp.studentjobexchange.com
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
... 43 more



Please help me if I am doing anything wrong.
The same code is working fine in my local machine but when i deploy on server, the exception comes.

Thanks in advance.
16 years ago
Dear Friends , I am new to JSF so it may be a trivial doubt also.

I have one main.jsp
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/sjx.css">
</head>
<body class="bodystylemain">
<f:view>
<rich:spacer height="20px"></rich:spacer>
<h:form>

<h anelGrid id="mainpanel" columns="2">
<rich:spacer width="190px"></rich:spacer>
<h anelGrid id="headernav" columns="5">
<rich:spacer width="600px"></rich:spacer>
<h utputText value="Welcome" styleClass="headertext"></h utputText>
<h utputText value="#{saveUserBean.user.email}" styleClass="headertext"></h utputText>
<h:graphicImage url="images/bar.gif"></h:graphicImage>
<h:commandLink value="Logout" action="#{saveUserBean.logout}" styleClass="headertext"></h:commandLink>
</h anelGrid>
</h anelGrid>
</h:form>
<rich:spacer height="200px"></rich:spacer>
<h anelGrid id="contentpanel" columns="2">
<rich:spacer width="100px"></rich:spacer>
<rich:tabPanel switchType="server" height="300px" width="1000px" tabClass="tabs" contentClass="tabcontent" headerAlignment="right" >
<rich:tab label="About Us" id="aboutus">
<jsp:include page="include/aboutus.jsp"></jsp:include>
</rich:tab>
<rich:tab label="Counselor Corner" id="counselor">
<h utputText value="If you have any query , Please write to us , Our experts are here to advise you"></h utputText>
<jsp:include page="include/inquiryform.jsp"></jsp:include>
</rich:tab>
<rich:tab label="Exchange" id="exchange">
Here is tab #3
</rich:tab>
</rich:tabPanel>
</h anelGrid>
<jsp:include page="include/footer.jsp"></jsp:include>
</f:view>

</body>

</html>

I have three tabs in that. I have one form in one tab.
When i do the submit from that tab , my result page is displayed.
The problem is I want my result page to be displayed in the same Tab container from which then form was submitted. What kind of navigation rule i need to give in faces config for this functionality.
The navigation rule is as follows:
<navigation-rule>
<description></description>
<from-view-id>/main.jsp</from-view-id>
<navigation-case>
<from-outcome>logout</from-outcome>
<to-view-id>/mytest.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>result</from-outcome>
<to-view-id>/result.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>

the result page is coming but it is coming as a different page and not loading in the tab itself.
Help will be appreciated.
Vikas
16 years ago
JSF
Hi , I am trying to configure log4j for my application which i am developing in Richfaces.
I am getting the following errors once i start the tomcat 6.0.18
log4j:WARN No appenders could be found for logger (org.ajax4jsf.application.DebugLifecycleFactory).
log4j:WARN Please initialize the log4j system properly.

I have put the log4j.jar in lib directory under WEB-INF and the log4j.properties in WEB-INF/classes folder.
Some people said that log4j.properties has to be in the class path and that's what I have done. I have tried to place properties file at various places but still the log4j is not working.
# STDOUT appender
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d %p [%t] %C{1} - %m\n

# use the STDOUT appender. set the level to INFO.
log4j.category.com.devdaily.log4jdemo.Log4JDemo=INFO, STDOUT

Please help me how to make log4j work and get rid of this error.
Any inputs will be higly appreciated.

you can mail me on [email protected] or else give the solution here itself.
Thanks in Advance

The log4j.properties is as follows;
16 years ago
JSF
Hi,
I am using the following code to display graphic image.
<h:graphicImage id="fiPricePendingToolRefreshImage"
value="/images/refresh.jpg">
<rich:toolTip for="fiPricePendingToolRefreshImage"
followMouse="true" direction="top-right" showDelay="200"
styleClass="tooltip">
<span style="white-space: nowrap">Refresh</span>
</rich:toolTip>
</h:graphicImage>

Graphic Image does not have attribute like "action". So I am enclosing this image in the <a4j:commandLink> like this:
<a4j:commandLink id="Refresh"
action="#{fiPriceController.downloadFile}">
<h:graphicImage id="fiPricePendingToolRefreshImage"value="/image/refresh.jpg"><rich:toolTip for="fiPricePendingToolRefreshImage"
followMouse="true" direction="top-right" showDelay="200"
styleClass="tooltip">
<span style="white-space: nowrap">Refresh</span>
</rich:toolTip>
</h:graphicImage>
</a4j:commandLink>

But in the above case my action method is not getting invoked.
If I use command button to invoke the same action method. It's working fine and I am able to download the file.
<h:commandButton id="export"
action="#{fiPriceController.downloadFile}">
</h:commandButton>

has anybody ever used the <h:graphicImage> to invoke the action method and how it has been done. Please reply as it is very critical to my project.
Thanks in advance.
16 years ago
JSF