Mani Raju

Ranch Hand
+ Follow
since Oct 09, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Mani Raju

Hi,

Actually i am trying to send mail through java using destination host. But fortunately i am getting below exception.

javax.mail.MessagingException: Unknown SMTP host:
nested exception is:
java.net.UnknownHostException:
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1225)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:32 2)
at javax.mail.Service.connect(Service.java:236)
at javax.mail.Service.connect(Service.java:137)
at javax.mail.Service.connect(Service.java:86)
at javax.mail.Transport.send0(Transport.java:150)
at javax.mail.Transport.send(Transport.java:80)
java.net.UnknownHostException:
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:520)
at java.net.Socket.connect(Socket.java:470)
at java.net.Socket.<init>(Socket.java:367)
at java.net.Socket.<init>(Socket.java:240)
at com.sun.mail.util.SocketFetcher.getSocket0(SocketFetcher.java:253)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:129)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1195)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:32 2)
at javax.mail.Service.connect(Service.java:236)
at javax.mail.Service.connect(Service.java:137)
at javax.mail.Service.connect(Service.java:86)
at javax.mail.Transport.send0(Transport.java:150)
at javax.mail.Transport.send(Transport.java:80)

Anyone could please help to sort out this exception.

Thanks in advance!

4 years ago
I required to access ".csv" file through Excel macro!

Any one could you please help to create macro in excel to access content of ".csv" format file!

Thanks in advance!


4 years ago
Yes,

I added class "FileComparator" class below:

public class FileComparator implements Comparator
{

/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
public int compare(Object arg0, Object arg1) {
int fileaIndex = Integer.parseInt(((File)arg0).getName().split("-")[0]);
int filebIndex = Integer.parseInt(((File)arg1).getName().split("-")[0]);
int compa = 0;
if(fileaIndex > filebIndex)
{
compa = 1;
}
if(fileaIndex < filebIndex)
{
compa = -1;
}


return compa;

}

}


Could you please tell me how it uses value returned by this "FileComparator" class in Arrays.sort() method.

4 years ago
Hi,

I have list of files in array "files[]" and called Arrays.sort() method with this array "files" as below.

Arrays.sort(srFiles,new FileComparator());

How it works?

Could you please help me to know the comparision process inside it for files.
4 years ago
Hi,
I have used below code .

Document document = null;

try
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
document = db.parse(new File(filePath));
}
catch(Throwable th)
{
throw new PlatformCertException(th);
}

Here, filePath is location of xml file which i need to read and parse.

for this code i am getting below exception.

[Fatal Error] :-1:-1: Premature end of file.

Caused by: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
at com.cisco.nmtgTesteng.automation.isc.platcert.xml.XMLHandler.getXMLDocumentNoCache(XMLHandler.java:107)
... 9 more

Even i specified correct xml file path as an argument for that method.

This code was worked earlier in some other server, but i am getting problem in some other server.

Actually i tried all ways but still i didn't find reason.

Could you please help us to solve this issue.


Thanks TIM.

Can you please provide step by step procedure to create RPM Package. Actually i don't know that SPEC files, basics in creating RPM packages. I am struggling lot to know how to create.

Could you please provide step by step documentation to create any kind of RPM package to work on Red Hat Linux distributions.

Thanks in advance!

4 years ago
Thanks for your information. Please kindly provide step by step procedure for creating rpm packages.
In creating .pkg file we will follow below process:

Step 1: First create pkginfo file.
Step 2: Create required jar file and stored in "jars" folder.
Step 3: Create BOM file. If we want to run checkinstall, request, postinstall scripts then just simply specify them at the top inside BOM file. Specify the path of the files[in BOM] which we need to pack inside the package.
Step 4: Give the above BOM file as input to the pkgmk command while creating package.
Step 5: Inside package, we have files pkginfo and pkgmap. Pkgmap file contains the pathnames to all the files and permissions and checksums for each of them.


Similarly can you please tell me the step by step process for creating rpm packages and to perform validations to check copied locations by this rpm package installation.


Thanks in advance!

4 years ago
Thanks Tim,

i have java code and we will run that code in any linux server but we not developed code in J2EE environment. We develop code in simple manner by using collections and we can create one new jar file for this code.
In earlier we used one.pkg for solaris servers. Actually it is not supported in linux server. So we are looking for alternative one in linux. we can install one.pkg by using command "pkgadd -d one.pkg".
By giving this command installation started and it will ask the location to store[location in server in which we are installing] all java files,java classes, xml files, some scripts and jar files. After storing all these files in specified location in installation process, it will execute scripts which we copied into specific location in installation and asks user to know some locations to perform operations in that location[this operations also need to be specified in copied scripts]. All these actions has to be performed in linux server while installing package.
Similarly we need to implement in rpm for linux server.

Can you please share complete process in step by step to create rpm package for all above activities.

Thanks in advance.
4 years ago

Mani Raju wrote:

Jesper de Jong wrote:Different Linux distributions use different package management systems.

Debian, Ubuntu, and other Linux distributions which are based on Debian use .deb packages, which are managed using dpkg. You install a .deb package with "dpkg -i one.deb". See "man dpkg" for details.

Red Hat Linux and Fedora use RPM packages, which are managed with a program named "yum".

So it depends on which Linux distribution exactly you are using.




Thanks,
Yes, i found distribution in my linux server. It is Red Hat Enterprise Linux Client release 5.5 (Tikanga)
Could you suggest me which is better one whether RPM or dpkg for Red Hat Enterprise Linux Client release 5.5 (Tikanga) and process to create new package?


4 years ago

Jesper de Jong wrote:Different Linux distributions use different package management systems.

Debian, Ubuntu, and other Linux distributions which are based on Debian use .deb packages, which are managed using dpkg. You install a .deb package with "dpkg -i one.deb". See "man dpkg" for details.

Red Hat Linux and Fedora use RPM packages, which are managed with a program named "yum".

So it depends on which Linux distribution exactly you are using.




Thanks,
How can we find Linux Distribution in our server?
Could you please tell me the way to find it?


4 years ago
Hi,

I used one file one.pkg in solaris server. It will create some new directories, new files and executes some scripts in solaris server by giving the command "pkgadd -d one.pkg". Clearly its works only in solaris server but not in Linux, because commands like pkgadd, pkginfo not supported in linux. I need to create similar file in linux to do all tasks what ever performed by the command "pkadd -d one.pkg".

Could you please suggest which way is better for me and which one is alternative for .pkg in linux.

Thanks in advance.
4 years ago
Yes, It is access related problem of .classpath file in my project and i did checkout for this file. Now it is allowing to add external jar files into my project through build path in eclipse.

Thanks.
I tried to add new external jar file xalan-2.7.1.jar through build path in eclipse but i am getting error " in your project .classpath is read only". After that alert i didn't find my jar file in project. I tried changed the permissions of .classpath file in project , but it does not allow to change permissions.
And one more thing is ".classpath" file is hidden in my project.
I need to import this jar file into my project , it is allowing to add but i could n't find that jar file in extjars location in my project. Still i am facing the same problem.

Anyone could help to resolve this issue.

Thanks in advance.

Matthew Brown wrote:We'd need to know how you're storing them, and possibly how you're extracting them. A HashMap definitely can store multiple pairs, so you must be doing something wrong, but we've got no way of guessing what.




Thanks, i found the reason. Reason is "I stored the multiple values with same key again and again. Because of that reason only i am getting issue...........

5 years ago
Actually, i get values from xml document and i tried to store in hashmap. but problem is last stored values only available in hashmap but it does not contain all stored values. It contains only last stored values.
i mean, suppose we stored values like <key, Value>, <"1","one">,<"2","two">, <"3", "three">......
but, i tried to get all values from that hashmap, it returns only one value. i.e., last value <"3","three">. All values overridden.

Previously stored values are overridden.

Can any one help me to solve this issue..................

5 years ago