Use Sun Appserver JavaMail Session from JSC

I can send email using the procedure outlined in the "Sending Email From a Web Application" tutorial but it seemed sensible to use the facilities provided by the Application Server to store the details. In addition, the tutorial I found on the topic made it look easy. However, it seems that the code I found must be packaged in an EJB and I don't want to go there. Is there a way of finding and using a JavaMail session directly from the Page Bean generated by JSC?

Did you take a look at
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/email.html
- Winston
http://blogs.sun.com/roller/page/winston?catname=Creator

Similar Messages

  • ClassCastException on Deploy to Sun Appserver 8.1 from Netbeans 4.1

    I am working with an academic group that has chosen to use the Netbeans 4.1/Sun Appserver 8.1 integrated combo. We are running a standard ejb app and a standard web app (java servlets, Struts flavor) that talks to the ejb app.
    But the Sun Appserver is incredibly unstable with regard to the web container. If the problem is really Sun's, I can't believe
    that they released something such as this. We get a ClassCastException related to jsp configuration everytime we
    'deploy' from Netbeans to the web container.
    And sometimes, the ejb container seems to just "disappear" from our runtime execution. In this situation, the web container gets no data from the ejb container, so that the form fields in the result html show up empty. Could the ClassCastException at deployment time be the problem? If not, what can we do to stabilize our deployment?
    I've posted the error with system info below. Any help or ideas would be much appreciated. Thank you in advance!
    [ o/s: Windows XP sp2 ]
    [ jdk: 1.4.02 ]
    [ Sun Appserver 8.1 ]
    [ Netbeans 4.1 with 'deploy' command running ]
    [ Netbeans deploying a standard ejb app and a standard web app, Struts
    1.2 flavor ]
    [ Error message: ]
    Redeploying
    C:\CMU\AdvancedProject\Develop�ment\se-2004-spring-pt-advance�d-team2\PETv3_Struts\dist\PETv�3_Struts.war
    java.lang.ClassCastException
    at
    org.netbeans.modules.j2ee.sun.�dd.impl.web.model_2_4_1.SunWeb�App.setJspConfig(SunWebApp.jav�a:850)
    at
    org.netbeans.modules.j2ee.sun.�dd.impl.web.SunWebAppProxy.set�JspConfig(SunWebAppProxy.java:�342)
    at
    org.netbeans.modules.j2ee.sun.�share.configBean.WebAppRoot$1.�getDDSnippet(WebAppRoot.java:3�01)
    at
    org.netbeans.modules.j2ee.sun.�share.configBean.Base.addToGra�phs(Base.java:625)
    at
    org.netbeans.modules.j2ee.sun.�share.configBean.SunONEDeploym�entConfiguration.saveDConfigBe�an(SunONEDeploymentConfigurati�on.java:349)
    at
    org.netbeans.modules.j2ee.sun.�share.configBean.SunONEDeploym�entConfiguration.save(SunONEDe�ploymentConfiguration.java:317�)
    at
    org.netbeans.modules.j2ee.depl�oyment.config.ConfigSupportImp�l.getDeploymentPlanFileForDist�ribution(ConfigSupportImpl.jav�a:248)
    at
    org.netbeans.modules.j2ee.depl�oyment.config.ConfigSupportImp�l.getConfigurationFile(ConfigS�upportImpl.java:224)
    at
    org.netbeans.modules.j2ee.depl�oyment.impl.projects.Deploymen�tTargetImpl.getConfigurationFi�le(DeploymentTargetImpl.java:1�80)
    at
    org.netbeans.modules.j2ee.depl�oyment.impl.TargetServer.deplo�y(TargetServer.java:615)
    at
    org.netbeans.modules.j2ee.depl�oyment.devmodules.api.Deployme�nt.deploy(Deployment.java:129)
    at org.netbeans.modules.j2ee.ant.�Deploy.execute(Deploy.java:62)
    at org.apache.tools.ant.UnknownEl�ement.execute(UnknownElement.j�ava:275)
    at org.apache.tools.ant.Task.perf�orm(Task.java:364)
    at org.apache.tools.ant.Target.ex�ecute(Target.java:341)
    at org.apache.tools.ant.Target.pe�rformTasks(Target.java:369)
    at org.apache.tools.ant.Project.e�xecuteTarget(Project.java:1214�)
    at org.apache.tools.ant.Project.e�xecuteTargets(Project.java:106�2)
    at
    org.apache.tools.ant.module.br�idge.impl.BridgeImpl.run(Bridg�eImpl.java:234)
    at
    org.apache.tools.ant.module.ru�n.TargetExecutor.run(TargetExe�cutor.java:242)
    at
    org.netbeans.core.execution.Ru�nClassThread.run(RunClassThrea�d.java:125)
    Start registering the project's server resources
    Finished registering server resources

    Thanks for your post!
    I have been meaning to reply to this for so long that I have forgotten the exact details of how we fixed this. However, the issue with the ejb container 'disappearing' at random times during application operation was resolved by doing something different in the ejb container. As I recall, the ejb code that we had when the problem existed should not have caused this kind of problem, but we found a work-around.
    The 'ClassCastException' on deploy was apparently due to a problem with the portability of Netbeans Java code. Space characters in file paths appear to have caused this problem.

  • Using sun-appserv-deploy without asant

    Hello,
    I want to use the sun-appserv-deploy ant task without having to use asant.
    I've got the following taskdefs:
      <taskdef name="sun-appserv-deploy"
               classpathref="sunone.classpath"
               classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask"
      />
      <taskdef name="sun-appserv-undeploy"
               classpathref="sunone.classpath"
               classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.UndeployTask"
      />
      <taskdef name="sun-appserv-admin"
               classpathref="sunone.classpath"
               classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask"
      />Running the following target with these I get the following error:
    target:<target name="sunone-deploy">
        <sun-appserv-deploy
          precompilejsp="${sunone.precompilejsp}"
          verify="${sunone.verify}"
          upload="${sunone.upload}"
          force="${sunone.force}">
            <server
              host="${sunone.host}"
              port="${sunone.port}"
              user="${sunone.user}"
              password="${sunone.password}"
              instance="${sunone.instance}"
            />
          <component file="${component.file}"/>
        </sun-appserv-deploy>
      </target>error:build.xml:34: A Sun Java System Application Server 8 admin CLI class could not be found (com.s
    un.enterprise.cli.framework.InputsAndOutputs).  Use the asinstalldir attribute, set the asinstall.dir property, or add t
    he appropriate JARs to the classpath.So I've added the asinstalldir property to to the script as follows but I still get the error.
    <sun-appserv-deploy
          precompilejsp="${sunone.precompilejsp}"
          verify="${sunone.verify}"
          upload="${sunone.upload}"
          force="${sunone.force}"
          asinstalldir="${sunone.home}">

    Why don't you try out the other two suggestions in the error message? Setting the server classpath should work!

  • Using Sun Appserver 7 deploy tool to package 2 ejbs and their clients

    I have a question on how to package two beans into one distributable jar file and also provide the two associated test clients - each in its own jar file. Any help or suggestions would be very much appreciated. This is what I'm trying to do:
    I am using the deploy tool that is packaged with Sun One Application Server 8.2. I currently have two stateless session beans deployed to a J2EE 1.4 Sun One Application Server and a test application client for each bean. For each bean, I created a j2ee application (ear) file and packaged the EJB JAR file containing the bean's classes and deployment descriptor, and an application client. I followed the steps as outlined in Sun�s ConverterApp example in their j2ee tutorial. (The example is from chapter 24 in the j2eetutorial14 � example ejb/converter) Upon deploying, the tool returns a client jar file that you can then use to call the bean. I have been able to successfully execute both beans in this manner.
    Now, for distribution, I need to package both of the beans in one jar file and also provide a separate jar file for each test client, but I don�t see how to use the deploy utility to do this. Can anyone suggest what would be the best (fastest) way to do this? Any help would be very much appreciated. Thanks.

    The code and ejb-jar.xml look ok to me. Try checking the server.log to see if there were any deployment errors.
    What exact class is the lookup code from your note defined in, com.sun.some.someEJB?
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Using Sun ONE Initial Context from servelt

    Hi,
    i'm triyng to bind an rmi resources from a servlet.
    This simplified code worked fine with weblogic:
    props.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
    props.put("java.naming.provider.url", "t3://localhost:port");
    try{       
    ctx = new InitialContext(props);
    LoginImpl login = new LoginImpl();
    ctx.rebind("login", login);}
    catch (Exception e){
    e.printStackTrace();
    Now i'm trying to translate this code on Sun ONE 7,
    but i' m m not able to create jndi resouce.
    I've tried with
    props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
    props.put("java.naming.provider.url", "iiop://localhost:3700");
    but i've this error back:
    [2003-10-31 18:34:00,875] ERROR -- runJob -- service-j2ee -- com.ilsole24ore.wp.admin.init.LoginAdminInitializer -- java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound
    java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound
    I think i'm using wrong properties, what are the correct settings for using Rmi from JNDI.
    Thanks

    Hi,
    i'm triyng to bind an rmi resources from a servlet.
    This simplified code worked fine with weblogic:
    props.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
    props.put("java.naming.provider.url", "t3://localhost:port");
    try{       
    ctx = new InitialContext(props);
    LoginImpl login = new LoginImpl();
    ctx.rebind("login", login);}
    catch (Exception e){
    e.printStackTrace();
    Now i'm trying to translate this code on Sun ONE 7,
    but i' m m not able to create jndi resouce.
    I've tried with
    props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
    props.put("java.naming.provider.url", "iiop://localhost:3700");
    but i've this error back:
    [2003-10-31 18:34:00,875] ERROR -- runJob -- service-j2ee -- com.ilsole24ore.wp.admin.init.LoginAdminInitializer -- java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound
    java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound
    I think i'm using wrong properties, what are the correct settings for using Rmi from JNDI.
    Thanks

  • Sun-appserv-deploy cutom Ant task

    Hi
    I wanted to use sun-appserv-deploy custom ant task in my build file to deploy an archive. But the file attribute requires EXISTING file which is constantly being deleted and recreated during development...
        <taskdef name="sun-appserv-deploy" classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask">
            <classpath refid="j2ee.classpath"/>   
        </taskdef>
        <sun-appserv-deploy
          file="webapp1.war"
          contextroot="/webapp1"
          name="webapp1WAR
          force="true"
          precompilejsp="false"
          verify="false"
          upload="true"
          user="admin"
          passwordfile="${passwordfile}"
          host="localhost"
          port="4848"
          asinstalldir="${j2ee.home}"/>
    Unless the "webapp1.war" exists the enitre build.xml file invalidates (in eclipse)
    How do I use this custom task during my development time (obviously when I run clean the WAR file is removed which invalidates my build.xml)
    Is there a workaround for this?
    Thanks
    Z...

    You have to include an additional attribute in the task:
    <sun-appserv-deploy ... generatermistubs="true" />Edited by: sjfischli on May 15, 2008 8:54 AM

  • OrdImage using its own database session?

    Hello,
    I have been searching on the Internet and this forums, but I am unable to find an answer to my question, so I am asking it here: I have noticed that when a user enters to a screen with an OrdImage being displayed in it, the application module opens 2 database sessions instead of one. Furthermore, if I comment the af:media component used to display the OrdImage and I repeat the same test, only one database session is created. So for some reason, the OrdImage is using a separate database session from the rest of the screen.
    Does the OrdImage type really need its own session? Is it possible to make it use the screen's one? Using two database sessions in the same screen is kind of a waste of resources, especially when that screen has a lot of users (like the one where he have the issue).
    Thank you
    Jordi
    PS: by the way, I am using JDeveloper 11.1.1.4.0.

    I have just found [this article|http://jobinesh.blogspot.com.es/2011/07/tips-on-using-afmedia-to-display.html] about OrdImage in ADF, and I see that the pagedef property CustomInputHandler="OrdDomainValueHandler" (which is already set in my application) is used to retrieve some information that cannot be get through the View Object. Is it possible that this property is the responsible for that second connection?
    Jordi

  • What to use for INITIAL_CONTEXT_FACTORY for Sun AppServer Platform Ed 8x

    I've got an external java JMS client trying to connect to Sun Java System Application Server Platform Edition 8.1 2005Q1 and I need to know what to use for the Context.INITIAL_CONTEXT_FACTORY (and what jar it's in) plus the PROVIDER_URL for the following code:
    Properties p = new Properties();
    p.setProperty(Context.INITIAL_CONTEXT_FACTORY, ????);
    p.setProperty(Context.PROVIDER_URL, ????);
    Context ctx = new InitialContext(p);
    QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup(factory);

    I experienced similar problems while trying to create a Message Driven Bean
    and send a message to it from a standalone client program.
    After much guddling around (and finally finding some helpful information in
    the App Servers Troubleshooting Guide) I managed to get this to work by doing
    the following:
         1) Including the following jars at client compile time:
              appserv-rt.jar
              j2ee.jar
         2) Including the following jars at client run time:
              appserv-rt.jar
              j2ee.jar
              appserv-admin.jar
              imqjmsra.jar
         3) Passing in the following arguments at client run time:
              -Dorg.omg.CORBA.ORBInitialHost=localhost
              -Dorg.omg.CORBA.ORBInitialPort=3700
         4) Creating the context using the no-arg InitialContext method � i.e.
              Context ctx = new InitialContext();
         Note that this method picks up the initial context factory
         as com.sun.enterprise.naming.SerialInitContextFactory from
         a jndi.properties file in appserv-rt.jar.
    I have included my client code below FYI.
    import javax.jms.Connection;
    import javax.jms.ConnectionFactory;
    import javax.jms.JMSException;
    import javax.jms.MessageProducer;
    import javax.jms.Queue;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Date;
    * @author dlowe8
    public class JmsTest2 {
    /** Creates a new instance of JmsTest2 */
    public JmsTest2() {
    public static void main(String[] args) {
    Connection c = null;
    try {
    Context ctx = new InitialContext();
    String factoryJndiName = "jms/ConnectionFactory";
    String queueJndiName = "jms/Queue";
    System.out.println("Factory JNDI Name = " + factoryJndiName);
    System.out.println("Queue JNDI Name = " + queueJndiName);
         ConnectionFactory cfa = (ConnectionFactory)ctx.lookup(factoryJndiName);
         c = cfa.createConnection();
    Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
    Queue q = (Queue)ctx.lookup(queueJndiName);
    MessageProducer producer = s.createProducer(q);
    TextMessage m = s.createTextMessage();
    m.setText("Helloooo from standalone program at " + new Date());
    producer.send(m);
    s.close();
    Object o = ctx.lookup(factoryJndiName);
    System.out.println("Factory object class [" + o.getClass().getCanonicalName() + "]");
    o = ctx.lookup(queueJndiName);
    System.out.println("Queue object class [" + o.getClass().getCanonicalName() + "]");
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    if (c != null) {
    try {
    c.close();
    } catch (JMSException e) {}
    System.exit(0);
    }

  • Using Resource Reference to JavaMail Session Resource

    Hi,
    Wondering whether someone can give me some helpful pointers to solve the following issue. I have a servlet app, which at some point needs to sent emails. In order to do so, I want to use a JNDI lookup to a JavaMail session resource. Here is a code snippet:
          Context envCtx  = (Context)ehHelper.getContext().lookup("java:comp/env");
          Session session = (Session)envCtx.lookup("mail/Session");
      ...I have supplied information to my web.xml in order to let enable binding the appropriate information in OC4J. Here is a part of my web.xml:
      <resource-ref>
        <description>Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate
        SMTP server.</description>
        <res-ref-name>mail/Session</res-ref-name>
        <res-type>javax.mail.Session</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>I use iAS9.0.3 OEM to deploy the ear to the application server and can now enter Resource Reference (and Context Attributes) in the Environment page of the web module. So I supply:
    Name: mail/Session
    Type: javax.mail.Session
    Authorization: Container
    Lookup Context: mail/Session
    Context Attributes
    Name: mail.smtp.host
    Value: skywalker.kantoor.officeIf I run the servlet I get the following error:
    Naming exception Error instantiating web-app JNDI-context: Error accessing lookup-context for resource 'mail/Session': javax.naming.NameNotFoundException: mail/Session not foundI hope someone can put me on the right track.
    Regards,
    Jan.

    Hi
    Could you please send me the details?
    I need to send mail from a jsp, we are using Oc4J 2.2.6 R2.
    Your help would be appreicated a lot.
    Thanks

  • From: Apple-ID [mailto:Apple.International@Apple.id]  Sent: Wednesday, December 11, 2013 7:36 PM To: Deborah McKay Subject: Final step To verify your Apple      Dear Apple Customer,  Your Apple ID has been used to open a session iCloud from an unauthori

    From: Apple-ID [mailto:[email protected]]
    Sent: Wednesday, December 11, 2013 7:36 PM
    To: Deborah McKay
    Subject: Final step To verify your Apple
    Dear Apple Customer,
    Your Apple ID has been used to open a session iCloud from an unauthorized device..
    It's easy: Click the link Your iTunes account is now locked, please enter your account to verify your information. .
    Update Now >
    After you finished your account is confirmed, let us know immediately. Report, it is important because it helps us prevent fraudsters from stealing your information. Sincerely, apple.
    copyright 2013 Apple Inc. Please do not reply to this email because we are not monitoring this inbox. To get in touch with us, log in to your account and click "Contact Us" at the bottom of any page. Copyright © 2013 apple. All rights reserved. apple (Europe) S.à r.l. et Cie, S.C.A. Société en Commandite par Actions Registered office: 22-24 Boulev ard Royal, L-2449 Luxemburg RCS Luxemburg B 118 349 apple Email ID PP315.
    I just got this message and sent it to [email protected] per instructions on another post. the link leads to a page asking for Apple id and credit card information.

    I got a similar email. It's obviously Spam. The double period afetr the first sentence and the otherwise poor grammar are dead giveaways even before I checked out the link embedded. -- I didn't click on it, just hovered over it to get the url. And the return address was [email protected] Very bogus.

  • How to retrieve public/ private from iKey token using Sun PKCS#11 provider

    Dear all,
    I'm trying to access one rainbow iKey 2032 token in Java 1.5 (Windows Environment) using Sun PKCS#11 provider. Token is stored with certificate. There is no problem to logging into the token using java.
         Provider p = new sun.security.pkcs11.SunPKCS11(configName);
         Security.addProvider(p);
         KeyStore ks = null;
         try{
              char[] pin = {'P','A','S','S','W','O','R','D'};
              ks = KeyStore.getInstance("pkcs11");
              ks.load(null,pin);
    catch(Exception e) {}
    Now I am wondering how to retrieve a public and private from token, so that I can encrypt and decrypt a plain text file. Could anyone give me a sample program for this?
    Your help is very much appreciated!!

    Hi Fred13
    1. I have the same pkcs.cfg and get the following trace. Can you help me understand? Does this imply a bad dkck201.dll? I would really like to get this working for my implementation. tia.
    lException in thread "main" java.security.ProviderException: Initialization failed
         at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:175)
         at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:76)
         at com.mkp.jce.chap1.ProviderDetail.main(ProviderDetail.java:38)
    Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_TOKEN_NOT_RECOGNIZED
         at sun.security.pkcs11.wrapper.PKCS11.C_GetTokenInfo(Native Method)
         at sun.security.pkcs11.Token.<init>(Token.java:105)
         at sun.security.pkcs11.SunPKCS11.initToken(SunPKCS11.java:555)
         at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:169)
    2. (If I can be so indulgent of your time) Can you provide more information on cbp? I have done a search and there is little on it. It appears to be a new authentication framework tied in with sasl unique to 1.5. Any links for self education would be appreciated.

  • Can't PING a Datasource from  Sun AppServer 1.4

    posted February 25, 2004 06:49 PM
    Hi all!
    I am trying to create a datasoure in Sun AppServer 1.4 Developer Release. To connect to MySQL
    After download and installed the mysql-connector, I created a connection pool in the appserver called mySQLconPool with the following settings:
    Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Additional Properties
    serverName: 127.0.0.1
    databaseName:test
    port:3306
    user:Admin
    password:admin
    I added the mysql-connector jar file path to the app server> JVM Settings> Classpath sufix.
    The problem is that if I try to PING the connection I get the following error:
    quote:
    An error has occurred.
    Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Error getting connection from the EIS
    What am I doing wrong? Am I missing something?
    Please if any of you can help me I will appreciate!!!!!!
    Thanks in advance,
    JOSEL

    Hi aagore:
    First thank you for replying. Here you have a snippet you domain.xml:
    <jdbc-connection-pool connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" max-pool-size="32" max-wait-time-in-millis="60000" name="mySQLconPool" pool-resize-quantity="2" steady-pool-size="8">
    <property name="url" value="jdbc:mysql://127.0.0.1:3306/sss"/>
    <property name="user" value="Admin"/>
    <property name="port" value="3306"/>
    <property name="databaseName" value="sss"/>
    <property name="password" value="admin"/>
    <property name="serverName" value="127.0.0.1"/>
    </jdbc-connection-pool>
    </resources>
    JOSEL

  • Deploying to Sun AppServer PE 8.1 (build b41-fcs) with an Oracle database

    Hello,
    I'm trying to deploy an application to Sun AppServer PE 8.1(an external server, not the embedded one).
    I already know that the direct deployment preview feature doesn't work with 8.1:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50572
    So I tried the export war method, and correctly configured the resource ref with the deployment tool. The deployment itself worked fine, but I can't access the database.
    The oracle drivers, from their web site don't work, I get the following exception:
    [#|2005-01-25T20:33:48.642+0000|SEVERE|sun-appserver-pe8.1|javax.enterprise.system.container.web|_ThreadID=19;|WebModule[/smwebinterface]userView Initialization Failure
    javax.faces.FacesException: java.sql.SQLException: JDBC driver does not support PreparedStatement.getMetaData()
    (...)I also tried to use the JSC bundled drivers as explained in
    http://devservices.sun.com/premium/jscreator/standard/learning/tutorials/appserver7.html
    and I got the following exception:
    [#|2005-01-25T19:44:56.236+0000|WARNING|sun-appserver-pe8.1|javax.enterprise.system.stream.err|_ThreadID=15;|JdbcRowSetXImpl (prepare): [sunm][Oracle JDBC Driver]This driver is locked for use with embedded applications.|#]
    [#|2005-01-25T19:44:56.252+0000|SEVERE|sun-appserver-pe8.1|javax.enterprise.system.container.web|_ThreadID=15;|WebModule[/smwebinterface]userView Initialization Failure
    javax.faces.FacesException: java.sql.SQLException: [sunm][Oracle JDBC Driver]This driver is locked for use with embedded applications.
         at com.sun.jsfcl.data.RowSetDataModel.synchronize(RowSetDataModel.java:1197)
         at com.sun.jsfcl.data.RowSetDataModel.connect(RowSetDataModel.java:962)
         at
    Caused by: java.sql.SQLException: [sunm][Oracle JDBC Driver]This driver is locked for use with embedded applications.
         at com.sun.sql.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.sun.sql.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.sun.sql.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
         at com.sun.gjc.spi.ConnectionHolder.prepareStatement(ConnectionHolder.java:407)
         at com.sun.sql.rowset.JdbcRowSetXImpl.prepare(JdbcRowSetXImpl.java:560)
         at com.sun.sql.rowset.JdbcRowSetXImpl.getMetaData(JdbcRowSetXImpl.java:1005)
         at com.sun.jsfcl.data.RowSetDataModel.synchronize(RowSetDataModel.java:1172)
         ... 92 more
    |#]It appears that these drivers are somehow locked to JSC and cannot be used in production servers, despite what the tutorial says ....
    Has anybody dealt with this issue before? Can someone help me with this?
    Thanx,
    Pedro Pires

    Oracle drivers have that limitation - that's one reason why we ship with our own drivers for accessing oracle.
    For trying to use the JSC bundled drivers in 8.1 - there's license restrictions (read $$$) involved with using JSC bundled drivers and "other" app servers. It this case, 8.1 PE (emphasis on the PE) is classified as an "other".
    Buying 8.1 (i.e., non PE), or waiting for JSC to bundle 8.1, seem to be your options if 8.1 is required.

  • How to use gmail with JavaMail

    JavaMail 1.4 is capable of sending and reading messages using gmail.
    All that's required is to properly configure JavaMail. I'll
    illustrate the proper configuration using the demo programs that
    come with JavaMail - msgshow.java and smtpsend.java.
    Let's assume your gmail username is "[email protected]" and your
    password is "passwd".
    To read mail from your gmail Inbox, invoke msgshow as follows:
    java msgshow -D -T pop3s -H pop.gmail.com -U user -P passwdBy reading the msgshow.java source code, you can see how these
    command line arguments are used in the JavaMail API. You should
    first try using msgshow as shown above, and once that's working
    move on to writing and configuring your own program to use gmail.
    To send a message through gmail, invoke smtpsend as follows:
    java -Dmail.smtp.port=587 -Dmail.smtp.starttls.enable=true smtpsend
            -d -M smtp.gmail.com -U user -P passwd -A [email protected](Note that I split the command over two lines for display, but you
    should type it on one line.)
    The smtpsend command will prompt for a subject and message body text.
    End the message body with ^D on UNIX or ^Z on Windows.
    Gmail requires the use of the STARTTLS command, and requires a
    non-standard port, which the smtpsend program doesn't have command
    line options to select so we set them as System properties on the
    java command. The smtpsend.java program uses the System properties
    when creating the JavaMail Session, so the properties set on the
    command line will be available to the JavaMail Session.
    Again, you can read the smtpsend.java source code to see how the
    command line arguments are used in the JavaMail API. There is,
    of course, more than one way to use the JavaMail API to accomplish
    the same goal. This should help you understand the essential
    configuration parameters necessary to use gmail.
    And no, I won't send you an invitation to gmail. Sorry.

    I notice that it's possible to have sticky posts in these forums. See
    http://forum.java.sun.com/forum.jspa?forumID=534
    the Concurrency forum for an example. Posting a link to the FAQ in a sticky post might reduce the number of FAQs asked here by maybe 1%? Or posts like this one might do well as a sticky?

  • Sun AppServer 9.0 Update 1 on Solaris not supporting form-based auth

    Ok, I installed Appserver 9 on a Solaris box and then started up the default domain1. When I point the browser to http://localhost:4848 I am not pointed to the login page for the admingui, it just bypasses the authentication and I am allowed to perform all admin actions without logging in. I then deployed a custom web application that uses form-based authentication that works correctly on Sun Appserver 8.1. However it behaves the same way as the admingui application (I am not presented with a login page). After setting some of the log levels to FINEST and looking at the logs it appears that when these requests are coming in they are not matching any constraint (but the constraints are defined in the web.xml). Installing Appserver 9 on a win2k box does not have this issue. Has anyone else seen this problem? Is there some security setting that is not turned on by default from the solaris install????

    Ok if anyone is interested I was able to fix my problem. It looks like the issue is the version of java used with Appserver 9 on Solaris. The latest version of java i have on the machine is Java 1.5.0_06, but everytime I try to install the Appserver with this version it hangs at 39% into the installation. The next latest version of Java i have on the machine is 1.5.0_02, so that is the version I was using to install and the install works perfectly. However, after the install the form-based authentication does not work with this version of Java on Solaris.
    They way I fixed this was to modify the asenv.conf file in the Appserver_Install dirrectory to point to the Java 1.5.0_06 installation and started the domain, now the form-based authentication is working as expected.
    I guess my question now is does anyone know why I can't install the server with Java 1.5.0_06? But it looks like I need that version to actually run things correctly.

Maybe you are looking for