Jeff Gaer

Ranch Hand
+ Follow
since Jun 04, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff Gaer

I am attempting to deploy a soap webservice on wildfly 9.0.1-Final. I try to access the WebServletContext by resource injection but it is always null. I do have a beans.xml file in WEB-INF. Following is the class definition.

loadProperties is called from the contstructor.

The deployment always fails with the exception from the null test on the WebServletContext

Thank you in advance for any help
8 years ago
bumping the metro version to 2.2 and changing the scope to provided for all the metro artifacts seemed to fix that particular problem.
8 years ago
I am getting the following error trying to deploy a war file that contains a soap service on wildfly 9.0.1.
It looks like an incompatibility in the webservices implementation. I am using the glassfish version 2.1 implementation and the jars are included in my war file. Any pointers on where I should start to resolve this issue? The application deploys without error on tomcat 7.0.25

JBWS024109: Could not get WSDL contract for endpoint com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationPortImpl at /wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.wsdl"



Runtime environment

wildfly-9.0.1.Final
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Server VM (build 25.51-b03, mixed mode)

build environment
java version "1.7.0_67"

<dependency>
<groupId>org.glassfish.metro</groupId>
<artifactId>webservices-rt</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.metro</groupId>
<artifactId>webservices-tools</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.metro</groupId>
<artifactId>webservices-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>


8 years ago
I apologize if I should ask this in the EJB or JBOSS forums, but it seemed to be a general @Resource questions. I am not sure I understand how the @Resource annotation works. I am running on java 1.7, JEE 6, and JBOSS AS 7.1.

The javax.annotation.Resources documentation indicates that the name parameter is the JNDI name of the resource. But lookups that fail using a JNDI name and thev@Resource annotation succeed when a JNDI context is obtained and used to look up the resource. For example in the code below I can successfully get a mail session if I comment out the @Resource annotation and uncomment the @PostConstruct annotation. In both cases the string I use for JNDI name is "mail/yahoo"



If I run the code as shown attempting to use the @Resource annotation jboss reports the following error:

JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.comp.EJB05EAR.CHAP05EJB.StatusMailerBean.env.mail.yahoo (missing) dependents: [service jboss.deployment.subunit."EJB05EAR.ear"."CHAP05EJB.jar".component.StatusMailerBean.START]

The configuration entry in standalone.xml for the mail session is

<mail-session jndi-name="java:/mail/yahoo" from="jeff_gaer@yahoo.com">
<smtp-server ssl="true" outbound-socket-binding-ref="mail-smtp-yahoo">
<login name="jeff_gaer" password="xxxxxxxxxxx"/>
</mail-session>

I have a similar problem with otherJNDI lookups. I haven't used the @Resource annotation outside of the context of the examples in the "Beginning EJB3" (apress publications),
8 years ago
I have a Junit Test case that is testing some client server code. I create a separate threads to emulate the client and the server and expect to see operations interspersed. However they seemed to run sequentially. Running with debug on in eclipse, it looks as so all the Thread.run() calls are stacked in the same (main) thread. I would have expected that after the new Thread(new myRunnabled()).run a new thread to appear in the debug window. Here's is the stack trace from the main thread and its evident that after the run() methid is called the runnable is executing in the main thread.

The following code executes

Thread thread=new Thread(new Runner());
thread.setDaemon(true);
thread.run();


The first few lines of runnaer are

class Runner implements Runnable{

@Override
public void run() {
boolean first=true;
try {
mockIS.play(

I would expect Runnner to be running in its own thread, but the stack trace indicates it is exectuing in the main thread

Thread.run() line: 662
MockIS.play(String) line: 78
MockISTest$Runner.run() line: 140
Thread.run() line: 662
MockISTest.TestMockIS() line: 85

The full stack trace of the main thread follows.
Thread [main] (Suspended)
SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: not available [native method]
SocketInputStream.read(byte[], int, int) line: 129
SocketInputStream.read() line: 182
AIResponse$Builder(AbstractMessageLite$Builder<BuilderType>).mergeDelimitedFrom(InputStream, ExtensionRegistryLite) line: 276
AIResponse$Builder(AbstractMessage$Builder<BuilderType>).mergeDelimitedFrom(InputStream, ExtensionRegistryLite) line: 705
AIResponse$Builder(AbstractMessageLite$Builder<BuilderType>).mergeDelimitedFrom(InputStream) line: 288
AIResponse$Builder(AbstractMessage$Builder<BuilderType>).mergeDelimitedFrom(InputStream) line: 697
AIResponse.parseDelimitedFrom(InputStream) line: 202
MockIS$Relay.run() line: 87
Thread.run() line: 662
MockIS.play(String) line: 78
MockISTest$Runner.run() line: 140
Thread.run() line: 662
MockISTest.TestMockIS() line: 85
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
TestMethod.invoke(Object) line: 59
MethodRoadie.runTestMethod() line: 98
MethodRoadie$2.run() line: 79
MethodRoadie.runBeforesThenTestThenAfters(Runnable) line: 87
MethodRoadie.runTest() line: 77
MethodRoadie.run() line: 42
JUnit4ClassRunner.invokeTestMethod(Method, RunNotifier) line: 88
JUnit4ClassRunner.runMethods(RunNotifier) line: 51
JUnit4ClassRunner$1.run() line: 44
ClassRoadie.runUnprotected() line: 27
ClassRoadie.runProtected() line: 37
JUnit4ClassRunner.run(RunNotifier) line: 42
JUnit4TestClassReference(JUnit4TestReference).run(TestExecution) line: 50
TestExecution.run(ITestReference[]) line: 38
RemoteTestRunner.runTests(String[], String, TestExecution) line: 467
RemoteTestRunner.runTests(TestExecution) line: 683
RemoteTestRunner.run() line: 390
RemoteTestRunner.main(String[]) line: 197
We had been using a flat schema directory and wsimport was working fine. I broke the schemas out into separate directories and created a catalog using systemSuffix entries to map the schemas to a new path relative to the catalog. I tested the catalog with Oxygen and Eclipse XML editor. Validation works fine, the tools correctly found the relocated schemas (tested using validate ). However when using wsimport I get a lot of errors similar to the following:

[ERROR] 'UnsupportedMessageFailure' is already defined
line 440 of file:/data/catalog.work/wsdefs/foo/ServiceMessageTypes.xsd

[ERROR] (related to above error) the first definition appears here
line 436 of file:/data/catalog.work/wsdefs/foo/ServiceMessageTypes.xsd

The second line number points to the start of the UnsupportedMessageFailure element and and the first line number points to the start of the following element. This is a consistent problem across many of the elements. The fact that errors reference the relocated schemas tell me the catalog is being interpreted. The catalog entries all looks as follows:

<systemSuffix systemIdSuffix="ServiceMessageTypes.xsd" uri="./foo/ServiceMessageTypes.xsd"/>

Schemas/wsdls all work fine with wsimport in a flat directory without catalogs Any help or pointers are appreciated.
11 years ago
Hi all,

I'm kind of a newbie to both maven and jboss. I have jboss 7.1.1 installed an running and am trying to follow the seam example instructions at http://docs.jboss.com/seam/latest/reference/en-US/html/tutorial.html#d0e435. I get lost on the following step,

Once you've set the location of JBoss AS and started the application server, you can build any example by typing mvn install in the example root directory. Any example is deployed by changing directory to *-ear or *-web directory in case of existence only *-web submodule. Type in that submodule mvn jboss-as:deploy. Any example that is packaged as an EAR deploys to a URL like /seam-example, where example is the name of the example folder, with one exception. If the example folder begins with seam, the prefix "seam" is ommitted. For instance, if JBoss AS is running on port 8080, the URL for the registration example is http://localhost:8080/seam-registration/, whereas the URL for the seamspace example is http://localhost:8080/seam-space/.



The mv install step completed without errors, but I don't see any directories created ending with war or ear .I am guessing there is a cd step missing somewhere. There was a war file under ./target and I tried

mvn jboss-as:deploy seam-booking.war

but got the following errorl

[ERROR] No plugin found for prefix 'jboss-as' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/jgaer/.m2/repository), jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

Thanks in advance for any help
11 years ago
I can get my web applications to log with out a problem but I dont see any messages from the tomcat server when I configure for log4j. Followed the instrucations at http://tomcat.apache.org/tomcat-6.0-doc/logging.html replacing the tomcat-juli.jar file in $CATALINA_HOME/bin with the one from extras and placing the log4j.jar and tomcat-juli-adapters.jar in the lib directory. Running with log4j debug I can see the categories registered. But never see any output from those categories. I do see the output if I replace the logging.properties file which causes the catalina.sh to use the default logging.
log4j: Handling log4j.additivity.org.apache.catalina=[null]
log4j: Parsing for [org] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org set to WARN
log4j: Handling log4j.additivity.org=[null]
log4j: Parsing for [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]] with value=[DEBUG, TOMCAT, TSOCK].
log4j: Level token is [DEBUG].
log4j: Category org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager] set to DEBUG
log4j: Parsing appender named "TOMCAT".
log4j: Appender "TOMCAT" was already parsed.
log4j: Parsing appender named "TSOCK".
log4j: Appender "TSOCK" was already parsed.
log4j: Handling log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]=[null]
log4j: Parsing for [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]] with value=[DEBUG, TOMCAT, TSOCK].
log4j: Level token is [DEBUG].
log4j: Category org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] set to DEBUG
log4j: Parsing appender named "TOMCAT".
log4j: Appender "TOMCAT" was already parsed.
log4j: Parsing appender named "TSOCK".
log4j: Appender "TSOCK" was already parsed.
log4j: Handling log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]=[null]
log4j: Finished configuring.

Any help would be appreciated.
12 years ago
I 've been using the @schemavalidation tag successfully with Metro 2.0 with simpler schemas, but a recent update to our schemas has cause the attached error to occur IFF schemavalidation is on. The service functions correctly if it is not. I have been able to validate messages against the schemas used to generate the services using tools like Oxygen. The error occurs at server startup not in response to a particular in or out bound message. Looking at the error messages it looks like the metro framework builds the schemas from the annotations in the generate code and is failing at doing that. I make that assumption since the schema names in the errors do not match the schemas used to generate the code. I had hoped that the wsdlLocation attribute on the @webservice annotation or the sun-jax-ws definitions would solve that issue ( wsdl and all schemas are deployed to WEB-INF/wsdl directory). I understand the cause to be an abstract base class but don't want to constrain the interface developers from using valid schema constructs. In a nutshell is there any way to force the metro framework to take the top down approach and validate against the schemas used to generate the code instead of a bottom up approach of reading the annotations and regenerating the schemas from the generated code?

Dec 3, 2010 8:16:50 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'ns1:MessageType'. It was detected that 'ns1:MessageType' is in namespace 'http://schemas.ticomgeo.com/2010/geonet/common/ServiceMessageTypes/v0', but components from this namespace are not referenceable from schema document 'file:/AudioStreamServicesPortImplService_schema1.xsd'. If this is the incorrect namespace, perhaps the prefix of 'ns1:MessageType' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/AudioStreamServicesPortImplService_schema1.xsd'.
javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'ns1:MessageType'. It was detected that 'ns1:MessageType' is in namespace 'http://schemas.ticomgeo.com/2010/geonet/common/ServiceMessageTypes/v0', but components from this namespace are not referenceable from schema document 'file:/AudioStreamServicesPortImplService_schema1.xsd'. If this is the incorrect namespace, perhaps the prefix of 'ns1:MessageType' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/AudioStreamServicesPortImplService_schema1.xsd'.
13 years ago
I'm having trouble getting to code examples now that oracle has rearranged the web pages. Most of the google links are invalid going to the old sun URLS. Links off off the new oracle JMF page http://www.oracle.com/technetwork/java/javase/solutions-137579.html seem to all go to pages without content, i.e http://www.oracle.com/technetwork/java/javase/rtptransmit-136848.html goes to a generic oracle page with no specific content. I am using firefox 5.0 as a browser on RedHat 5. Is anyone else experiencing this? Can I download the contents via ftp from somewhere?
13 years ago
To answer my own question

Service service = new Service();
port = service.getPort();
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
13 years ago

I'm having problems trying to implement a callback that has a client defined endpoint. I used wsimport to build the interfaces.
I did a simple implementation of the callback method that just printlns a message. Every thing works fine if I dont try to override the
endpoint and just use the endpoint defined in the wsdl that the code was generated from.

cbService=new AudioStreamCallbackServices();
cbPort=cbService.getAudioStreamCallbackServicesPort();

However if I try to pass in a url the constructor for the service throws an exception


SEVERE: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackServices is not a valid service.
Valid services are: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackPortImplService
javax.xml.ws.WebServiceException: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackServices
is not a valid service. Valid services are: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackPortImplService
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:233)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:178)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:106)

The url in the wsdl is

<soap:address location="http://localhost:8055/AudioStreamCallback/"/>

I have tried building urls from

http://localhost:8055/AudioStreamCallback/
http://localhost:8055/AudioStreamCallback
http://localhost:8055/AudioStreamCallback?wsdl

I get the same result when I used the contructor that accepts a url , In each case I can see the schemas streaming back to the service that
is calling the callback (using tcpmon).

The annotations in the generated Service proxy are
private final static QName AUDIOSTREAMCALLBACKSERVICES_QNAME =
new QName("http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0", "AudioStreamCallbackServices");

I grepped my entire source tree for AudioStreamCallbackPortImplService and it doesnt occur, but I do see the sample name as the
service name when I use the Oxygen WSDL soap analyzer so it must be generated by jax-ws based on the schema contents.

find . -exec grep AudioStreamCallbackPortImplService {} \;

Simple question is what is the easiest way for me to dynamically set the service endpoint address at run time.
13 years ago
I know I am missing something obvious, but creating a connection with the following code on java 1.4.2 the content length is always 0 even though it is explicitly set.

URL url = new URL("http://localhost:" + port);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
String testData="this is a test!";
String LEN_HDR="Content-Length";
String TYPE_HDR="Content-Type";

conn.setRequestProperty(TYPE_HDR,"text/html");
conn.setRequestProperty(LEN_HDR,String.valueOf(testData.length()));
conn.setRequestProperty("TEST"+LEN_HDR,String.valueOf(testData.length()));
conn.setDoOutput(true);
conn.setRequestMethod("POST");

OutputStream os = conn.getOutputStream();
PrintStream ps = new java.io.PrintStream(os);
ps.println("test");
ps.flush();

here are the headers are received on the server


POST / HTTP/1.1
Content-Type: text/html
Content-Length: 0
TESTContent-Length: 15
User-Agent: Java/1.4.2
Host: localhost:91
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

Thanks in advance for any help

Jeff
Trying to create some webservice interfaces for methods that take maps as parameters. I think I have the wsdl correct and am guessing that the wizards just dont support collectin types correctly. I get the message

iwab0237w the sample jsp client does not support arrays:item correctly.


If anybody can point me to some examples/tutorials on the web that deal specifically with handling HashMaps or Collections in general in wsdl and JAX RPC particulary in working with them on WSAD and websphere I'd appreciate it. I've found lots of links for complex types and beans but few collection examples beyond arrays. And not a lot on handling untyped (any) objects in the collection.


for referencer here is the wsdl I was using to test a bean that echos back the contents of a map. I couldnt get anythign to work without specifically typing the keys and values as strings, but figured better to start simpled.
<?xml version="1.0" encoding="UTF-8"? >

<wsdl efinitions targetNamespace="http://sample" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://sample" xmlns:intf="http://sample" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<wsdl:types >
<schema elementFormDefault="qualified" targetNamespace="http://sample" xmlns="http://www.w3.org/2001/XMLSchema" >
<element name="sendMap" >
<complexType >
<sequence >
<element name="item" minOccurs="0" maxOccurs="unbounded" >
<complexType >
<sequence >
<element name="key" type="xsd:string"/ >
<element name="value" type="xsd:string"/ >
</sequence >
</complexType >
</element >
</sequence >
</complexType >
</element >
<element name="sendMapResponse" >
<complexType >
<sequence >
<element name="sendMapReturn" type="xsd:string"/ >
</sequence >
</complexType >
</element >
</schema >
</wsdl:types >
<wsdl:message name="sendMapRequest" >
<wsdl art element="intf:sendMap" name="parameters"/ >
</wsdl:message >
<wsdl:message name="sendMapResponse" >
<wsdl art element="intf:sendMapResponse" name="parameters"/ >
</wsdl:message >
<wsdl ortType name="mapPort" >
<wsdl peration name="sendMap" >
<wsdl:input message="intf:sendMapRequest" name="sendMapRequest"/ >
<wsdl utput message="intf:sendMapResponse" name="sendMapResponse"/ >
</wsdl peration >
</wsdl ortType >
<wsdl:binding name="sendMapSoapBinding" type="intf:mapPort" >
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/ >
<wsdl peration name="sendMap" >
<wsdlsoap peration soapAction=""/ >
<wsdl:input name="sendMapRequest" >
<wsdlsoap:body use="literal"/ >
</wsdl:input >
<wsdl utput name="sendMapResponse" >
<wsdlsoap:body use="literal"/ >
</wsdl utput >
</wsdl peration >
</wsdl:binding >
<wsdl:service name="sendMapService" >
<wsdl ort binding="intf:sendMapSoapBinding" name="sendMap" >
<wsdlsoap:address location="http://localhost:9080/map/services/sendMap"/ >
</wsdl ort >
</wsdl:service >
</wsdl efinitions>
[ May 12, 2005: Message edited by: Jeff Gaer ]
18 years ago
My understanding is that the jsp:usebean tag should instantiate a bean if it can not find it. However the code generated from jps in wsad 5.1 throws an execption in that case. Is this wrong or am I misunderstanding. I came across this after I realized that usebean tags failed unless I used the IDE to generate them.


// end
// begin [file="/iteratorTest.jsp";from=(25,0);to=(26,53)]
test.stubs.iterator.TestList tableTest = null;
boolean _jspx_specialtableTest = false;
synchronized (session) {
tableTest= (test.stubs.iterator.TestList)
pageContext.getAttribute("tableTest",PageContext.SESSION_SCOPE);
if (tableTest == null)
throw new java.lang.InstantiationException ("bean tableTest not found within scope ");
}
if(_jspx_specialtableTest == true) {
// end
// HTML // begin [file="/iteratorTest.jsp";from=(26,53);to=(27,0)]
out.write("\r\n");
19 years ago