| |

VerySource

 Forgot password?
 Register
Search
View: 571|Reply: 1

Using wsdd to deploy services (classes) with * .jar packages gives an error!

[Copy link]

5

Threads

11

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-2-11 22:30:01
| Show all posts |Read mode
The service deployment without * .jar is:
Class name: HelloService.class
Where it is stored: webapps\axis\WEB-INF\classes\
public class HelloService
{
public String sayHello (String username)
{
return "Hello:" + username;
}
}
Write in the server-config.wsdd file:
Where it is stored: webapps\axis\WEB-INF
 ...
 <service name = "HelloService" provider = "java: RPC">
 <parameter name = "className" value = "HelloService" />
 <parameter name = "allowedMethods" value = "*" />
 </ service>
 ...

Question: When the class HelloService needs to support * .jar packages, it will report an error: it cannot find the * .jar packages. Please ask how this situation is deployed?
Reply

Use magic Report

5

Threads

11

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-5-20 10:00:02
| Show all posts
Get it done:
With the * .jar package in the code, put all the * .jar packages used in the right "WEB-INF\lib" directory.

If the code contains the package in the project you wrote, copying the entire directory corresponding to the package to "WEB-INF\classes" is equivalent to treating the package in the project as a class.

If the service is in a package, such as:
package myexcel;

import jxl. *;
import jxl.format.UnderlineStyle;
import jxl.write. *;
import jxl.write.Number;
import jxl.write.Boolean;
import java.io. *;
import java.util. *;
import myBean. *;
import java.io.File;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.RollingFileAppender;
import org.apache.log4j. *;


public class MyExcel {
/ **
     * Read Excel
     * @param filePath
     * /
static final Logger logger = (Logger) Logger.getLogger (MyExcel.class);
The
    public ArrayList readExcel (String filePath)
    {
    ArrayList _myExA = new ArrayList ();
    ...

Then you can only copy this package (that is, the entire directory in the project corresponding to this myexcel package: myexcel) to the "WEB-INF\classes" directory.

It should be written like this in server-config.wsdd:
 <service name = "MyExcel" provider = "java: RPC">
  <parameter name = "className" value = "myexcel.MyExcel" />
  <parameter name = "allowedMethods" value = "*" />
 </ service>

Or do the reverse, and put the * .jar package of axis under the "WEB-INF\lib" directory corresponding to the project. The effect is the same.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list