|
What on earth is this supposed to be? You have not bothered to format your code to make it readable, you have not asked a question, and you have not given any indication of what your problem might be.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Your code is just black - mine is colorful, has structure and COMMENTS.
This certainly has something to do with your problem.
regards,
Torsten
I never finish anyth...
|
|
|
|
|
Please read the posting guidelines before posting. Nobody is going to answer such a badly presented "question" (it's even not a question, just a badly formated and unreadable code dump).
|
|
|
|
|
what the......... my eyes became dizzy by seeing it
|
|
|
|
|
no text, no question, unformatted code
|
|
|
|
|
You can't digest if you try to eat here like this
|
|
|
|
|
if you have ever tried it successfully, please send me some sample code
find it here:
here[^]
please do provide a sample for servlet/jsp
i am trying it in netbeans 6.7 but netbeans gives error in AAUtils methods and doesnt run the project after implementation.
|
|
|
|
|
Hey!
I'm setting up a tool which leaves my little "java world" and starts or stops some windows processes on a server.
Those processes do hand back some values about their state and various stuff:
SERVICE_NAME: servicename
TYPE : 10 WIN32_OWN_PROCESS
STATE : 3 STOP_PENDING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x2710
The Code:
private boolean execCommand(final String strService, final String strCommand){
try{
Runtime rt = Runtime.getRuntime();
Process oProcess = rt.exec("sc " + strCommand + " " + strService);
return evaluateResult(oProcess);
}
catch (IOException oException) {
openErrorDialog("Service Command Error",
"The service " + strService + " could not be " + strCommand + "." );
return false;
}
}
private boolean evaluateResult(final Process oProcess) throws IOException {
return true;
}
How do i react to this
Do I have to slice these Strings to get the STATE value - which will be a ugly mess?
Or is this the output of an object? is this return value standardized?
regards,
Torsten
I never finish anyth...
|
|
|
|
|
Not enough coffee - that's all I can give as explanation
The above shown output - of course! - refers to the Service Controller, that I'm currently using for dispatching my commands
!
triple D'oh!
So now I'm gonna get me a coffee and go on
EDIT:
got my coffee - and remembered to reach in a solution:
Service Control @ SS64.com
SC QUERY @ http://technet.microsoft.com
regards
Torsten
I never finish anyth...
modified on Wednesday, December 8, 2010 8:03 AM
|
|
|
|
|
Hi friends,
I am doing a Java application in which i have two .java files (Connect.java and Handler.java).In Connect.java i have a function where i am getting some values from some other Response.java file . Now i need to pass these values as input parameters to a function in Handler.java . Following is my java file.Can any one help me please...? How can i implement my Handler.java file if it has a function handle() which takes in the parameters from Connect.Java as input..?
Connect.java
public class Connect
{
private Response obj_response;
public String UserId;
public String LocationIpAddress;
public String PassWord;
public Connect(Response p_response)
{
obj_response=p_response;
}
public Response handleConnect()
{
try
{
String UserId=obj_response.getUserId();
String LocationIpAddress=obj_response.getLocationIpAddress(); String PassWord=obj_response.getPassWord();
}
catch(IOException e)
{
System.out.println("IO Exception");
}
return null;
}
}
modified on Tuesday, December 7, 2010 7:07 AM
|
|
|
|
|
did i miss some? or is it about the method handle() - which takes no arguments? in this case - override or modify it.
by the way - why do you start variables with a capital letter?
regards,
Torsten
I never finish anyth...
|
|
|
|
|
I have a Handler.java class in which i need to use a function handler() which should take in the parameters from Connect.java file's method handleConnect() as input .Also handleConnect() return type is a class(Response)I dont know how to accomplish that..?can u please help me and also explain how is that to be done.?
|
|
|
|
|
|
Ah - now I see what you mean (or at least I think I do so).
You fault was not to follow simple rules. Use the naming conventions - use Checkstyle.
If you do so, you will realize, that Response is a typ of object and not a variable. You need to differ between what is a name of a variable/member (starts with lower character) and what is a type (starts with upper character).
So if you write your method handle() in class Handler like this:
public void handle(final Response aResponse){
}
...it should do the job. Then you can use the Object Response and squeeze your info from it.
regards
Torsten
I never finish anyth...
|
|
|
|
|
Function handle() needs to be rewritten as handle(function arguments here) . Perhaps you have not explained your problem too clearly.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
hi all.
I using netbean 6.9.1 and using web(GlassFish). but when run web, it error ==> "glassfish server 3 start failed"
please help me
thanks
nothing
|
|
|
|
|
most servers have a log file. Did you look for it?
|
|
|
|
|
did you checked that there is no other server or program which is using same port as your glassfish, besides as a tip glassfish is stupid ,it gives problem many times or you can say its still incomplete or buggy, better use tomcat(not installer for netbeans) or sun java application server.
|
|
|
|
|
If you take a look to Server Tab in NetBeans IDE, probably you'll find that needs an inexistent file into ../domains/domain1 folder. Try to start it from IDE without any project (Start Server) or manually from <<install_dir>>/glassfish/bin/startserv.
Best Regards
|
|
|
|
|
May be that you are having another server listening on the same port. Stop other services on the port and then start the GlassFish server. If there is no other problem it should run cool.
|
|
|
|
|
I am having a ComServer, and its outlined functions are implemneted in C++. Below is the Cpp function.
HRESULT cIntuneServer::GetActiveProjectName( BSTR* nameOfProject)
{
CComBSTR projectName(L"\\Default\\");
*nameOfProject = projectName;
return S_OK;
}
I tried to implement the same function in Java:
JIString outStr = new JIString("");
dispatch.callMethod("GetActiveProjectName", new Object[]{outStr});
System.out.println("Out String = "+outStr.toString();
OUTPUT:
Out String = [Type: 1 , []]
How do i implement this in java?, I knew i am doing something worng, how do i get the BSTR* value to the OutStr in Java?
|
|
|
|
|
I'm not a JNI expert but a quick google search suggests this is not so straight-forward. Here is how one person describes it:
a BSTR is a funky kind of Microsoft String object, and converting between them and C strings is complicated (and from there to Java Strings adds yet another step)
Google "BSTR java string" brings up lots of articles about it. One of them may help.
|
|
|
|
|
My guess is the question is incomplete.
Java doesn't access random dll methods.
One must use JNI to do it.
I believe the poster is using a dynamic 3rd party wrapper for JNI because a similar post with info to that effect showed up in the Oracle Java forums.
|
|
|
|
|
You are right jschell, i posted it at oracle forums too, the thing is no one was actually helping at the J-Interop forum, so i have been posting at some other good forums for help etc...
My only aim is to read a string from a cpp function, doesn't matter if i am using a wrapper. At least if someone could help me how to do this using Native or Standard Java without a wrapper like an example or something. Maybe i can proceed from there.
|
|
|
|
|
Having a C++ written class, you need to convert it into a shared library (so or DLL); for example, suppose you can embed the snippet you are using in C++ (the one you posted before) into a function like LPSTR yourSnippet(). You can dynamically link the generated shared library from Java using: static {System.loadLibrary("libreria.dll");} and declaring method as native : native String getCadena();
When building wrapper header file (with javah) you'll see in .h file type corresponging :
JNIEXPORT jstring JNICALL <<java_function_name>>_getCadena (JNIEnv *, jobject)
You just have to write a C file including the generated header file you builded with javah, and implement <<java_function_name>>get_Cadena function with: return yourSnippet(); . Just compile and link them as shared library 'libreria.dll' and you got it!
I hope helped you.
Best Regards.
|
|
|
|