Java Service Wrapper
Dear all,
How could I turn the following java application into a service running under Linux and make it started automatically when the system is restarted using Java Service Wrapper?
The instructions on the Java Service Wrapper website is too complex for me to follow. The application below just write the current time to a file every 5 seconds.
If possible, please give me some step by step instruction about how to configure, install and verify the results.
Thanks
Yu
package timertest;
import java.util.Timer;
public class Main {
Timer timer;
public Main(int seconds) {
timer = new Timer();
//timer.schedule(new ReminderTask(),seconds * 1000, seconds * 1000);
ReminderTask task = new ReminderTask();
timer.scheduleAtFixedRate(task,seconds * 1000, seconds * 1000);
public static void main(String[] args) {
System.out.println("About to schedule task.");
new Main(5);
System.out.println("Task scheduled.");
package timertest;
import java.util.TimerTask;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.lang.Thread;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.io.*;
public class ReminderTask extends TimerTask {
public synchronized void run() {
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
try {
// Create file
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
out.write(dateFormat.format(new Date()));
//Close the output stream
out.close();
} catch (Exception e) {//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
I suggest you read how to create a startup script in Linux. It doesn't matter that you program is written in java.
[http://www.google.co.uk/search?q=linux+startup+scripts]
Similar Messages
-
Java Service Wrapper service is not being listed in the list of services
I wrote a sample program which uses Java Service Wrapper. But it's not being listed as a Service in the list of Windows' Services. Any ideas why?
Thanks.Hi Amar,
need your help. i am facing the same issue.
how did you resolved it . please let us know.
Thanks,
Santosh -
Anyone familiar with the Java Service Wrapper?
I'm getting errors when trying to use the Java Service Wrapper. My wrapper.conf file looks like this:
# Wrapper License Properties (Ignored by Community Edition)
# Include file problems can be debugged by removing the first '#'
# from the following line:
##include.debug
#include ../conf/wrapper-license.conf
#include ../conf/wrapper-license-%WRAPPER_HOST_NAME%.conf
# Wrapper Java Properties
# Java Application
wrapper.java.command=%JAVA_HOME%\bin\java.exe
# Tell the Wrapper to log the full generated Java command line.
wrapper.java.command.loglevel=INFO
# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=C:\dbbackup\lib\wrapper.jar
wrapper.java.classpath.2=%JAVA_HOME%\lib\tools.jar
wrapper.java.classpath.3=C:\dbbackup\apps\JavaApplication110.jar
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=C:\dbbackup\lib
# Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE
# Java Additional Parameters
#wrapper.java.additional.1=
# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3
# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64
# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=JavaApplication110.Main
# Wrapper Logging Properties
# Enables Debug output from the Wrapper.
# wrapper.debug=TRUE
# Format of output for the console. (See docs for formats)
wrapper.console.format=PM
# Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO
# Log file to use for wrapper output logging.
wrapper.logfile=../logs/wrapper.log
# Format of output for the log file. (See docs for formats)
wrapper.logfile.format=LPTM
# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=INFO
# Maximum size that the log file will be allowed to grow to before
# the log is rolled. Size is specified in bytes. The default value
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0
# Maximum number of rolled log files which will be allowed before old
# files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0
# Log Level for sys/event log output. (See docs for log levels)
wrapper.syslog.loglevel=NONE
# Wrapper General Properties
# Allow for the use of non-contiguous numbered properties
wrapper.ignore_sequence_gaps=TRUE
# Title to use when running as a console
wrapper.console.title=Test Wrapper Sample Application
# Wrapper Windows NT/2000/XP Service Properties
# WARNING - Do not modify any of these properties when an application
# using this configuration file has been installed as a service.
# Please uninstall the service before modifying this section. The
# service can then be reinstalled.
# Name of the service
wrapper.name=dbbackup
# Display name of the service
wrapper.displayname=dbbackup
# Description of the service
wrapper.description=Test Wrapper Sample Application Description
# Service dependencies. Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=
# Mode in which the service is installed. AUTO_START, DELAY_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START
# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false
STATUS | wrapper | 2010/04/05 19:56:22 |
STATUS | wrapper | 2010/04/05 19:56:22 | Launching a JVM...
INFO | wrapper | 2010/04/05 19:56:22 | command: "C:\Program Files\Java\jdk1.5.0_11\bin\java.exe" -Djava.library.path="C:\dbbackup\lib" -classpath "C:\dbbackup\lib\wrapper.jar;C:\Program Files\Java\jdk1.5.0_11\lib\tools.jar;C:\dbbackup\apps\JavaApplication110.jar" -Dwrapper.key="uDobXEdkbmmNM22u" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=584 -Dwrapper.version="3.4.0" -Dwrapper.native_library="wrapper" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp
INFO | jvm 1 | 2010/04/05 19:56:23 | WrapperManager: Initializing...
INFO | jvm 1 | 2010/04/05 19:56:23 |
INFO | jvm 1 | 2010/04/05 19:56:23 | WrapperSimpleApp Usage:
INFO | jvm 1 | 2010/04/05 19:56:23 | java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]
INFO | jvm 1 | 2010/04/05 19:56:23 |
INFO | jvm 1 | 2010/04/05 19:56:23 | Where:
INFO | jvm 1 | 2010/04/05 19:56:23 | app_class: The fully qualified class name of the application to run.
INFO | jvm 1 | 2010/04/05 19:56:23 | app_arguments: The arguments that would normally be passed to the
INFO | jvm 1 | 2010/04/05 19:56:23 | application.
ERROR | wrapper | 2010/04/05 19:56:24 | JVM exited while loading the application.
STATUS | wrapper | 2010/04/05 19:56:28 | CTRL-C trapped. Shutting down.
STATUS | wrapper | 2010/04/05 19:56:28 | <-- Wrapper StoppedI got it to work. Still not sure what I was doing wrong. I just copied a wrapper config I had for launching JBoss and implemented it into my application.
wrapper.java.command=%JAVA_HOME%/bin/java
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.java.classpath.1=C:/dbbackup/lib/wrapper.jar
wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar
wrapper.java.classpath.3=C:/dbbackup/bin/JavaApplication110.jar
wrapper.java.library.path.1=C:/dbbackup/lib
# these are the JAVA_OPTS
wrapper.java.additional.1=-Dprogram.name=%PROGNAME%
wrapper.java.additional.2=-server
wrapper.java.additional.3=-Xms128m
wrapper.java.additional.4=-Xmx512m
wrapper.java.additional.5=-Dsun.rmi.dgc.client.gcInterval=3600000
wrapper.java.additional.6=-Dsun.rmi.dgc.server.gcInterval=3600000
wrapper.app.parameter.1=javaapplication110.Main
wrapper.logfile=C:/dbbackup/logs/wrapper.log
wrapper.ntservice.name=DBbackup
wrapper.ntservice.displayname=DBbackup
wrapper.ntservice.description=Starts and stops
wrapper.ntservice.starttype=AUTO_START -
JNI -- Windows Service (Java Service Wrapper) -- Winamp
Hi!
I'm developing an application to control Winamp player and this application is supposed to run as a Windows Service (via Java Service Wrapper). Winamp is
handled via JNI (c library dll).
The thing is:
When I start the application as a service, my application tries to control Winamp (eg play, pause) but it doesn't work. I can see (prints) that my application is working but all the calls of the dll that interacts with Winamp don't answer. Instead, when I stop the service, I can see finaly all the prints (I introduced in the dll play, pause functions).
Can anybody give a hand? It seems that the JNI is not working properly (in my humble opinion).
Thanks for your attention.
Best Regards
NunoIn my java application:
System.out.println("Before play!");
play( ); //Native method...
System.out.println("After play!");
sleep(10*1000);
System.out.println("Before pause!");
pause ( ); //Native method...
System.out.println("After pause!");
In c file (dll lib):
JNIEXPORT void JNICALL Java_WinampController_play
(JNIEnv *env, jobject obj) {
printf("-> cpp - Play \n");
initWinampHandle();
if (hwnd_winamp != NULL) {
SendMessageA(hwnd_winamp, WM_COMMAND, WA_PLAY,
WA_NOTHING);
printf("<- cpp - Play \n");
JNIEXPORT void JNICALL Java_WinampController_pause
(JNIEnv *env, jobject obj) {
printf("-> cpp - Pause \n");
initWinampHandle();
if (hwnd_winamp != NULL) {
SendMessageA(hwnd_winamp, WM_COMMAND, WA_PAUSE,
WA_NOTHING);
printf("<- cpp - Pause \n");
Result... (log file)
Before play!
After play!
Before pause!
After pause!
And only after I stop the service, the cpp printf appear... :(
-> cpp - Play
<- cpp - Play
-> cpp - Pause
<- cpp - Pause
Thanks -
I attempted to run RMID by specifying the 'main' class to Java Service Wrapper but ran into trouble with permissions. Even a security policy granting all permissions wasn't sufficient.
Has anyone succeeding in running RMID this way? Or any other way of running it properly as a Windows service (SRVANY doesn't count as it doesn't shutdown RMID cleanly).
When asked to shutdown the service, SRVANY abruptly terminates RMID. This means that any 'child' JVM's remain rather than being shutdown. In addition, on Vista, it often results in an IPv6 port 1098 persisting and blocking a subsequent attempt to restart the service.mthornton wrote:
The problem was Java permissions not operating system permissions. I tested it under my own account.
Have you succeeded in getting rmid running under Java Service Wrapper?I have many apps in production using the Java Service Wrapper but none with rmid, sorry.
You said that you have adjusted the Java permissions.
Did you follow the advice in the FAQ ?
http://wrapper.tanukisoftware.org/doc/english/faq.html#5 -
Why does java service wrapper restarts only 5 times?
Hi, i have a problem in restarting my wrapper on demand.
I have a server and there this wrapper is running. The wrapper provides a service. This service is should be restarted after each call, because of avoiding problems with a memory or resource leak.
In my application i use WrapperManager.restart() of wrapper.jar from http://wrapper.tanukisoftware.org/.
I know that i can set the property wrapper.max_failed_invocations more than 5. But i want to restart the service every time after calling it. What can i do?
The log output is
STATUS | wrapper | JVM requested a restart.
FATAL | wrapper | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | There may be a configuration problem: please check the logs.
STATUS | wrapper | <-- Wrapper StoppedHmm, 159 Watt diff, that's interesting, can't picture Hard Drives using that much, can you disconnect one devie at a time to test it's not them?
-
Java Services In Business Connector supported by XI ?
I am working with the java services of BC and want to convert it into XI.
My question is -the webMethods defined in the java services of BC are accepted by XI or not?
eg. the code in java services of BC is
IDataCursor pipelineCursor = pipeline.getCursor();
This line will be accepted by the XI when imported or will show error?
As (IDataCursor) is BC propriety thing.
From where the meaning of the code written in java services of BC can be obtained.
eg.
String value = configProp.getProperty(configKey, defaultConfigValue);
Here what does getProperty method do?
Thanx.Hi,
my apologies, don't fully understand your question. Are you asking what is the XML structure that a BC Java service can consume?
If that is the question then the answer is: A BC Java service can not consume XML, it consumes IData / IValues objects.
So your question should probably be: How do we build IValues / IData objects from an InputStream?
Answer: Use a Dom or SAX parser and build the corresponding IValues / IData object maps out of that. This is accurately what we have done (+ implemented our own IValues / IData libraries so that we don't use any built-in BC classes in PI to avoid any licensing issues).
The key is to understand how IValues / IData are implemented and how to deal with XML in input / output streams.
We only use this solution internally with our BC2XI product (when requested by the customer) and unfortunately don't provide the libraries separately.
Good luck.
Cheers
Kalle -
How to monitor a java service in windows environment
Hi all,
I have a 5 java services running on a windows box.
I want to monitor one of those. This service is called "appnew " and appnew interacts with the oracle database.
If it is running normally the application name as seen in the task manager is "appnew running" whenever there is some runtime exception the name changes to "appnew error".
now I want to develop some external tool which can send me alert emails when we get runtime exceptions and the service name changes to
"appnew error".
I appreciate your help.
Thanks in advance.The code you are using to change the process name to "appnew error" is the place you want to put your call to an e-mail launch.
-
Running a java service on linux (Redhat)
I can create a basic script to run my java service, I can stop, and restart it from the command line when logged in. I have installed the script as a service. However, when I reboot, the service will not start. I have set it to be the very last thing to start on boot-up. I'm thinking it may have something to do with the fact that when I run a java program, it does not bring me back to the command line, it just 'hangs' until it is completed, and this particular java program will obviously hang indefinitely as it is a service.
Any help would be GREATLY appreciated.
Thanks,
PAUL.Why not start it in the background? (a trailing ampersand)
kind regards,
Jos -
Intermittent problem in Coldfusion 9, BlazeDS with Java Service class and CFCProxy
If that title doesn't scare you, you might be able to help.
I believe there is a bug in Coldfusion 9's version of CFCProxy.
Tech Stack:
Flex Application
BlazeDS (stock with CF9)
Java Service class (java-amf BlazeDS endpoint)
Coldfusion business tier, invoked by the Java Service class using CFCProxy
Tomcat 6 on Java 1.6
Linux or Windows servers, both exhibit same behavior
SQL Server database
Problem:
When Flex calls a Java service method through BlazeDS that invokes a Coldfusion CFC through CFCProxy, and the method called in the Coldfusion CFC includes a large query (10 fields, 1000+ records returned), we intermittently (1 out of ~5 times) receive the following exception:
java.lang.NullPointerException
at coldfusion.runtime.NeoPageContext.popBody(NeoPageContext.java:1925)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:57)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:437)
at coldfusion.cfc.CFCProxyFilter.invoke(CFCProxyFilter.java:56)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:281)
at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:193)
at com.lampo.mapping.service.MapToolWebService.makeCfcProxyCall(MapToolWebService.java:1326)
at com.lampo.mapping.service.MapToolWebService.getTerritoryList(MapToolWebService.java:609)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
at coldfusion.flex.ColdfusionMessageBrokerServlet.service(ColdfusionMessageBrokerServlet.jav a:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:662)
Attempts to diagnose:
These things remove the problem:
CF8 works perfectly with the identical code, never fails.
Calling the same Coldfusion CFC method with the large query (10 fields, 1000+ records returned) from another CFC 100+ times never fails.
Using a Coldfusion service class (a "my-cfamf" BlazeDS endpoint) never fails. However, we need to use a Java service class because we are using ~40 Java value objects (VOs) that correspond to ~40 auto-generated Actionscript VOs. BlazeDS won't correctly deserialize the Actionscript VOs into the Java VOs with a Coldfusion service class.
If I replace the large query with a Sleep(5000) instead, it never fails.
These things don't remove the problem:
Using the latest Microsoft JDBC driver doesn't help.
Even if the Coldfusion method returns an empty resultset (i.e., just calls the query and doesn't do any other work or return anything), the call still fails intermittently.
If the Coldfusion CFC with the method in question is instantiated and stored in SERVER scope as a singleton across multiple requests with CFCProxy, doesn't help.
Different large (1000+ record queries) all fail in the same way.
Caching the query doesn't help
Changes in the datasource configuration doesn't help
Using the older version of BlazeDS doesn't help
With all of these tests, I believe it comes down to a problem in the combination between CFCProxy and large queries. There may be more to it, but that is what we've narrowed it down to.
Any insight would be very welcome.Hi Frank
The page is ADF bound, I've added the page source and the adfc-config source below :
Page
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
<af:form id="f1">
<af:commandButton text="commandButton 1" id="cb1"
actionListener="#{test.testws}"/>
</af:form>
</af:document>
</f:view>
</jsp:root>adfc-config
<?xml version="1.0" encoding="windows-1252" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
<view id="view1">
<page>/view1.jspx</page>
</view>
<managed-bean id="__4">
<managed-bean-name id="__3">test</managed-bean-name>
<managed-bean-class id="__2">ch.mit.test.test</managed-bean-class>
<managed-bean-scope id="__1">request</managed-bean-scope>
</managed-bean>
</adfc-config>It seems to be the same sort of problem as in Re: Error in ADF Web Service Connection
Regards
Paul -
Workflow step (Approve Action) calling custom Java Service and "passing params"
Good Afternoon, Fellow Coders!
Normally I research and do proof of concepts until I find a solution but given super tight deadlines, I just don't have time - so I need your help.
I am trying to have an Workflow Approve Action (Workflow Exit Event idocScript call) call a Custom Component (Java Service) AND "pass" some kind of parameters (bare minimum dDocName)
In a perfect world it would be as simple as: processContentInfo(String dDocName, String xMyCode1, String xMyCode2);
But since I am calling the Java Service from idocScript (via executeService) I cannot directly pass params via the API.
Is there a simple way to do this??
It seems like if you can't directly pass params you could at least set them in the managed container (m_binder) and just know to pick them up on the Java side via some DataBinder like m_binder.getLocal(
Am I missing a simple idocScript function that will let you do this?
Note: I am NOT executing the Service from a URL so the normal ?param1¶m2 -> m_binder.getLocal solution is no good.
Also, Bex's book warns about Service Classes "not easily being able to call other UCM Services".... My Custom Service needs to do exactly that (as well as JDBC and other stuff). Is this really an issue??
Seems like as long as I have dDocName I could use RIDC to hit whatever I want as long as I know how to use a binder, etc - is there some mystic nuance that prevents this? Or was he just saying it's hard UNLESS you know RIDC well??
Any and all quality advice is appreciated! And please, try to give me a detailed answer as opposed to something vague like "try a Service Handler", I need something I can quickly digest.
Thanks in advance!You can set parameters for the service call by setting Idoc Script variables before you call executeService.
<$dDocName="TEST12345"$>
<$param1="09876"$>
<$param2="ABCDEFG"$>
These variables are then available via the service DataBinder.
Here is information about how to execute a service from a custom component. There should not be any issues doing this.
http://www.redstonecontentsolutions.com/5/post/2012/05/executing-a-service-from-aservicehandler.html
http://jonathanhult.com/blog/2012/06/execute-a-service-from-a-java-filter/
Jonathan
http://jonathanhult.com -
RFC adapter not started (Error starting AS Java Service XPI Adapter)
Dear Experts,
We have recently Upgraded our sustem from XI3.0 to PI 7.1, and have encountered a peculiar error in RFC adapter which could not be started
error says: Error starting AS Java Service XPI Adapter: RFC
corresponding instance when started says
Error starting AS Java Service XPI Adapter: RFC on DVEBMGS00
Hence our RFC channels are not functioning
Please help
Regards,
Rana Decan you try to restart XPI Adapter:RFC in NWA. if still it throws error then try to restart java stack.
-
Java Service Launcher Problems
I am trying to get a java application running as a windows service. I have been using java service launcher because it is free and am unable to get the program running. It installs the service fine and if I run jsl -debug or jsl -run then the app executes fine, but if I try to start the service its reports that it cannot be started and then the service gets stuck in Starting. The app recieves messages from another server and uses this info to populate a database.
Thanks,
DI now have the service starting but the app cant seem to connect to the remote computer. It is logging so it must be executing. I have changed the service to run as administartor and restarted the service but it still cant connect.
Thnks,
D -
How to access AM/VO instance from a Java Service class
Hi,
I have a Java service class that is loaded by Java ServiceLoader (http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html) at run time, and I need to access database tables inside that service class. So is there any way that I can access AM/VO instances from that Java class in order to read database table? Thanks.
Regards,
K HeinYou can access an application module with the the two methods below:
YOURAppModule mAM;
public void setUpAM()
throws NamingException
try
String AMDefName = "YOUR_APP_DEF_NAME";
Hashtable env = new Hashtable(2);
env.put(JboContext.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
ApplicationModule am = null;
InitialContext ic = new InitialContext(env);
ApplicationModuleHome home = (ApplicationModuleHome) ic.lookup(AMDefName);
am = home.create();
// Connect the AM to a database connection
String jndiDB = "jdbc/HRDS";
am.getTransaction().connectToDataSource(null, jndiDB, false);
boolean connected = am.getTransaction().isConnected();
mAM = (YOURAppModule) am;
catch (NamingException nex)
// do some error processing
throw nex;
catch (Exception eee)
// do some error processing
throw eee;
public void tearDownAM()
if (mAM != null)
if (mAM .getTransaction().isConnected())
mAM .getTransaction().disconnect();
mAM .remove();
}You find the YOUR_APP_DEF_NAME in your application module under 'Configurations' -> AppModuleJndiName.
Make sure you tear down each AM you set up. Otherwise you are running out of resources pretty fast.
Timo -
Java service call from webdynpro
Hi,
Pls provide me some doc/info on how to call java service from abapwebdynpro platform.
Thanks in advance.Call a web service isn't really a function of WDA. We have the service call wizard, but it only is a code wizard for generating the code to call a proxy class. It doesn't generate the web service proxy. There is nothing special needed for WDA to interact with Web Services. Follow the normal ABAP guides for generating web service proxies and then you can reuse this proxy class in WDA.
Maybe you are looking for
-
CWB Run Progress Report - Not working
Hello Gurus, In CWB, I am unable to run Progress Report of the Plan. System hangs upon hitting "Run Report" after selecting the Plan for which the Progress Report is to be generated. (Eventually I need to close the browser) "BEN:CWB Plan context for
-
I've read of others having font issues with Safari 5.1 and Lion, but I still have Snow Leopard and am having an issue with some fonts showing as a block of As. This occurred when I set up Suitcase Fusion 3, but I did not touch any system fonts. I was
-
Upgrade 10 Mbps connection to 100 Mbps
I replaced my old PC (pentium 4) with a new PC (quad core) in my network (Xbox360 (wired), Wii (wireless), Laptop (wireless) and this PC (wired) on a WRTP54G Voip Router). With my old PC I had no problems, but now I get the message network cable not
-
my daughter's iphone 3 is experiencing problems moving (on its own accord) from loud to silent and vibrating - with the bell symbol being displyed...I am guessing this is a button problem (button top left side). It is out of warranty with Apple. I no
-
please help me to solve my problem...