Amit Siinngghh

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

Recent posts by Amit Siinngghh

Is it more appropriate to say one Instance per "Class Loader Tree", I believe there is a classloader tree hierarchy (bootstrap, system, http, custom, etc) in a JVM.
you can use the javamail API (IMAP) to logon to a exchange server and check the folders for number of messages.

With a little effort you could also download the attachment as a byte array. Also, beware of the Multipart messages you need to treat them seperately.

for sample example see the documentation at sun's website.

-Amit
19 years ago
Hello,

I found this code in the pdf document from the sun's website

// Get a Session object
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
// Get a Store object
Store store = null;
if (url != null) {
URLName urln = new URLName(url);
store = session.getStore(urln);
store.connect();
}

Constructor for URLName: URLName(java.lang.String protocol, java.lang.String host, int port, java.lang.String file, java.lang.String username, java.lang.String password)


There might be another way, i.e. connecting to the POP3Store

I think you can connect to the POP3Store directly

Constructor : POP3Store(Session session, URLName url, java.lang.String name, int defaultPort, boolean isSSL)


let us know how it goes

good luck
-Amit
19 years ago
Hello All,

Can we have a space in XML element name.

like

<Name>
<Some name/>
<Name>

is there a way to specify a space in XML name I tried   but then the xml is not wellformed.

any insights into it

thanks
Amit
You can use IReport to create a template configuration file where you can set the font and other cosmetic things. Once you have finalised the looks then you can read the template xml configuration file at runtime and use JDOM to insert new columns or delete init columns. It involves very basic XML parsing and then rewriting the XML file back to the disk with new 'field' and other corresponding elements . Then jasperreport can pick the xml file from there.

One option could be to give jasperreport a runtime document object, but I havent tried it. Let us know if you can work around with it this way.

also refer to the dtd and before working on configuration file. Note that the XML file requires the elements to be in the same order as in the DTD. Some times when you insert new elements under the root they are inserted at the end of the document

Hope it helps

Amit
19 years ago
I am unable to access the Shared Mailbox through JavaMail1.3 api.

The scenario is:

My email account is given access to the shared mailbox on the exchange server. I am using JavaMail 1.3 api to access the emails in my personal mailbox (I can sucessfully read the messages and attachments in my personal mailbox). However when I try to get the folder list from the IMAPStore then no folders are returned.

I am using


Also here is a transcript of the messages recieved from the exchange server

/*****************************************************************/
DEBUG: setDebug: JavaMail version 1.3.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
* OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6603.0 (imap server where email mailbox is present) ready.
A0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
A0 OK CAPABILITY completed.
A1 LOGIN "someUSER" somePWD
A1 OK LOGIN completed.
A2 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
A2 OK NAMESPACE completed.
A3 LIST "" +ridata
A3 OK LIST completed.
/*****************************************************************/

I dont have a clue of what is wrong with it. According to me I should have got the list of shared folders which I am subscribed to.

Does any one out there has any suggestion.

Thanks in advance
Amit
19 years ago
Hello all,

I need to get information through a java program from a Site which has a expired certificate. The site is using SSL and I checked the certificate, which has expired few months back.

Since the JVM does not trust the certificate it gives me this exception

SEVERE: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target



Is there a way to tell the JVM to ignore the expired certifiactes or not to check the validity of the certificate at all.

Thanks,
Amit
20 years ago
Hello Friends,

I am having a problem with authenticatin in JBoss Application server. I want to implement durable subscription usign JBoss so that the client is able to recieve message even when it reconnects.

I read in the JBoss documentation that the user needs to connect using a UserID and a Password.

My Problem is :
Where to specify the username and password (I know jbossmx-state.xml holds the userid and the password but where is it required to be placed in the J Boss appication direcotry)

Also whenever I try to connect to the TopicConnectionFactory using
tconFactory = (TopicConnectionFactory) ctx.lookup(JMS_FACTORY);
tcon = tconFactory.createTopicConnection("john", "needle");

I get the exception

javax.jms.JMSSecurityException: Connection not authorized to do durable subscription on topic: EKTMessageTopic
at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecurityInterceptor.java:135)
at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.java:816)
at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:297)
at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:160)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:361)
at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
at java.lang.Thread.run(Thread.java:534)


I have been trying to figure it out since a long time, Any help will be highly appreciated.

Thanks,
Amit
20 years ago