在此之前,我想让您知道我已经可以连接到Web服务服务器了.我问这个问题是因为我希望深入了解wsimport生成的客户端是如何工作的.根据我的研究,wsimport使用JAXWS.请注意,我不了解JAXWS.
我使用wsimport生成了我的客户端.我使用的WSDL来自Axis2 Web服务,由Axis2自动生成.下面的类是wsimport的结果:
下 com.datamodel.xsd
DataBeanRequest.javaDataBeanResponse.javaObjectFactory.javapackage-info.java下 com.service
MyWebService.javaMyWebServicePortType.javaMyMethod.javaMyMethodResponse.javaObjectFactory.javapackage-info.java使用上面的类,我可以告诉它com.datamodel.xsd包含Web服务服务器使用的bean(不包括ObjectFactory和package-info).同时,MyMethod和MyMethodResponse也用于设置的web服务方法/操作的请求和响应参数豆.
以下是我的问题:(如果你不知道我的一些问题的答案,你真的不必回答所有问题.:)请随时分享你认为我可能会觉得有用的任何信息.)
我是否正确
MyWebService,它包含一个注释,指的是我用来生成客户端的WSDL的绝对位置.wsdllocation在客户端中指定的相关性是什么?客户如何使用该信息?wsimport命令有一个wsdllocation属性,其中wsdllocation可以指定值.)用注释@WebService定义了一个Java接口 编译好的代码
例:
@WebService
public interface HelloWorldIfc{
Run Code Online (Sandbox Code Playgroud)
现在我尝试将端点接口定义为
@WebService (endpointInterface = "com.ws.HelloWorldIfc")
public interface HelloWorldIfc{
Run Code Online (Sandbox Code Playgroud)
这也很好
那么 - 我应该在接口上还是在实现类时定义端点接口?
这是任何用途的属性 - 它的目的是什么?
如果我不定义会发生什么 - 我会失去什么?
谢谢,
饱餐一顿
这是我的代码:
public static void main(String[] args) {
// System.setProperty(
// "javax.xml.xpath.XPathFactory",
// "net.sf.saxon.xpath.XPathFactoryImpl");
String xml="<root><a>#BBB#</a><a>#CCC#</a><b><a>#DDD#</a></b></root>";
try{
JDocument dom = new JDocument(xml);
XPathFactory factory = net.sf.saxon.xpath.XPathFactoryImpl.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expr = xpath.compile("//a[matches(.,'#...#')]");
Object result = expr.evaluate(dom, XPathConstants.NODESET);
NodeList nodes = (NodeList) result;
Nodes sharped = new Nodes(nodes);
for (Node n:sharped){
System.out.println(n.toString());
}
}
catch(Exception e){
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
我得到了这个:
javax.xml.transform.TransformerException: Impossible to find the function : matches
at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:608)
at org.apache.xpath.compiler.XPathParser.FunctionCall(XPathParser.java:1505)
at org.apache.xpath.compiler.XPathParser.PrimaryExpr(XPathParser.java:1444)
at org.apache.xpath.compiler.XPathParser.FilterExpr(XPathParser.java:1343)
at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1276)
Run Code Online (Sandbox Code Playgroud)
这意味着org.apache.xpath.compiler.XPathParser …
我试图在java中创建REST-ful Web服务.这个REST-ful Web服务包含Hibernate配置和Rest-ful配置.实际上java web服务是完美的.但是当我尝试执行该Web服务的客户端代码时.
我正在使用的jar文件是
activation
antlr-2.7.6
asm-3.1
asm-attrs
cglib-nodep
commons-collections-2.1.1
commons-fileupload-1.2.1
commons-io-1.3.2
commons-logging-1.1
dom4j-1.6.1
ehcache-1.2.3
ejb3-persistence
grizzly-servlet-webserver-1.7.3.2
hibernate-annotations
hibernate-commons-annotations
hibernate-entitymanager
hibernate-tools
hibernate3
http
javassist
jaxb-api
jaxb-impl
jaxb-xjc
jdbc2_0-stdext
jdom-1.0
jersey-core-1.7
jersey-server-1.7
jersey-spring
jersey
jettison-1.0-RC1
jsr173_api
jsr311-api
jta
mysql-connector-java-5.1.12-bin
osgi
rome-0.9
wadl2java
Run Code Online (Sandbox Code Playgroud)
我的问题是
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.jersey.spi.inject.InjectableProviderContext.getInjectable(Ljava/lang/Class;Lcom/sun/jersey/spi/service/ComponentContext;Ljava/lang/annotation/Annotation;Ljava/lang/Object;Ljava/util/List;)Lcom/sun/jersey/spi/inject/Injectable;
at com.sun.jersey.spi.service.ComponentConstructor.getConstructor(ComponentConstructor.java:139)
at com.sun.jersey.impl.application.ComponentProviderCache.getComponent(ComponentProviderCache.java:177)
at com.sun.jersey.impl.application.ComponentProviderCache.getProvidersAndServices(ComponentProviderCache.java:122)
at com.sun.jersey.impl.application.MessageBodyFactory.getProviderMap(MessageBodyFactory.java:133)
at com.sun.jersey.impl.application.MessageBodyFactory.initReaders(MessageBodyFactory.java:107)
at com.sun.jersey.impl.application.MessageBodyFactory.init(MessageBodyFactory.java:102)
at com.sun.jersey.api.client.Client.<init>(Client.java:284)
at com.sun.jersey.api.client.Client.<init>(Client.java:209)
at com.sun.jersey.api.client.Client.create(Client.java:429)
at pack1.client.Test.main(Test.java:20)
Run Code Online (Sandbox Code Playgroud)
客户端Java代码是
package pack1.client;
import java.net.URI;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import com.sun.jersey.api.client.Client; …Run Code Online (Sandbox Code Playgroud) 我希望能够在java中导航帧.每当我关闭一帧时,剩下的帧也会被打开关闭;整个程序停止.
请帮忙...
当我部署一个在我的weblogic服务器上有一个servlet的application.war时,它运行正常.它使用一个实例UniversalConnectionPoolManagerMBean并启动正常.
在管理控制台中,我在工作完成时使用stop命令,并在我destroy()调用的方法中调用:
UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager()
.startConnectionPool(mConnectionPoolName);
Run Code Online (Sandbox Code Playgroud)
当我在管理控制台中单击"开始服务请求"命令时,我得到以下异常:
java.sql.SQLException: Unable to start the Universal Connection Pool: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
at com.exzac.dal.jdbc.Database.getConnection(Database.java:134)
at com.exzac.dal.jdbc.Database.executeQuery(Database.java:161)
at com.exzac.profilesystem.ProfileSystemConfiguration.retrieveConfigurationTable(ProfileSystemConfiguration.java:214)
... 49 more
Caused by: java.sql.SQLException: Unable to start the Universal Connection Pool: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: MBean exception occurred while registering or unregistering the MBean
at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:541)
at oracle.ucp.jdbc.PoolDataSourceImpl.throwSQLException(PoolDataSourceImpl.java:587)
at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:276)
at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:646) …Run Code Online (Sandbox Code Playgroud)