Abdul Basit

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

Recent posts by Abdul Basit

Hi,

First decide the Application Type [portal, web-application , web service, ..], Weblogic provide you to build a plate-form /domain and then application.

follow this link, it may help you.

http://dev2dev.bea.com/evalguide/index.html

Regards
M.A.Basit
16 years ago
Hi Siddharth,
Start using the flexbuilder 2 or 3, 60 days evaluation is enough. FB also provide you help/API about flex. Once you get hands on Flex then you can plug the flex sdk in eclipse I m sure.

I don't have an idea you would like to follow the flex UI track or interested in Flex data service which provide Web-service, RPC and HTTPService call on back-end [java,CF,PHP,..] code.

Here is flex help:

http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part7_Build_Deploy_112_1.html

Regards
M.A.Basit
16 years ago
This code give you all interfaces ip addresses.

Enumeration enum = NetworkInterface.getNetworkInterfaces();

while(enum.hasMoreElements())
{

NetworkInterface ia= (NetworkInterface)enum.nextElement();
Enumeration enuminet = ia.getInetAddresses();

while(enuminet.hasMoreElements())
{

InetAddress inet = (InetAddress) enuminet.nextElement();
System.out.println(inet.getHostAddress());
}
}
Neeraj this also giving me "localhost/127.0.0.1" .
I am finding ip address of my own PC from where i am executing my code. I am on LAN and has local ip address 192.168.1.2. What i am doing you can see in a below code.

public class Test {
public static void main(String[] args) throws Exception{
try
{

InetAddress localaddr = InetAddress.getLocalHost();
System.out.println( "main Local IP Address : " + localaddr.getHostAddress() );
System.out.println( "main Local hostname : " + localaddr.getHostName() );

}
catch ( UnknownHostException e )
{
System.err.println( "Can't detect localhost : " + e);
}
}
}

This code outputs loop-back address 127.0.0.1 and host name of my PC, what a huge work this code does, but i am interested in eth0 interface address which is �192.168.1.2�.
any suggestion how can i get my PC local LAN ip via code.
Regards
MABASIT
I am making a web service through Jbuilder8 and axis , when i used RPC call it works fine .
I have two methods in my web service :
public class MyService {
private String sample = "Sample";
public String getSample() {
return sample;
}
public void setSample(String sample) {
this.sample = sample;
}
}
but when i try to use document style service it give me an error :
few lines of error is follows:

Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}Server.generalException
faultString: No such operation 'sample'
faultActor: null
faultDetail:
stackTrace: AxisFault
faultCode: {http://xml.apache.org/axis/}Server.generalException
faultString: No such operation 'sample'
faultActor: null
faultDetail:

No such operation 'sample' .

So , can any one tell me what i am doing wrong , and plz also mention any web resource for document style service , many resources are available on RPC but nothing on document and wrapper base style service.

And second thing is document style service is a asynchronous or a synchronous service?
Because i want to use a asynchronous service .
Thanks in advance
19 years ago
I got one link during my search , it might help full for others.
http://java.sun.com/j2se/1.3/docs/guide/jni/spec/types.doc.html (types)
http://java.sun.com/j2se/1.3/docs/guide/jni/spec/functions.doc.html (methods)
it contain types and methods list of jni.
19 years ago
Is any resource available on line or for download , where all JNI method and Classes(e.g jobject,jclass,jobjectArray) are available in java doc formate . I have a JNI book but i think API can make my life more easy.
19 years ago
How can i create a C++ class object from java code through JNI, I know how i can call C language methods , but still i not get an example which explain clearly how can we create c++ object in java and then call method from that object.

one post on a forum saying
"In the constructor of your Java object, you'll have to call your 'createObjectOnHeap' function to actually instantiate your C++ object."

u can check this post on below link
http://jguru.com/faq/view.jsp?EID=710841
20 years ago
Yes Joe,
exactly like Socket.isConnected() and Socket.isClosed().
Thanks Joe.
yeh u right finger closing my connection and now i am making connection for next request but the problem is i want to use same code for telnet, ftp and other services , that is why it is really necessary for me to find out before sending any query on wire that connection is still alive or not.
I think that there should be a way to find out that remote server has been close your connection.
Regards
MABASIT
I am facing a problem, when i try to communicate with finger protocol . Basically finger service closing connection when it answer my request and when i do second request with same socket so it do nothing. I check it out through �ethereal� that what is happening in tcp stream so basically after full fill my first request finger service send �RST� packet which is basically for connection close. So finger service is closing connection but i tried many method to some how find it out that remote server has close my connection but no success. So any one from you guide me how i can find out that remote server has close my connection.

Sample code is here :

import java.net.*;
import java.util.*;
import java.io.*;
public class DemoFinger{

public static void main(String[]args) throws Exception
{

Socket soc = new Socket("192.168.1.18",79) ; // opening socket
InputStream input = soc.getInputStream();
PrintWriter prWri = new PrintWriter(soc.getOutputStream(), true);
// soc.setSoTimeout(10000); // setting socket time-out


for(int j=0;j<2;j++)
{
prWri.println("kk") ;

/*I have to put some thing here to find out server socket still listenning or not */

int first = input.read() ;
int max = input.available() ;
int[] fromSocket = new int[max] ;

Vector fromSock = new Vector() ;
int m = 0 ;
while ( (m = input.read()) != -1) { //max != 0 &&

Integer intgr = new Integer(m) ; //only obj can be stored in vector
fromSock.addElement(new Character( (char) intgr.intValue())) ;
//max = input.available() ;
}

char[] fromSocketChars = new char[fromSock.size()] ;

for (int z = 0 ; z < fromSocketChars.length ; z++) {
fromSocketChars[z] = ( (Character) (fromSock.elementAt(z))). charValue() ;
}

String response = new String(fromSocketChars) ;
response = (char) first + response ;

System.out.println(response);
}
}

}
Good answer by Jim Yingst and again a good question from basudev agrawal ,right now i have one another Question in my mind which is :
"NIO is introduce in java1.4 but the web servers those are build on java1.3 how the handle this situation " .
I mean the situation explain by Ivan Jouikov .
Any comments on this :
murad i think u have a fit solution in your mind , calculate the second and pass it to sleep method , let us know your experience
Thanks
For your detail explanation and it really help us in passing 141(!$!) paper.
thanks