I don't use MS Outlook at all. I think that because it is Microsoft, it is extremely vulnerable to viruses, hackers, bots and spammers. It is an easy gateway for malware and everything bad about the internet. It hasn't even been configured on my machine.
However, I am writing a program for inviting people to our app, and I needed to get Outlook contacts to send them an email (that will be the subject of another blog post). So I configured Outlook and the base email address was an AOL email address that I rarely use except for testing and for signing up for things where I don't want them to know my real identity (like the kajillions of white papers and secrets that one can get just for giving someone your email address -- a spam feedlot of sorts).
Well, it was supposed to be painless and take a few seconds. I let the wizards set up Outlook for me and then of course, I had to test it. I sent an email to my other email address. Immediately it was rejected. The error message was:
Your message did not reach some or all of the intended recipients.
Subject: Test
Sent: 05/05/2014
The following recipient(s) cannot be reached:
'test@test.com' on 05/05/2014 11:19 AM
<test2@aol.com>: Sender address rejected: not owned by user test2
I thought -- WTF!!! It had just used that identity to create an account for me using the account wizard. It had just authenticated me to aol using that identity. It was a total mystery.
I burned over an hour trying to de-bug this. Here is the simple solution. I went to Accounts on Outlook and clicked on the account to show the properties. The username was test2. When I go into the web interface of AOL mail and sign in, I just put in test2 and the password. Outlook knew that the domain was AOL.com because it had just automatically used those exact same credentials to create the account. To make it work, I simply modified the username to include the domain -- ie. instead of test2, I put in test2@AOL.com and it worked.
This has done nothing to change my opinion of Microsoft products. They are still a piece of crap.
Showing posts with label error. Show all posts
Showing posts with label error. Show all posts
Copying Forms Error in Visual Studio .Net and C#
A colleague phones me up and asks me about a Visual Studio C# project that I had written a couple of years ago.
He tried simply copying a form and he kept getting the error:
The item "obj\Release\<filename>.resources" was specified more
than once in the "Resources" parameter.
Duplicate items are not supported by the "Resources" parameter.
Hmm. I went to stacktrace (the website) and they said that the easiest way was to go into Explorer, duplicate the files and add them to the project. It didn't work because the .resx file was not under the .cs file structure.
It turns out that the re-factoring isn't complete. If you just plain old copy the form in the Solutions Explorer, rename it, and then immediately go and fix all of the references to the old name in the .cs file (rename the class, the constructor and all references to the old name) and then do the same thing in the .resx file, everything eventually works.
It eliminates the above problem.
Hope this helps someone.
Strange GMail error
Got a strange GMail message that persisted with a single message. I composed an email, and clicked on send. Up popped the following message:
Oops... a server error occurred and your email was not sent. (#793)
It persisted. I was able to create and send another message, and yet when I went to my drafts folder to send it again, I got the error again.
I finally solved it by closing the browser and re-signing into GMail.
Oops... a server error occurred and your email was not sent. (#793)
It persisted. I was able to create and send another message, and yet when I went to my drafts folder to send it again, I got the error again.
I finally solved it by closing the browser and re-signing into GMail.
MySQL ROW_COUNT() Bug?
Had a strange bug with a MySQL stored procedure. Consider the following line:
START TRANSACTION;
Insert into conversations(subjectLine) values(subjectLine);
IF (ROW_COUNT() > 0) then
set @pass1 = 1;
end if;
Look closely at the IF statement. It works perfectly on a Windows server. When you put the CREATE statement on a Linux machine in the mysql command line, it fails and fills with garbage.
The fix took some head-scratching, but here it is:
START TRANSACTION;
Insert into conversations(subjectLine) values(subjectLine);
IF ((SELECT ROW_COUNT()) > 0) then
set @pass1 = 1;
end if;
I had to put (SELECT ROW_COUNT()) to make it work in the Linux command line.
Setting Up JNDI JDBC MySQL Connection Pool in Tomcat
So it was time to set up a connection pool for our high concurrency application. It seemed like an easy thing to do. I went to avajava.com followed one of their instruction tutorials, and burned a whole afternoon debugging. Tomcat 7 has connection pooling built in, so I figured it would be a walk in the park. Man, I got the following list of errors:
- org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to org.apache.tomcat.jdbc.pool.DataSource
- name is not bound in this context. unable to find
- java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactor
- java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to org.apache.tomcat.jdbc.pool.DataSource
- java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactory
After wasting a whole bunch of time, I finally got it to bind to the database resource, but I had an error with the login stored procedure. It was this one:
- mysql - java.sql.SQLException: Parameter number 3 is not an OUT parameter
I knew that I was getting some sort of binding but not a good connection. Not knowing what I didn't know, I decided to do a debug on my connection called conn:
System.out.println(conn.toString());
System.out.println(conn.getCatalog());
System.out.println(conn.getAutoCommit());
System.out.println(conn.getMetaData().allTablesAreSelectable());
System.out.println(conn.getMetaData().getDriverName());
System.out.println(conn.getMetaData().getMaxConnections());
System.out.println(conn.getMetaData().supportsStoredFunctionsUsingCallSyntax());
System.out.println(conn.getMetaData().supportsStoredProcedures());
System.out.println(conn.getMetaData().allProceduresAreCallable());
It was quite an interesting transcript. It told me that getMaxConnections() was zero, that allTablesAreSelectable was false, and allProceduresAreCallable() was false. I spent a lot of time chasing down this dead end rabbit hole.
Finally I went to the expert:
http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency
I followed the instructions implicitly and voila -- every thing works:
Simple Connection Pool for MySQL
<Resource type="javax.sql.DataSource"
name="jdbc/TestDB"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mysql"
username="mysql_user"
password="mypassword123"
/>
The first thing we notice is the factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" attribute.
When Tomcat reads the type="javax.sql.DataSource" it will automatically configure its repackaged DBCP, unless you specify a different factory. The factory object is what creates and configures the connection pool itself.
When Tomcat reads the type="javax.sql.DataSource" it will automatically configure its repackaged DBCP, unless you specify a different factory. The factory object is what creates and configures the connection pool itself.
There are two ways to configure Resource elements in Apache Tomcat.
Configure a global connection pool
File: conf/server.xml
<GlobalNamingResources>
<Resource type="javax.sql.DataSource"
name="jdbc/TestDB"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mysql"
username="mysql_user"
password="mypassword123"
/>
</GlobalNamingResources>
You then create a ResourceLink element to make the pool available to the web applications. If you want the pool available to all applications under the same name, the easiest way is to edit the File: conf/context.xml
<Context>
<ResourceLink type="javax.sql.DataSource"
name="jdbc/LocalTestDB"
global="jdbc/TestDB"
/>
<Context>
Note, that if you don't want a global pool, move the Resource element from server.xml into your context.xml file for the web application.
And to retrieve a connection from this configuration, the simple Java code looks like
Context initContext = new
InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource datasource = (DataSource)envContext.lookup("jdbc/LocalTestDB");
Connection con = datasource.getConnection();
Mister TomcatExpert is really an expert.
Subscribe to:
Posts (Atom)


