[Installation, Configuration & DEPLOYMENT] - Re: Automatic deploy with MainDeployer
by jaikiran
>From what i remember, the MainDeployer deploys the application in %JBOSS_HOME%/server/< serverName>/tmp folder. This tmp folder gets cleaned up on restarts.
The last time, when i was playing around with a similar requirement on a sample application, i had deployed my own service using a *-service.xml (which extends MainDeployer) and overriden the deploy method as follows:
|
| public class ExtendedMainDeployer extends MainDeployer {
|
| /**
| * Logger
| */
| protected Logger log = Logger.getLogger(this.getClass().getName());
|
| /**
| *
| */
| public void deploy(URL url) throws DeploymentException {
| String serverDeployFolderPath = System.getProperty("jboss.server.home.dir") + "/deploy/";
| File file = new File(url.getFile());
|
|
| //just copy it to server deploy folder and let the deployer pick it up
| try {
| log.info("Copying " + file.getName() + " to " + serverDeployFolderPath + file.getName());
| copy(url,new File(serverDeployFolderPath + file.getName()));
| } catch (IOException ioe) {
| log.error("Could not copy " + url.getFile() + " to " + serverDeployFolderPath, ioe);
| throw new DeploymentException(ioe);
| }
| }
|
| }
All this piece of code does is it copies the application to the "deploy" folder of JBoss so that the server picks it up for deployment. This way, you dont have to worry about restarts. I am not sure whether this is an option for you, though.
Maybe someone has better ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140577#4140577
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140577
18 years
[JBossWS] - Charset encoding problem from Linux to Windows with Dispatch
by cavani
Hi,
I am using JBossWS Native for client code implementation in a set of Eclipse plugins. At first, I used WSDL2Java approach to generate client code - this works fine with WS-Security and all. But now, I need take advantage of BIRT's WS/XML ODA driver (that uses something like XPath to map XML as tables).
So, I converted all generated code to Dispatch approach with StreamSource. My first problem was with WS-Security with Dispatch not decrypting response. This was fixed with 2.0.4, and works perfectly when server and client are on Linux machines. But when I ran the client on a Windows XP, no accent character is read, but the message are decrypted.
The server is an unmodified AS 4.2.2 (running on linux). Java 5 (13 for linux, 15 for windows bundled together).
I start digging into JBossWS code but could not find an fix yet.
My code (it work fine on linux-linux):
| QName serviceName = new QName("http://tlon.com.br", local);
| QName portName = new QName("http://tlon.com.br", local + "Port");
|
| Service service = Service.create(wsdlLocation, serviceName);
|
| Dispatch<StreamSource> dispatch = service.createDispatch(portName, StreamSource.class, Mode.MESSAGE);
|
| Map<String, Object> reqContext = dispatch.getRequestContext();
| reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
| reqContext.put(BindingProvider.USERNAME_PROPERTY, username);
| reqContext.put(BindingProvider.PASSWORD_PROPERTY, "");
|
| ConfigProvider config = (ConfigProvider) dispatch;
| config.setSecurityConfig(DispatchFactory.class.getClassLoader().getResource("META-INF/jboss-wsse-client.xml").toExternalForm());
| config.setConfigName("Standard WSSecurity Client");
|
| Reader requestReader = new StringReader(requestMessage);
| StreamSource request = new StreamSource(requestReader);
| StreamSource response = dispatch.invoke(request);
| requestReader.close();
| Reader responseReader = response.getReader();
| StringWriter responseWriter = new StringWriter();
| char[] buffer = new char[1024];
| int read = -1;
| while ((read = responseReader.read(buffer)) != -1)
| responseWriter.write(buffer, 0, read);
| responseReader.close();
| return responseWriter.toString();
|
If someone has a good clue, please let me know... if I find a fix I will report here.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140575#4140575
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140575
18 years