JSP non-lockable javamail
HI,
I'm using the javamail api through JSP pages. The problem comes from the Transport Object which locks when connecting to my stmp server. Therefore, if i send 10 e-mail in a loop, it takes more than 50 sec to send all the mails since the connection to my smtp server takes at least 5s per mail.
I was wondering if there is a way to create a non-lockable transport object which would send the mail regardless if the connection succeeded or not. Or can i configure my tomcat to do this mail background thing instead. Note that making only 1 connection for the 10 email is not a valid solution since the transport object would still lock during the only connection.
Thanks...
Thanks for replying.
Maybe i explained it wrong. I can't really fix the STMP server, because i don't own it...:( But the problem is that my JSP code hangs for 5 sec each time wether the connection is successfull or not.
Is it possible to launch the Transport connection in background, or on a separate thread or handle it with a third party (tomcat) so that email processing doesn't slow down my JSP page processing. I'm not really interested in handling the smtp connection failure. If the connection fails, that's too bad i cound'nt send the mail but a least the JSP processing time is not affected. If the connection succeed, i don't want to wait the 5 sec connection time. I just want to go on with the page processing.
The behavior i'm looking for is a transport object that would use a send mail function without waiting for a conneciton. The object itself would handle the connection and send the mail if successful and don't send it if not. All this would be non-lockable...
i wonder if this is possible ?
Similar Messages
-
Previous unanswered Hot deploy of non EJB, non JSP classes
Subject to my last post I've since seen my questions has appeared twice on this
newsgroup, March 2001, and Nov 2000 and no responses to it those times. Aren't
there BEA engineers reading this newsgroup who would know the answer to that question?
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=3776&utag=
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=5171&utag=
Firstly I already did call BEA support before coming here, this is my last resort.
I can't get a definitive answer from support. They were the ones that actually
suggested to me that I post here in the first place. I did search the BEA edocs
and couldn't find anything on it.
Secondly, I am using WL 6.1 SP1, and in the thread just beneath this one, which
I referred to directly in my opening post on this thread, I do mention this in
the opening paragraph, in fact I give considerable detail.
Thirdly, I never implied there was an onus on any BEA engineer to answer anything
here. What I did mean was that given that they do read these posts and they do
answer posts, I was merely a bit concerned that as I'm third person to ask, it
would be strange to still get no response given that they answer other questions.
I mean if they don't know, then who does? It's a real simple yes/no answer, it
would take 5 seconds.
Paul
Robert Patrick <[email protected]> wrote:
>
>
>The answer is simple -- move to WLS 6.x and use enterprise applications
>(or web applications or an EJB jar file)
>to package everything up into a single deployment unit and hot deploy
>the whole deployment unit. WLS 5.1 and
>earlier do not support hot deployment of non-servlet/non-JSP/non-EJB
>classes.
>
>Mike Reiche wrote:
>
>> You can always call BEA Support - 1.888.232.7878 to get the help you
>need. This
>> newsgroup is not official BEA Support. It is out of the goodness of
>their hearts
>> that BEA engineers help people out here.
>>
>> I don't really think you wanted everyone that read your email and didn't
>know
>> if such a feature was available, to send you an email saying 'No, I
>don't know
>> if such a feature is available'. That's why there were zero responses.
>>
>> None of the posts you listed mention what version of WL. That makes
>a difference.
>> Also read the online documentation at edocs.bea.com, search for 'hot
>deploy'.
>>
>> Mike Reiche
>>
>> "Paul H" <[email protected]> wrote:
>> >
>> >Subject to my last post I've since seen my questions has appeared
>twice
>> >on this
>> >newsgroup, March 2001, and Nov 2000 and no responses to it those times.
>> >Aren't
>> >there BEA engineers reading this newsgroup who would know the answer
>> >to that question?
>> >
>> >http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=3776&utag=
>> >
>> >http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=5171&utag=
>
>
><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
><html>
>The answer is simple -- move to WLS 6.x and use enterprise applications
>(or web applications or an EJB jar file) to package everything up into
>a single deployment unit and hot deploy the whole deployment unit.
>WLS 5.1 and earlier do not support hot deployment of non-servlet/non-JSP/non-EJB
>classes.
><p>Mike Reiche wrote:
><blockquote TYPE=CITE>You can always call BEA Support - 1.888.232.7878
>to get the help you need. This
><br>newsgroup is not official BEA Support. It is out of the goodness
>of
>their hearts
><br>that BEA engineers help people out here.
><p>I don't really think you wanted everyone that read your email and
>didn't
>know
><br>if such a feature was available, to send you an email saying 'No,
>I
>don't know
><br>if such a feature is available'. That's why there were zero responses.
><p>None of the posts you listed mention what version of WL. That makes
>a difference.
><br> Also read the online documentation at edocs.bea.com, search
>for
>'hot deploy'.
><p>Mike Reiche
><p>"Paul H" <[email protected]> wrote:
><br>>
><br>>Subject to my last post I've since seen my questions has appeared
>twice
><br>>on this
><br>>newsgroup, March 2001, and Nov 2000 and no responses to it those
>times.
><br>>Aren't
><br>>there BEA engineers reading this newsgroup who would know the answer
><br>>to that question?
><br>>
><br>>http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=3776&utag=
><br>>
><br>>http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=5171&utag=</blockquote>
></html>
>
>
-
Conversion of 1.2 JATO project (non-Forte IDE) to S1AF (JATO) 2.0
JATO Team,
First of all, thank you very much for the Studio integration. It
looks very promising in terms of development time consumption,
deployment to S1AS7, etc., etc. It is impossible to observe all
advantages for so short period of time.
The SOAF (JATO) 2.0 is installed on the top of the Sun ONE Studio 4,
update 1 (EE) with JDK 1.4 along with the Sun One Application Server
7 (W2000). Everything looks okay, at least all basic tasks listed in
the "Getting Started" manual (project/view/model creation, basic db
connection, running of a test application with the usage of the
Studio's default Tomcat container, etc.) work proper.
During the installation of S1AF module on the top of the Sun ONE
Studio 4, update 1 (EE) I've got an invitation to convert the
existing project to the new environment. As I realized the only JATO
project integrated/created with Forte IDE is applicable for this auto-
conversion (please correct me, if I am wrong. It could solve a lot of
my problems).
Since we are using JBuilder5 IDE and our JATO 1.2 project is
integrated with this IDE I manually re-created project in the Studio
with its file structure, adjusted the project web.xml file, etc. This
new project looks like a proper one (Studio recognize all methods,
fields, bean patterns, e.g.) except at least one "small" thing. All
java files (project viewBeans, Models, custom viewBeanHelpers a.k.a.
pure java) came up with the same wizard image:java class. Stutio with
the S1AF module reserves the special images (and appropriate studio
properties, of course!) for View and Model. Namely this allows to see
the following structure for a ViewBean, for example, in the Studio:
Modules
ProjectName.ModuleName
FooViewBean
JavaSource
JSPs
Non-Visual Components
View Components
On the other hand, I could add either new View or Model in my
manually converted project and add any View Component or bind the
Model fields, for example. Also, the ProjectModuleServlet has been
converted proper. I tried to convert each View/Model class inside the
Studio to its proper wizard image and failed. Addition of a View
Components (with an appropriate code fragments) via the Studio or
auto-binding of model fields is an essential part of 2.0 and should
drastically speed up the development process as it is designed.
Questions:
1. What I missed in my manual conversion of 1.2 JATO project to the
SOAF (JATO) 2.0 realm? What should I correct in my JATO 1.2
compatible classes (Views and Models) to be recognizable by Studio
wizard (JATO 2.0)?
To be more specific. Some deltas between JATO 1.2 and JATO 2.0 are as
follows (related to a ViewBean):
====++++++++++++++======
JATO 1.2 viewBean extension upon creation:
public class FooViewBeanViewBean extends ViewBeanBase
implements ViewBean
========================
JATO 2.0 (S1AF) version: viewBean extension upon creation:
public class FooViewBean extends BasicBeanBase
====++++++++++++++======
JATO 1.2 viewBean createChild(...) method for one static looks
like:
protected View createChild(String name)
if (name.equals(CHILD_STATICTEXT1))
StaticTextField child = new StaticTextField
(this,
getDefaultModel(),
CHILD_STATICTEXT1,
CHILD_STATICTEXT1,
CHILD_STATICTEXT1_RESET_VALUE,
null);
return child;
========================
JATO 2.0 (S1AF) version: viewBean createChild(...) is renamed (as
a least) to createChildReserved(...):
protected View createChildReserved(String name) {
if (name.equals(CHILD_STATICTEXT1)) {
com.iplanet.jato.view.BasicDisplayField child =
new com.iplanet.jato.view.BasicDisplayField(this,
STATICTEXT1);
return child;
====++++++++++++++======
JATO 1.2 viewBean registerChildren() method for the basic field
types looks like:
private void registerChildren() {
registerChild(CHILD_STATICTEXT1, StaticTextField.class);
registerChild(CHILD_TEXTFIELD1, TextField.class);
registerChild(CHILD_BUTTON1, Button.class);
========================
JATO 2.0 (S1AF) version: viewBean registerChildren() method:
private void registerChildren() {
registerChild(CHILD_STATICTEXT1,
com.iplanet.jato.view.BasicDisplayField.class);
registerChild(CHILD_TEXTFIELD1,
com.iplanet.jato.view.BasicDisplayField.class);
registerChild(CHILD_BUTTON1,
com.iplanet.jato.view.BasicCommandField.class);
Is it correct to say that all existing custom Views/Models
(compatible with JATO 1.2) should be converted to their JATO 2.0
variants to be visible by the Studio?
On the other hand, fast overview of 2.0 API shows that the JATO 1.2
is a sub-set of the 2.0 (BasicViewBean extends ViewBeanBase, for
example). What exactly (only deprecated methods?) should be adjusted
in the project code (1.2), if necessary, to be visible by Studio as a
View or Model component?
2. Where it is possible to find the list of deprecated methods (from
JATO 1.2 to JATO 2.0 versions). It is difficult sometimes to compare
two versions of API docs (1.2 and 2.0) or compare logs between
versions. Also, JATO 2.0 is significantly larger than 1.2 version. If
the later obviously inherits the ND conversion stage (via the
previous versions), the former obviously has additions incoming from
the integration with the Studio (a.k.a. Forte 4.0).
3. What is the current/future Sun/JATO Team policy with regards to
JATO source code access (version 2.0, at least)? The reason of this
question is as follows: in order to display dates formatted on the
screens we adjusted a couple of JATO 1.2 core classes, for example.
The only minimal, absolutely necessary changes in JATO 1.2 was made,
but anyway...
Sorry for so long multiple question. As Todd wrote in his
announcement mail: "We think you will be very pleased with the new
product...". This is exciting moment, I believe, for JATO Team as
well as for any team involved into the conversion of the full size
application/product from ND to J2EE realm with the JATO as
an application framework (1.0, 1.1.x, 1.2.X, and 2.0 finally). The
last step is left in this spiral process to enjoy the ND_Studio
attractive features in the open source environment.
Thank you very much in advance.
Vladimir IvanovI'll get some file templates ASAP and provide them to the group.
As for source code, I'm not sure what the policy is. JATO 1.2 is very
close to what JATO 2.0 is, so that should suffice for now.
The community will be informed when we know more about source availibility.
craig
vivanov4114 wrote:
Craig,
Thank you for the answer. To be honest with you I tried to do exactly
the same: I created the small test project and made an attempt to
adjust the existing *.xml files to the new ones. I got some results,
otherwise I couldn't even see my original 1.2 project in the Studio.
Since I am a newcomer in the Studio, I definitely missed something in
my adjustments. I'll try to observe my changes with the fresh head.
On the other hand, I am afraid that my samples are very pure. If you
could post or send me examples of jatoapp.xml and web.xml files (say
for any of you test project) or excerptions from them with the
appropriate patterns (ViewBean and Model peers, at least), I would be
very appreciated. My mail is: vivanov@b...
In the worst-case scenario I see the workaround: to re-create the
project for one of our releases with the Forte 4.1 IDE and auto-
convert it into the JATO 2.0/Studio world using the Studio
facilities. We must get the current project fully
integrated/converted with/to the Studio (at certain point) because,
first, we expect massive coding with the GUI components involved soon
and, secondly, we have around thousand classes related to JATO only
(and a lot of extras).
Coming back to the question #3 from this post. Now we have full
access to the version 1.2, not only to the JATO 1.2 jar file(I
explained some reasons below). Would we expect the same Sun/JATO Team
policy with JATO 2.0?
Thank you again,
Vlad
--- In SunONE-JATO@y..., "cvconover" <craig.conover@s...> wrote:
It doesn't appear that anyone has responded to this so I am goingto
give you the short answer:
The reason you don't see your ViewBeans and Models showing up with
there "wizard created" icons is because of just that. They weren't
created via the wizards. The wizards create xml formatted filesthat
contain metadata of how/what to generate for the ViewBeans and
Models.
ViewBeans will have a .viewbean fiel, Models will have a .sqlmodel
file (for SQL Models), etc. The content of these files describesthe
code that needs to be generated in the corresponding Java classfile.
So LoginViewBean.java will have a peer LoginViewBean.viewbean file.
The code that is generated is place in protected code blocks thatcan
not be modified in the Studio and should not be modified outsidethe
Studio because the code will likely be regenerated and custom mods
inside the protected blocks will be lost.
Now you can make a JATO 1.2 app appear in the Studio just like aJATO
2.0 app by adding a jatoapp.xml file with the proper content and
adjusting your web.xml properly, but it's much more work to getyour
v1.2 ViewBeans and Models to show up like wizard created versions.
Furthermore, even more work to get the display fields to show up
visually.
The good news is that v1.2 ViewBeans will work with newly wizard
created ViewBeans. And if you do go through the trouble of making
your ViewBeans Studio visible like your wizard created ViewBeans,
adding new display fields visually will work along side yourmanually
created fields.
Try creating a new JATO app using the Studio wizards and then go to
the Filesystems tab and look for the jatoapp.xml file and theweb.xml
file.
I am looking for an email that I have that explains how to do a
partial, manual upgrade.
Also, you will get rid of your JATO 1.2 jar and replace with theJATO
2.0 jar in your lib dir.
Hope this will suffice for now.
craig
--- In SunONE-JATO@y..., "vivanov4114" <vivanov@b...> wrote:
JATO Team,
First of all, thank you very much for the Studio integration. It
looks very promising in terms of development time consumption,
deployment to S1AS7, etc., etc. It is impossible to observe all
advantages for so short period of time.
The SOAF (JATO) 2.0 is installed on the top of the Sun ONE Studio4,
update 1 (EE) with JDK 1.4 along with the Sun One ApplicationServer
7 (W2000). Everything looks okay, at least all basic tasks listedin
the "Getting Started" manual (project/view/model creation, basic
db
connection, running of a test application with the usage of the
Studio's default Tomcat container, etc.) work proper.
During the installation of S1AF module on the top of the Sun ONE
Studio 4, update 1 (EE) I've got an invitation to convert the
existing project to the new environment. As I realized the onlyJATO
project integrated/created with Forte IDE is applicable for thisauto-
conversion (please correct me, if I am wrong. It could solve a
lot
of
my problems).
Since we are using JBuilder5 IDE and our JATO 1.2 project is
integrated with this IDE I manually re-created project in theStudio
with its file structure, adjusted the project web.xml file, etc.This
new project looks like a proper one (Studio recognize all
methods,
fields, bean patterns, e.g.) except at least one "small" thing.All
java files (project viewBeans, Models, custom viewBeanHelpersa.k.a.
pure java) came up with the same wizard image:java class. Stutiowith
the S1AF module reserves the special images (and appropriate
studio
properties, of course!) for View and Model. Namely this allows tosee
the following structure for a ViewBean, for example, in the
Studio:
Modules
ProjectName.ModuleName
FooViewBean
JavaSource
JSPs
Non-Visual Components
View Components
On the other hand, I could add either new View or Model in my
manually converted project and add any View Component or bind the
Model fields, for example. Also, the ProjectModuleServlet hasbeen
converted proper. I tried to convert each View/Model class insidethe
Studio to its proper wizard image and failed. Addition of a View
Components (with an appropriate code fragments) via the Studio or
auto-binding of model fields is an essential part of 2.0 and
should
drastically speed up the development process as it is designed.
Questions:
1. What I missed in my manual conversion of 1.2 JATO project tothe
SOAF (JATO) 2.0 realm? What should I correct in my JATO 1.2
compatible classes (Views and Models) to be recognizable byStudio
wizard (JATO 2.0)?
To be more specific. Some deltas between JATO 1.2 and JATO 2.0are
as
follows (related to a ViewBean):
====++++++++++++++======
JATO 1.2 viewBean extension upon creation:
public class FooViewBeanViewBean extends ViewBeanBase
implements ViewBean
========================
JATO 2.0 (S1AF) version: viewBean extension upon creation:
public class FooViewBean extends BasicBeanBase
====++++++++++++++======
JATO 1.2 viewBean createChild(...) method for one static looks
like:
protected View createChild(String name)
if (name.equals(CHILD_STATICTEXT1))
StaticTextField child = new StaticTextField
(this,
getDefaultModel(),
CHILD_STATICTEXT1,
CHILD_STATICTEXT1,
CHILD_STATICTEXT1_RESET_VALUE,
null);
return child;
========================
JATO 2.0 (S1AF) version: viewBean createChild(...) is renamed(as
a least) to createChildReserved(...):
protected View createChildReserved(String name) {
if (name.equals(CHILD_STATICTEXT1)) {
com.iplanet.jato.view.BasicDisplayField child =
new com.iplanet.jato.view.BasicDisplayField(this,
STATICTEXT1);
return child;
====++++++++++++++======
JATO 1.2 viewBean registerChildren() method for the basic field
types looks like:
private void registerChildren() {
registerChild(CHILD_STATICTEXT1,
StaticTextField.class);
registerChild(CHILD_TEXTFIELD1, TextField.class);
registerChild(CHILD_BUTTON1, Button.class);
========================
JATO 2.0 (S1AF) version: viewBean registerChildren() method:
private void registerChildren() {
registerChild(CHILD_STATICTEXT1,
com.iplanet.jato.view.BasicDisplayField.class);
registerChild(CHILD_TEXTFIELD1,
com.iplanet.jato.view.BasicDisplayField.class);
registerChild(CHILD_BUTTON1,
com.iplanet.jato.view.BasicCommandField.class);
Is it correct to say that all existing custom Views/Models
(compatible with JATO 1.2) should be converted to their JATO 2.0
variants to be visible by the Studio?
On the other hand, fast overview of 2.0 API shows that the JATO1.2
is a sub-set of the 2.0 (BasicViewBean extends ViewBeanBase, for
example). What exactly (only deprecated methods?) should beadjusted
in the project code (1.2), if necessary, to be visible by Studio
as
a
View or Model component?
2. Where it is possible to find the list of deprecated methods(from
JATO 1.2 to JATO 2.0 versions). It is difficult sometimes tocompare
two versions of API docs (1.2 and 2.0) or compare logs between
versions. Also, JATO 2.0 is significantly larger than 1.2
version.
If
the later obviously inherits the ND conversion stage (via the
previous versions), the former obviously has additions incomingfrom
the integration with the Studio (a.k.a. Forte 4.0).
3. What is the current/future Sun/JATO Team policy with regards
to
JATO source code access (version 2.0, at least)? The reason ofthis
question is as follows: in order to display dates formatted onthe
screens we adjusted a couple of JATO 1.2 core classes, forexample.
The only minimal, absolutely necessary changes in JATO 1.2 wasmade,
but anyway...
Sorry for so long multiple question. As Todd wrote in his
announcement mail: "We think you will be very pleased with the
new
product...". This is exciting moment, I believe, for JATO Team as
well as for any team involved into the conversion of the fullsize
application/product from ND to J2EE realm with the JATO as
an application framework (1.0, 1.1.x, 1.2.X, and 2.0 finally).The
last step is left in this spiral process to enjoy the ND_Studio
attractive features in the open source environment.
Thank you very much in advance.
Vladimir IvanovTo download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed] -
Help running a simple jsp file,Tomcat 5.0.16
Hi,
This question may be addressed many many times,but do reply.
I have a Win xp operating system
Installed Tomcat 5.0.16 in it.
Next the directory structure
PS : The sampleapp directory is outside the tomcat installation directory.
E:/sampleapp
| |
ROOT WEB-INF
|
classes
|
<package1><structure> .class files (for servlet works fine!!!!)
in the WEB-INF,there is the web.xml,then sourcefiles<dir> and the lib directory which is empty.
Now the servlet files work fine.........
I have placed my MyJsp.jsp file in the above mentioned ROOT directory.
I have not done any thing with the <TOMCAT_HOME>/conf/server.xml file
and the web.xml which I have written.
When I give the following URI
http://localhost:8080/sampleapp/MyJsp.jsp,
I get the HTTP status 404- /MyJsp.jsp
description: The requested resource (/MyJsp.jsp) is not available.
Hoping that I have defined the problem specifically.Kindly show some light on this.
Thanks
ASNevermind. I just found the answer. For the record, there are two ways in getting JSPs to work:
1. Precompiling the JSPs and modifying your webapp's web.xml file with the XML fragment generated in YourWebApp/web/WEB-INF/generated_web.xml;
2. Not precompiling the JSPs, but simply letting tomcat compile it on the fly on first access.
PRECOMPILATION METHOD
Go to http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html. Copy-and-paste the ant script under the section "Web Application Compilation" into a file called compile.xml. For me, I save it in ~/development/compile.xml. Then compile the JSPs using the command (all in a single line):
$ANT_HOME/ant -file <PATH_TO_COMPILE.XML> -Dtomcat.home=<$TOMCAT_HOME> -Dwebapp.path=<$WEBAPP_PATH>
In my case, I cd into the directory where my app resides:
cd ~/development/HelloWorld
and then I type:
ant -file ~/development/compile.xml -Dtomcat.home=/var/tomcat5 -Dwebapp.path=.
(Note the trailing dot since my current directory is my webapp's directory itself. Also, in my case, my shell's PATH contains the path to the ant executable, so I just type 'ant' directly.)
Open the file ~/development/HelloWorld/web/WEB-INF/generated_web.xml and follow the instructions in that auto-generated file, which is: "Place this fragment in the web.xml before all icon, display-name, description, distributable, and context-param elements."
The web.xml referred to above is YOUR web.xml. In my case, it is the one in ~/development/HelloWorld/web/WEB-INF/web.xml
When ready to deploy, type:
ant dist
as usual. Deploy the .war file in the dist directory as you normally would. In my case, I do:
rm -rf $CATALINA_HOME/webapps/hello* (removes my HelloWorld webapp directory and its war file)
cp ~/development/HelloWorld/dist/hello.war $CATALINA_HOME/webapps
and wait for tomcat to unravel the war file. I can then access the JSP page based on whatever the generated_web.xml had specified. In my case, it would be http://localhost:8080/hello/sample.jsp
NON-PRECOMPILATION METHOD
Copy tools.jar from the Java JDK into tomcat's common/lib. (I found this only in the error message in tomcat's log file!! Didn't find it anywhere else!!). Do this one time only, then restart tomcat:
cp $JAVA_HOME/lib/tools.jar $CATALINA_HOME/common/lib
Restart tomcat.
Deploy your webapp as usual which will include your JSP files stored under your webapp's 'web' directory. No precompilation of JSPs is required. Then access your JSP pages such as http://localhost:8080/HelloWorld/my-jsp-page.jsp and tomcat will compile it on the fly on first access. The disadvantage is that there will be a slight delay on first access.
[Note: I am putting all this down for the record, because it took me MANY HOURS to figure all this out as the info on how to do this is not found clearly in one place!! Hope this helps others.]
My next step is to incorporate the contents of compile.xml as mentioned above, into my regular build.xml file. -
Sending emails from the JSP application
hi,
I am trying to send emails from my jsp application using JavaMail API's.
I am using my own mailserver.
Iam able to send emails from my applications to the ids of my own mailserver but not the yahoo,gmail and rediff ids.
Is it because of blocking of any firewall or somthing else to do within my application?
Can anyone help me in this?
Thanks a lot.Please read the JavaMail FAQ.
It's probably due to the configuration of your mail server,
which is refusing to relay your messages. -
Hello,
I am trying to use javamail, for sending emails and I am using NetBeans as the IDE, and IIS as the webserver.
I found a code online, from this webpage: http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
The webserver runs fine, and the code runs fine too, but the email doesnt get sent. maybe what parameters I pass are wrong, so I am attaching my code as well.
package emailexample;
import
com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingExcep
tion;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
public class Main {
public static void postMail( String recipients[ ],
String subject,
String message ,
String from) throws javax.mail.MessagingException
boolean debug = false;
//Set the host smtp address
Properties props = new Properties();
//props.put("mail.smtp.host", "localhost");
props.put("mail.smtp.host", "localhost");
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
// create a message
Message msg = new MimeMessage(session);
// set the from and to address
InternetAddress addressFrom;
try {
addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++)
addressTo[i] = new InternetAddress(recipients);
msg.setRecipients(Message.RecipientType.TO, addressTo);
// Optional : You can also set your custom headers in the Email if you Want
msg.addHeader("MyHeaderName", "myHeaderValue");
// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
} catch (AddressException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
public static void main(String[] args) {
try {
postMail(new String[]{"[email protected]"},
"testing java mail", "see it works :)",
"[email protected]");
} catch (javax.mail.MessagingException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
can someone please help?The JavaMail FAQ has tips for debugging, pointers to sample programs, and much more. Start there.
In particular, a protocol trace will help us figure out what's not working. -
Hi all, where can i get good tutorials on Java Mail. And some simple examples, to understand, I have few examples, but they are very complicated to understand.
the demos that come w/javamail i thought were pretty good (and i'm a coldfusion developer ;-). you might also look thru http://www.jguru.com/faq/subtopics.jsp?topic=JavaMail which has some example code as well as pretty good tips if you're new to javamail.
-
Re: [iPlanet-JATO] Sorting a resultset
Steve,
Todd will probably address this more, but to set the stage for the discussion,
I will chime in. As per your scenario "say a user wants to resort the results
by some other column" , I think there needs to be some clarification on the
life cycle of the model. You scenario implies that the user sees the data and
then submits a request to sort the data. This implies that the access to the
same data is spread across two HTTP requests.
Unless explicitly or implicitly stored in session, the Model is a per request
object. Therefore, under ordinary circumstances a new instance of Model is
constructed per request and populated as needed. This is done for scalability
reasons. Most applications would not scale properly if all model instances were
kept around in session per user. There is also the issue of data integrity, a
model stored in session may not reflect the current state of the RDBMS from
which the data was previously retrieved, perhaps minutes before. So, the
default action is to instantiate a new model and repopulate that model The
normal solution would be to apply the sort criteria to the data retrieval at
that point.
What I described above is the norm and the default.
If you have compelling reasons to prefer a single retrieval style, you have to
be prepared to store the Model data in session. There are several methods
within the ModelManager class which assist in this regard. You can see them
described in the java doc.
Also bear in mind that the SQLModelBase typically copies the data from the JDBC
result set into JATO specific local storage. This is done because the JDBC
result set is not as flexible as developer needs and requires the JDBC
connection to remain open while it is used.
I suspect that Todd will describe how you can manipulate the underlying JATO
specific local storage to change the order. I just wanted to make sure you
understood the life cycle issues involved and had justification for deviating
from the default.
Also, I'm still waiting for followup on the defaultCommandChild issue - we'd
like to fix it for JATO 1.2.1 if it is a problem and so far your case is the
only one we have heard of.
----- Original Message -----
From: stephen_winer
Sent: Wednesday, December 12, 2001 9:42 AM
Subject: [iPlanet-JATO] Sorting a resultset
If I want to sort a result set (Model) after the search has taken
place (say a user wants to resort the results by some other column),
can this be done without issuing another query? The reason I ask is
that the next() method in the ResultSetModelBase calls synchronizeRow
(), which resets the row, which sounds like a sort done outside of
the SQL would be reverted.
Steve
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]The hidden field was present in the page, but it looked like this:
<input type="hidden" name="jato.defaultCommand" value=""../search"">
Seems like there is a small bug in the code generating this tag.
FYI - I am using JATO1.2
What file displays this text? Maybe I can go in and fix it and rejar
it.
Steve
--- Mike Frisino wrote:
Steve,
Can you check the HTML source that shows up in the browser? Do you see an entry that looks like this at the bottom of the form in
question?
>
<input type="hidden" name="jato.defaultCommand" value="/search">
To answer your question - it should work as you described. Some of the JatoSample make use of the defaultCommandChild. Can you try
running the sample BasicSample->Field Types and let us know what you
see.
>
Failing this you can send me your jsp file , maybe there is some subtle issue there. michael.frisino@s...
>
>
----- Original Message -----
From: stephen_winer
Sent: Friday, December 07, 2001 8:05 AM
Subject: [iPlanet-JATO] Using the defaultCommandChild in a form
I am trying to set the defaultCommandChild in my jato:form tag to be
the searcg button. The search button definition is:
<jato:button name="search"/>.
The form tag definition is:
<jato:form name="PendingIA" defaultCommandChild="/search">
Clicking on the search button works fine, but hitting return in one
of the textFields (which submits the form) passes a value of "" to
the createChild method in my viewBean, which throws an error. Why
does this not just work as normal and trigger the handleSearchRequest
() method?
Steve
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
>
>
>
[Non-text portions of this message have been removed] -
RE: [iPlanet-JATO] Re: Use Of models in utility classes
Hi all,
if you add the following to your spider2jato.xml
It will automatically map your CSpDataObject.executeImmediate to use
ExecuteImmediateUtil.executeImmediateSelect with the arguments mapped as
well.
Kostas
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[ExecuteImmediateUtil.executeImmediateSelect($1,$2,
getRequestContext())]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
-----Original Message-----
From: Matthew Stevens
Cc: vnamboori@y...
Sent: 11/29/01 11:23 AM
Subject: RE: [iPlanet-JATO] Re: Use Of models in utility classes
Namburi,
I have included an example in the file ExecuteImmediateUtil.java
The Yahoo Group will not handle the attached file we will put it in the
Files section shortly.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
Sent: Thursday, November 29, 2001 12:29 PM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes
Matt,
For CSpSelect.executeImmediate() I have an example of custom helpermethod as a replacement which uses JDBC results instead of
CSpDBResult.
Can you send me this example.
Thanks
Namburi
--- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
wrote:
Namburi,
I will post a document to the group site this evening which has thedetails
on various tactics of migrating these type of utilities.Essentially, you
either need to convert these utilities to Models themselves or keepthe
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of custom helpermethod
as a replacement whicch uses JDBC results instead of CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes. These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do the
manipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion for these
utilities we have to do manually.
My question is Can we access the the models in the post migration
sameway or do we need requestContext?
We have lots of utility classes which are DataObject intensive.Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]Hi all,
if you add the following to your spider2jato.xml
It will automatically map your CSpDataObject.executeImmediate to use
ExecuteImmediateUtil.executeImmediateSelect with the arguments mapped as
well.
Kostas
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[ExecuteImmediateUtil.executeImmediateSelect($1,$2,
getRequestContext())]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
-----Original Message-----
From: Matthew Stevens
Cc: vnamboori@y...
Sent: 11/29/01 11:23 AM
Subject: RE: [iPlanet-JATO] Re: Use Of models in utility classes
Namburi,
I have included an example in the file ExecuteImmediateUtil.java
The Yahoo Group will not handle the attached file we will put it in the
Files section shortly.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
Sent: Thursday, November 29, 2001 12:29 PM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes
Matt,
For CSpSelect.executeImmediate() I have an example of custom helpermethod as a replacement which uses JDBC results instead of
CSpDBResult.
Can you send me this example.
Thanks
Namburi
--- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
wrote:
Namburi,
I will post a document to the group site this evening which has thedetails
on various tactics of migrating these type of utilities.Essentially, you
either need to convert these utilities to Models themselves or keepthe
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of custom helpermethod
as a replacement whicch uses JDBC results instead of CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes. These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do the
manipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion for these
utilities we have to do manually.
My question is Can we access the the models in the post migration
sameway or do we need requestContext?
We have lots of utility classes which are DataObject intensive.Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed] -
Re: [iPlanet-JATO] Transaction in JATO
Jeff--
I have one thing to add. You can obtain a JDBC Connection in several ways.
First is to simply use a JNDI lookup on your own, as you would in any J2EE
application. The second it to use JATO's SQLConnectionManager (available in
the RequestContext), which provides some additional convenience by
interposing a level of datasource mapping indirection (see docs). Third,
you can obtain the connection that any given QueryModel would use by
default by calling its "getDefaultConnection()" method. This saves you from
worrying at all about the JDBC datasource name used to obtain the
connection.
Any one of these three techniques is perfectly fine; choose the one that
makes sense for the maintainability of the application in the long run.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@s...
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@s...>
Sent: Wednesday, October 24, 2001 1:25 PM
Subject: Re: [iPlanet-JATO] Transaction in JATO
Jeff,
See the javadoc for DatasetSQLModelExecutionContext. It may seem a bitcounterintuitive, since for updates and inserts you do not need the full
dataset capability, but you don't use what you don't need.
>
In your case, what you do want to take advantage of is the ability tocontrol the "JDBC Connection" directly. Therein lies the transactional
control that you are looking for. NetD needed to rely on something like the
CSpTransaction class precisely because it did not allow developers direct
access to the JDBC Connection. That is no longer a restriction in JATO,
hence, there is no equivalent to CSpTransaction per se.
>
>
public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext
An execution context used to execute dataset operations on QueryModels(normally SQL SELECT operations). Developers can specify both the dataset
offset and size, as well as a JDBC connection or statement object, to be
used during execution of the model.
>
By providing a connection or statement object to the model via thiscontext, developers can maintain control of the transaction state of the
connection instead of relying on the default behavior (which is generally
equivalent to auto-commit semantics). However, such use also introduces a
measure of responsibilty on the developer--because providing these objects
to the model manually causes the model to avoid any connection lifecycle
management of its own, the developer is completely responsible for managing
the lifecycle of the connection, as well as the lifecycle of any
transactions that might be pending on that connection.
>
In general, if the developer supplies a connection object, he or she neednot also supply a statement object. Conversely, if the developer supplies a
statement object, he or she need not specify a connection object (though he
will need to keep a reference to the connection object used to create the
statement in order to close it after execution is complete). In both cases,
the developer is ultimately responsible for releasing the connection
manually when use of it is complete.
>
----- Original Message -----
From: jeffrey_smith@p...
Sent: Wednesday, October 24, 2001 12:52 PM
Subject: [iPlanet-JATO] Transaction in JATO
Does anyone have an example on how to do multiple updates/inserts using
various models in one transaction in JATO1.2. I am trying to migrate ND
code that uses a CSpTransaction object to do this and there does notappear
to be an equivalent object in JATO.
Thanks.
Jeff Smith
Senior Application Consultant
Software Engineering
Putnam Investments
voice: (617)760-3121
fax: (617)760-3850
Choose from 1000s of job listings!
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspJeff--
I have one thing to add. You can obtain a JDBC Connection in several ways.
First is to simply use a JNDI lookup on your own, as you would in any J2EE
application. The second it to use JATO's SQLConnectionManager (available in
the RequestContext), which provides some additional convenience by
interposing a level of datasource mapping indirection (see docs). Third,
you can obtain the connection that any given QueryModel would use by
default by calling its "getDefaultConnection()" method. This saves you from
worrying at all about the JDBC datasource name used to obtain the
connection.
Any one of these three techniques is perfectly fine; choose the one that
makes sense for the maintainability of the application in the long run.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@s...
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@s...>
Sent: Wednesday, October 24, 2001 1:25 PM
Subject: Re: [iPlanet-JATO] Transaction in JATO
Jeff,
See the javadoc for DatasetSQLModelExecutionContext. It may seem a bitcounterintuitive, since for updates and inserts you do not need the full
dataset capability, but you don't use what you don't need.
>
In your case, what you do want to take advantage of is the ability tocontrol the "JDBC Connection" directly. Therein lies the transactional
control that you are looking for. NetD needed to rely on something like the
CSpTransaction class precisely because it did not allow developers direct
access to the JDBC Connection. That is no longer a restriction in JATO,
hence, there is no equivalent to CSpTransaction per se.
>
>
public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext
An execution context used to execute dataset operations on QueryModels(normally SQL SELECT operations). Developers can specify both the dataset
offset and size, as well as a JDBC connection or statement object, to be
used during execution of the model.
>
By providing a connection or statement object to the model via thiscontext, developers can maintain control of the transaction state of the
connection instead of relying on the default behavior (which is generally
equivalent to auto-commit semantics). However, such use also introduces a
measure of responsibilty on the developer--because providing these objects
to the model manually causes the model to avoid any connection lifecycle
management of its own, the developer is completely responsible for managing
the lifecycle of the connection, as well as the lifecycle of any
transactions that might be pending on that connection.
>
In general, if the developer supplies a connection object, he or she neednot also supply a statement object. Conversely, if the developer supplies a
statement object, he or she need not specify a connection object (though he
will need to keep a reference to the connection object used to create the
statement in order to close it after execution is complete). In both cases,
the developer is ultimately responsible for releasing the connection
manually when use of it is complete.
>
----- Original Message -----
From: jeffrey_smith@p...
Sent: Wednesday, October 24, 2001 12:52 PM
Subject: [iPlanet-JATO] Transaction in JATO
Does anyone have an example on how to do multiple updates/inserts using
various models in one transaction in JATO1.2. I am trying to migrate ND
code that uses a CSpTransaction object to do this and there does notappear
to be an equivalent object in JATO.
Thanks.
Jeff Smith
Senior Application Consultant
Software Engineering
Putnam Investments
voice: (617)760-3121
fax: (617)760-3850
Choose from 1000s of job listings!
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
Re: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & & onSessionTimeoutEvent
My mistake. Thanks for the clarification, Craig.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@s...>
Sent: Friday, January 04, 2002 11:14 AM
Subject: Re: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & &
onSessionTimeoutEvent
Alex,
In addition to Todd saying that the ND security object "is nothing morethan a
sessionable object...", remember that the security object did nothing morethan
retrieve the user profile from some persistent store: a database or athird party
API. So the security object was just a very specialized model (a dataobject in ND
terms, of course), although it need not be a model, it could just be anarbitrary
Java class, whatever works best.
Once the security object was triggered to perform a user profile lookup,the
profile was stored in an instance of CSpUserProfile and kept in the user's
session. The project object was then the object that was responsible forchecking
the user profile for privileges, previous pages, and db logins and such.As Todd
explained, the ViewBean API now does the security check (as opposed toJATO's
module servlet, or ND's project object), so extending ViewBeanBase andoverriding
securityCheck is a convenient way to mimic ND's security hooks. You couldeven
override a method or event in the module servlet to do a lookup if youwant a
greater parallel to ND, but this is unneccessary. Either way, the securitycheck
is performed before the "page" is "loaded".
c
Todd Fast wrote:
Agreed. This is partly why we have never added such a feature to JATO
(though we've talked about it many many times), because it seemed too
prescriptive and possibly at odds with the other solutions people favor.
We're still on the fence. We want to add it, but feel it'll take a fair
bit
of design to do properly and extensibly.
However, realize that the ND security object is nothing more than a
sessionable object with slots for username, password, and priveleges.This
is almost trivially easy to replicate on your own, with a small additionof
code to automatically handle lifecycle and security checking. It wouldbe
extremely easy to create a subclass of ViewBeanBase that would overridethe
securityCheck() method to check the state of a sessioned "user profile"
object. Add to the ViewBean a declared set of "privelege" strings, andyou
can check the profile object against those required.
I feel I'm being unclear--do you see where I'm going?
Todd
----- Original Message -----
From: "njdoe123" <first.us@a...>
Sent: Friday, December 28, 2001 6:44 AM
Subject: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & &
onSessionTimeoutEvent
Hi,
We used a lot of "security object" in netD projects. Each used
username, password and privilege for login. After migration,
we have to hand code all login codes manually. Session control
is pretty standard in j2ee, i'm wondering whether there is a
best practice example available for netD login feature.
Since security was one of the outstanding feature in netD, it will
be a great idea to have a stadard plugin to support this feature
after migration. I wish v1.2 could supply a direction, although
there are several login methods in j2ee.
Thanks,
Alex Lin
--- In iPlanet-JATO@y..., "Todd Fast" <todd.fast@s...> wrote:
Small correction: the name of the method in ViewBean is"securityCheck()",
not "onSecurityCheck()". The method would've been better named
"checkSecurity()", but too late now. <grin>
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@s...>
Sent: Monday, December 17, 2001 12:47 PM
Subject: Re: [iPlanet-JATO] onSecurityCheckFailedEvent & &
onSessionTimeoutEvent
The iMT has a ND to JATO/J2EE mapping document that covers ND
events and
common ND class/variable/method mapping.
To answer you two questions below:
onSessionTimoutEvent is onSessionTimeout in JATO and can beoverriden in
any class the subclasses JATO'scom.iplanet.jato.ApplicationServletBase.
Typically, this is done in you application servlet class which allof
your module servlets in the application will subclass.
onSecurityCheckFailedEvent is an ND specific event that istriggered
when a Security exception is thrown in ND. In JATO, a
SecurityCheckException is thrown when the default securitychecking in
JATO fails. JATO's default security is to make sure theRequestContext
object is not null. This is done in the ViewBean API. The
onSecurityCheck event in JATO allows you to hook into thisbehavior and
write your own security checking, or hook in a third party API.You can
call super so that you still get the RequextContext null check.
You should create a "non-visual" ViewBean (behavior only) thatoverrides
the onSecurityCheck event, and all other ViewBeans in yourapplication
extend it to inherit this security checking behavior.
You could also hook in the security in your application Servlet by
overriding one of the events in ApplicationServletBase, like
onBeforeRequest.
craig
njdoe123 wrote:
Hi,
We have the following two events (onSecurityCheckFailedEvent
& onSessionTimeoutEvent) across all ND projects. I guess
it's pretty common for netdynamics project.
How do you solve the corresponding issues in j2ee ?
Is there any example available ?
Thanks,
Alex
//[[SPIDER_EVENT<this_onSecurityCheckFailedEvent>
public int this_onSecurityCheckFailedEvent
(CSpProjectSecurityEvent event)
switch (event.getFailureType() )
case NEW_SECURITY_CHECK_PRIV_FAILURE_TYPE:
// do something
CSpPage loginPage1 = CSpider.getPage("PgLogin");
CSpString msg1 = new CSpString("Wrong District Code, UserID
or
Password. Try again.");
loginPage1.setDisplayFieldValue("StMsg1", msg1);
loginPage1.load (false);
break;
case SESSION_CONTINUITY_FAILURE_TYPE:
// do something else
CSpPage loginPage2 = CSpider.getPage("PgLogin");
CSpString msg2 = new CSpString("You must login first...");
loginPage2.setDisplayFieldValue("StMsg1", msg2);
loginPage2.load (false);
break;
return (STOP);
//]]SPIDER_EVENT<this_onSecurityCheckFailedEvent>
//[[SPIDER_EVENT<this_onSessionTimeoutEvent>
public int this_onSessionTimeoutEvent(CSpProjectSessionEventevent)
CSpString msg3 = new CSpString("You were gone too long - login
again");
CSpPage loginPage3 = CSpider.getPage("PgLogin");
loginPage3.setDisplayFieldValue("StMsg1", msg3);
// stop any further processing of this original user request
loginPage3.setDisplayFieldValue("District_ID", newCSpString(""));
loginPage3.setDisplayFieldValue("User_ID", new CSpString(""));
loginPage3.setDisplayFieldValue("Password", newCSpString(""));
loginPage3.load (false);
return (PROCEED);
//]]SPIDER_EVENT<this_onSessionTimeoutEvent>
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
For more information about JATO, including download information,
please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jspThank you - Jin and Todd.
Will try that.
Atul
--- In iPlanet-JATO@y..., Byung Jin Chun <bchun@n...> wrote:
try using kregedit and modify the key for the jvm args, using the -x
parameters for the 1.2 runtime
Jin
-----Original Message-----
From: Todd Fast [mailto:<a href="/group/SunONE-JATO/post?protectID=101233080150035167169232031248066208071048">Todd.Fast@S...</a>]
Sent: Tuesday, February 19, 2002 8:40 PM
Subject: Re: [iPlanet-JATO] Re: OutOfMemoryError
Atul--
Out of curiosity - How do you modify the memory parameters for
the container's VM ?? I know I should try to do some research but
figured you may already have some insight and willingness to
share.
Please consider this as low priority.It differs by container; I don't remember details of any particular one.
>
Todd
For more information about JATO, including download information, please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
<http://developer.iplanet.com/tech/appserver/framework/index.jsp>
[Non-text portions of this message have been removed] -
Re: [iPlanet-JATO] Double Trouble
Looks like the attachment will not be inlined by egroup's mailer so here is
the table i was trying to send before:
Current Type mapping (appologies for lousy formatting)
ND ColumnDataType DATA_FIELD_TYPE_MAP
DATA_FIELD_SQL_TYPE_MAP
NO_TYPE String
java.sql.Types.VARCHAR
CHAR_TYPE String
java.sql.Types.CHAR
UNSIGNED_CHAR_TYPE String
java.sql.Types.CHAR
TINY_TYPE Short
java.sql.Types.SMALLINT
UNSIGNED_TINY_TYPE Short
java.sql.Types.SMALLINT
SHORT_TYPE Short
java.sql.Types.SMALLINT
UNSIGNED_SHORT_TYPE Short
java.sql.Types.SMALLINT
INT_TYPE Integer
java.sql.Types.INTEGER
UNSIGNED_INT_TYPE Integer
java.sql.Types.INTEGER
LONG_TYPE Long
java.sql.Types.BIGINT
UNSIGNED_LONG_TYPE Long
java.sql.Types.BIGINT
FLOAT_TYPE Float
java.sql.Types.FLOAT
DOUBLE_TYPE Double
java.sql.Types.DOUBLE
DECIMAL_TYPE java.math.BigDecimal
java.sql.Types.DECIMAL
DATE_TYPE java.sql.Date
java.sql.Types.DATE
DATETIME_TYPE java.sql.Timestamp
java.sql.Types.TIMESTAMP
DURATION_TYPE DONT_KNOW_CLASS_TYPE
DONT_KNOW_CLASS_TYPE
STRING_TYPE String
java.sql.Types.VARCHAR
BLOB_TYPE Object
java.sql.Types.BLOB
UNQUOTED_STRING_TYPE DONT_KNOW_CLASS_TYPE DONT_KNOW_CLASS_TYPE
BOOLEAN_TYPE Boolean
java.sql.Types.BINARY
USER_DEFINED_TYPE DONT_KNOW_CLASS_TYPE
java.sql.Types.JAVA_OBJECT
Translation Tool Type Mapping Structures
The current code generation structures that are responsible for supporting
these type mappings at translation times are as follows:
CodeGeneration.DATA_FIELD_TYPE_MAP
The map is constructed from two arrays:
CodeGeneration. ND_DATA_FIELD_DATA_TYPES
CodeGeneration. MIGRATION_MODEL_DATA_TYPES
CodeGeneration. DATA_FIELD_SQL_TYPE_MAP
The map is constructed from two arrays:
CodeGeneration. ND_DATA_FIELD_DATA_TYPES
CodeGeneration. MIGRATION_MODEL_DATA_TYPES
JATO Type Values
The following JATO field values or member types are generated at translation
time based on the type mappings:
Model Field typing
Model.member field type - drawn from CodeGeneration .DATA_FIELD_TYPE_MAP
Descriptor typing
QueryFieldDescriptor.fieldClass
- drawn from CodeGeneration .DATA_FIELD_TYPE_MAP
StoredProcParameterDescriptor.fieldClass
- drawn from CodeGeneration .DATA_FIELD_TYPE_MAP
StoredProcParameterDescriptor.sqlType
- drawn from CodeGeneration.DATA_FIELD_SQL_TYPE_MAP
----- Original Message -----
From: Mike Frisino <Michael.Frisino@S...>
Sent: Thursday, January 04, 2001 12:19 PM
Subject: Re: [iPlanet-JATO] Double Trouble
Thanks John,
Can you provide some more information that would help resolve this issue.
It could be that the mapping rules we use during the translation need tobe
adjusted.
Specifically, what were the following ND property values you had for the
field in question:
ND Datafield property "ColumnDataType"
ND Datafield property "ColumnDataTypeText"
ND Datafield property "NativeType"
ND Datafield property "NativeTypeText"
You see, during the translation we had to choose to map from the originalND
type information to a corresponding java or java.sql type.
We were not certain whether to favor ND's "ColumnDataType" or ND's
"NativeType" value.
We came up with rules based on mapping ND's ColumnDataType. Those rulesare
detailed in the attachment.
----- Original Message -----
From: <john.teceno@b...>
Sent: Thursday, January 04, 2001 7:33 AM
Subject: [iPlanet-JATO] Double Trouble
Hey Guys,
I've run across a problem retrieving Doubles back from an Oracle
Database. The field is defined as a Number. When we converted the
program from NetD, it was created with return values of Double. What
is returned is not the correct value. For example, in the table the
value is 123456, when I do a getInternalID(), it is returning 2.0. I
am working on a work around, but I thought that I would post this
anyway.
John Teceno
Back Bay Technologies
[email protected]
[Non-text portions of this message have been removed]
[email protected]Thank you - Jin and Todd.
Will try that.
Atul
--- In iPlanet-JATO@y..., Byung Jin Chun <bchun@n...> wrote:
try using kregedit and modify the key for the jvm args, using the -x
parameters for the 1.2 runtime
Jin
-----Original Message-----
From: Todd Fast [mailto:<a href="/group/SunONE-JATO/post?protectID=101233080150035167169232031248066208071048">Todd.Fast@S...</a>]
Sent: Tuesday, February 19, 2002 8:40 PM
Subject: Re: [iPlanet-JATO] Re: OutOfMemoryError
Atul--
Out of curiosity - How do you modify the memory parameters for
the container's VM ?? I know I should try to do some research but
figured you may already have some insight and willingness to
share.
Please consider this as low priority.It differs by container; I don't remember details of any particular one.
>
Todd
For more information about JATO, including download information, please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
<http://developer.iplanet.com/tech/appserver/framework/index.jsp>
[Non-text portions of this message have been removed] -
Re: [iPlanet-JATO] Re: CSpMultiSQL after migration
Alex,
I just switched over to Netscape Messenger from OutLook and I didn't
realize that emails were displayed in threaded hierarchies and therefore
did not see that you had already had responses to your post. Sorry for
the confusion in my previous response.
matt
njdoe123 wrote:
Hi,
I have tested another simple MultiSQL. The Update, Delete, Insert
are not funcitonal. I'm using only one single database table (no
join). It worked great in netD. The database is Oracle.
We're using migtoolbox-1.1.1 with Jato 1.1. Do we have to modify
the UpdataQueryModel.java file or other ? Or could i use jato 1.2
to replace 1.1 ?
The following is log from AppServer. Could i receive the migtool
1.2 beta ?
Thanks,
Alex Lin
<Dec 21, 2001 11:18:36 AM PST> <Error> <HTTP> <[WebAppServletContext
(1572805,Tes
t3AppWar,/Test3AppWar)] Root cause of ServletException
com.iplanet.jato.model.ModelControlException
java.sql.SQLException: ORA-00933: SQL command not properly ended
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7
(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
(TTC7Protocol.java:822
at oracle.jdbc.driver.OracleStatement.executeNonQuery
(OracleStatement.ja
va:1446)
at oracle.jdbc.driver.OracleStatement.doExecuteOther
(OracleStatement.jav
a:1371)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout
(OracleStateme
nt.java:1900)
at oracle.jdbc.driver.OracleStatement.executeUpdate
(OracleStatement.java
:693)
at com.iplanet.jato.model.sql.QueryModelBase.executeUpdate
(QueryModelBas
e.java:1788)
at com.iplanet.jato.model.sql.QueryModelBase.update
(QueryModelBase.java:
420)
at
com.iplanet.jato.view.RequestHandlingViewBase.executeAutoUpdatingMode
l(RequestHandlingViewBase.java:1070)
at
com.iplanet.jato.view.RequestHandlingViewBase.executeAutoUpdatingMode
ls(RequestHandlingViewBase.java:938)
at
com.iplanet.jato.view.RequestHandlingViewBase.handleWebAction(Request
HandlingViewBase.java:821)
at Test3App.Test3.PgUpdateViewBean.handleUpdateRequest
(PgUpdateViewBean.
java:838)
at java.lang.reflect.Method.invoke(Native Method)
at com.iplanet.jato.view.RequestHandlingViewBase.handleRequest
(RequestHa
ndlingViewBase.java:341)
at
com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewB
eanBase.java:481)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandler
(ViewBeanBase.
java:431)
at com.iplanet.jato.ApplicationServletBase.dispatchRequest
(ApplicationSe
rvletBase.java:645)
at com.iplanet.jato.ApplicationServletBase.processRequest
(ApplicationSer
vletBase.java:431)
at com.iplanet.jato.ApplicationServletBase.doPost
(ApplicationServletBase
.java:296)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet
(ServletStubIm
pl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet
(ServletStubIm
pl.java:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2456)
at weblogic.servlet.internal.ServletRequestImpl.execute
(ServletRequestIm
pl.java:2039)
at weblogic.kernel.ExecuteThread.execute
(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run
(ExecuteThread.java:120)
--- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
wrote:
EDITED
-----Original Message-----
From: Matthew Stevens [mailto:<a href="/group/SunONE-JATO/post?protectID=029166114165042198028082000056130080177026031196061130152150">matthew.stevens@e...</a>]
Sent: Thursday, December 20, 2001 4:32 PM
Alex,
If your implied question is, "Looks like the iMT did not migrate
this block
of code. What is my next step?" Then I have an answer for you. If
I
misinterpreted your email then please clarify.
The procedure for ND migration using the iMT (as outlined in the
documentation
under <iMT_install_dir>/docs) is that customized code originally
provided by
the ND developer is purposely commented out so that the file can
compile.
Our experience in migration efforts shows that it is preferrable to
the
migrator to be able to select which part of the application they
want to
work
on by uncommenting specific blocks of code - allowing for
incremental
edit/compile/test cycles. If we left all this arbitary code un-
commented,
then nothing would compile after migration and you would have a huge
roadblock for moving forward.
Judging from the "spider" APIs which are still seen in your code
block, you
must not have run the Regular Expression API mapping tool which
will take
care of many of this code. I believe that the API mapper will
migrate this
block of code almost 100% and you just need to uncomment it.
matt
-----Original Message-----
From: njdoe123 [mailto:<a href="/group/SunONE-JATO/post?protectID=230176091112175091130232203140129208071">first.us@a...</a>]
Sent: Thursday, December 20, 2001 4:04 PM
Subject: [iPlanet-JATO] Re: CSpMultiSQL after migration
Oops !
The following (very simple) customized code was not migrated.
In business logic - after update, goto another page.
My backend database is Oracle.
Thanks.
Alex Lin
-------------------------+
// The following code block was migrated from the Update_onWebEvent
method
// MigrationToDo : THIS CODE MUST BE MANUALLY ADJUSTED
int command = PROCEED;
CSpPage nextPage =(CSpPage) CSpider.getPage("PgDistrict");
executeAllUpdatingDataObjects();
return nextPage.load();
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
Alex,
CSpMultiSQL migrate just fine. You may have had to do something
extraordinary for your
particular database in your select statement.
Can we see the entire exception stack trace, and the code that is
executing the model?
Also, what database are you hitting?
c
njdoe123 wrote:
Hi,
It's a bit strange while doing CSpMultiSQL (select and update).
I have received the following error on the AppServer.
Web event invoked: Test3App.Test3.PgWebUserViewBean.Update
<Dec 19, 2001 2:20:05 PM PST> <Error> <HTTP>
<[WebAppServletContext(168087,Test3
AppWar,/Test3AppWar)] Root cause of ServletException
com.iplanet.jato.model.ModelControlException
java.sql.SQLException: ORA-00933: SQL command not properly ended
'SQL command not properly ended ?' - i haven't touched the sql
code,
it's just simple select and update to one table.
Could iMT do MultiSQL ? If not, what is the solution after
migration
Thanks,
Alex Lin
For more information about JATO, including download information,
please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information,
please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information,
please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspThank you - Jin and Todd.
Will try that.
Atul
--- In iPlanet-JATO@y..., Byung Jin Chun <bchun@n...> wrote:
try using kregedit and modify the key for the jvm args, using the -x
parameters for the 1.2 runtime
Jin
-----Original Message-----
From: Todd Fast [mailto:<a href="/group/SunONE-JATO/post?protectID=101233080150035167169232031248066208071048">Todd.Fast@S...</a>]
Sent: Tuesday, February 19, 2002 8:40 PM
Subject: Re: [iPlanet-JATO] Re: OutOfMemoryError
Atul--
Out of curiosity - How do you modify the memory parameters for
the container's VM ?? I know I should try to do some research but
figured you may already have some insight and willingness to
share.
Please consider this as low priority.It differs by container; I don't remember details of any particular one.
>
Todd
For more information about JATO, including download information, please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
<http://developer.iplanet.com/tech/appserver/framework/index.jsp>
[Non-text portions of this message have been removed] -
I am currently working on a project in which I use a form (enctype=multipart/form-data) for the user to select a file to upload. I have written all of the code to upload the file (which works correctly) and am using the com.oreilly.servlet package to process the multipart request. My problem, though, is that I can only upload files from my C: drive and even then only from the top level directory. I cannot upload any files from subdirectories of the c: drive or from my network drive -- I just get a FileNotFound error. It seems like this must be a simple problem, what am I missing?
I am using tomcat 4.0.3 installed at c:\tomcatdir
--NicoleAlso, if someone else accesses my app via 'http://localhost:8080/upload/fileUpload.jsp', none of their files can be uploaded because a FileNotFound error is thrown.
I would really appreciate input anyone might have...
--Nicole -
Cannot Upload a file from local system
Hi,
I am trying to send an email with an attachment from an JSP form using javamail in a STRUTS action class.
I uploaded the JSP form and action class to my web server (Unix with JBOSS) and now the email is not sent and I receive the following error
javax.mail.MessagingException: IOException while sending message;
nested exception is:
java.io.FileNotFoundException: testFile.txt (No such file or directory)
I am assuming that there is something different about the way my web server handles file attachments but I can't find any information about how to fix the problem. When i sent a blank msg without any attachment it is working fine.
Any help is greatly appreciated.
Following is the code that i wrote in Action class to upload an attachment
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(dataFile.toString());
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(dataFile.getFileName());
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
Transport transport = session.getTransport("smtp");
transport.connect("host", port,"null","null");
if(transport.isConnected())
transport.sendMessage(msg, new Address[] {new InternetAddress(from));
}Thanks
Dinesh.DrClap is right about using the correct pathname to the file, but...
At any
rate, rather than leaving this to chance, just give
the complete path name of the file to the data
handler:messageBodyPart.setFileName(dataFile.getAbsolutePath());
Don't do this. The absolute path to the file on your system will mean nothing
on the system that receives this message.
What you need to do is give the correct, perhaps full, pathname to FileDataSource
that names the file on your server.
Maybe you are looking for
-
Trying to BLOB data from a 8idb to another 9i db using db link
Hi, I am trying to move a custom table in a 8i database with a BLOB column to another oracle 9i database using a database link and I am getting the following error, ORA-22992: cannot use LOB locators selected from remote tables. Any pointers as to ho
-
How much storage space does OS take out of the box on a 16G model?
-
When trying to back up to icloud from phone, have followed instructions but there is no option to select the tick box for mail, contacts, calendars and tasks. It just refers me to the icloud. When I go to the cloud, the only thing that's backed up is
-
SAP CRM: Funds Management
Hi I have managed to setup the following: Funds Plan Funds Funds Usage WBS in ECC Purchase / Service in CRM creating Purchase req in ECC I have now activated the RCRM_MKTPL_PURCH_ACTUAL_ERP. I am getting the following information message in the log:
-
I am considering Aperture, mainly because I'm not sure if PhotoShop Elements 6, which i normally use, will be as good when its Mac version appears. There is one aspect of PhotoShop I use a lot which aperture does not seem to have. This is the ability