Daily Archives

Articles indexed Sunday May 16 2010

Page 6/75 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Metro + Jetty + OSGi = pain

    - by mjgp2
    I am trying to swap out Sun's HTTPServer for the much better Jetty server, within an OSGi bundle, running on Equinox. I have tried this: System.setProperty("com.sun.net.httpserver.HttpServerProvider","org.mortbay.jetty.j2se6.JettyHttpServerProvider"); but when endpoint.publish(url) is called, and the server is spawned, it complains of a ClassNotFoundException for org.mortbay.jetty.j2se6.JettyHttpServerProvider. However, the correct jars are in the bundle, and indeed in the Activator I can instantiate a org.mortbay.jetty.j2se6.JettyHttpServerProvider. I think that this is a some kind of classpath issue - the spawned server is in a different classpath maybe? I have tried adding the JARs in at the JDK level, but this doesn't make any difference. Can oanyone shed any light how on earth to get this working? P.S. Maybe hideous System.setProperty calls will vanish from the world one day. Hopefully :)

    Read the article

  • jax-ws: how to get a handle to start/end of processing incoming soap message

    - by Gerard
    Situation: jax-ws web service on Weblogic appserver; wsdl first development, jaxb customizations in external binding file. I would like to get a handle to the actual jaxb context that will process the incoming soap xml message, before it has been unmarshalled into java objects. Then I would like to get the unmarshaller of this jaxb context - the one that actually will be used during the unmarshalling. And then setup some properties of this unmarshaller (e.g. listener and idresolver).

    Read the article

  • Jaxb2Marshaller and primitive types

    - by Thomas Einwaller
    Is it possible to create a web service operation using primitive or basic Java types when using the Jaxb2Marschaller in spring-ws? For example a method looking like this: @Override @PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/") public long addTask(final Task task) throws AddTaskFault { // do something return 0; } I am using the maven jaxws plugin to generate the interface and model classes from my WSDL. When I try to call the webservice I get the following error: java.lang.IllegalStateException: No adapter for endpoint [...]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint I found out that if I change the method to that: @Override @PayloadRoot(localPart = "AddTaskRequest", namespace = "http://example.com/examplews/") public JAXBElement<Long> addTask(final JAXBElement<Task> task) throws AddTaskFault { final ObjectFactory objectFactory = new ObjectFactory(); return objectFactory.createAddTaskResponse(0L); } I am able to call it - but this signature is not compatible with the interface generated by the maven jaxws plugin. What can I do to configure either spring-ws to be able to use the first kind of implementation or to tell maven jaxws plugin to generate the second variant of the interface? UPDATE: My relevant spring-ws config entries look like that: <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="contextPath" value="com.example.examplews" /> </bean> <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"> <constructor-arg ref="marshaller" /> </bean> <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"> <property name="order" value="1" /> </bean>

    Read the article

  • JAXWS serves only 100 requests, how to configure JAXWS to change it to unlimited?

    - by cbz
    Hello, I'm using JAXWS for generating webservices and serving using EndPoint.publish() as well as deploying war file, but as soon as it has served 100 requests it wouldn't return 101st response. How to configure JAXWS to change this count to unlimited? EDIT: solution found, first of all it was not related to JAXWS and I'm sorry for posting it here, in my first impression I thought problem is with JAXWS but after deep exploring and debugging I found problem with my persistence layer (Hibernate) where max number of sessions allowed are 100 by default. Sorry again for making you guys to think which actually does not make sense.

    Read the article

  • JAX-WS errors when SOAP body contains UTF-8 BOM

    - by Vinny Carpenter
    I have developed a Web Service using JAX-WS (v2.1.3 - Sun JDK 1.6.0_05) deployed on WebLogic 10.3 that works just fine when I use a Java client or SoapUI or other Web Services testing tools. I need to consume this service using 2005 Microsoft SQL Server Reporting Services and I get the following error Couldn't create SOAP message due to exception: XML reader error: unexpected character content SEVERE: Couldn't create SOAP message due to exception: XML reader error: unexpected character content: "?" com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: unexpected character content: "?" at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:292) at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276) at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93) at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432) at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244) at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:134) at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129) at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160) at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Caused by: com.sun.xml.ws.streaming.XMLStreamReaderException: XML reader error: unexpected character content: "?" at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextElementContent(XMLStreamReaderUtil.java:102) at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:174) at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:296) at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128) at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287) ... 22 more If I use a HTTP proxy to sniff out what SSRS is sending to JAX-WS, I see EF BB BF as the beginning of the post body and JAX-WS doesn't like that. If I remove the special characters and resubmit the request using Fiddler, then the web-service invocation works. Why does JAX-WS blow up with the standard UTF-8 BOM? Is there a workaround to get past this issue? Any suggestions would be greatly appreciated. Thanks --Vinny

    Read the article

  • Unit Testing Model Classes that inherits from NSManagedObject

    - by Matt Baker
    So...I'm trying to get unit tests set up in my iPhone App but I'm having some issues. I'm trying to test my model classes but they inherit directly from NSManagedObject. I'm sure this is a problem but I don't know how to get around it. Everything is building and running as expected but I get this error when calling any method on the class I'm testing: Unknown.m:0:0 unrecognized selector sent to instance 0xc2b120 If I follow this structure (http://chanson.livejournal.com/115621.html) to create my object in my tests I end up with another error entirely but it still doesn't help me. Basically my question is this: how can I test a class that inherits from NSManagedObject?

    Read the article

  • How to specify a parameter as part of every web service call?

    - by LES2
    Currently, each web service for our application has a user parameter that is added for every method. For example: @WebService public interface FooWebService { @WebMethod public Foo getFoo(@WebParam(name="alwaysHere",header=true,partName="alwaysHere") String user, @WebParam(name="fooId") Long fooId); @WebMethod public Result deletetFoo(@WebParam(name="alwaysHere",header=true,partName="alwaysHere") String user, @WebParam(name="fooId") Long fooId); // ... } There could be twenty methods in a service, each with the first parameter as user. And there could be twenty web services. We don't actually use the 'user' argument in the implementations - in fact, I don't know why it's there - but I wasn't involved in the design, and the person that put it there had a reason (I hope). Anyway, I'm trying to straighten out this Big Ball of Mud. I have already come a long way by wrapping the web services by a Spring proxy, which allows me to do some before-and-after processing in an interceptor (before there were at least 20 lines of copy-pasted boiler plate per method). I'm wondering if there's some kind of "message header" I can apply to the method or package and that can be accessed by some type of handler or something outside of each web service method. Thanks in advance for the advice, LES

    Read the article

  • Can you return an array from a JAX-WS @WebMethod?

    - by LES2
    I'm pretty sure you can, but in addition to answering the question in the title, could you also explain the pros, cons, caveats, if any, to doing so? I know that you can't return a List, Set, Collection, Map, or any interface, from a WebMethod (which is stupid, IMO, but I don't know what the design reasons were should I should probably withhold judgment). Thanks for any advice. -- LES

    Read the article

  • SwapBuffers calls itself

    - by user146780
    I'm making a Win32 application with OpenGL in the main window (not using GLUT). I have my drawing code in WM_PAINT right now when I call swapBuffers it must be invalidating itself because it is constantly rerendering and using lots of cpu resources. How can I make it only render when it honestly receives WM_PAINT like when using GDI? Thanks

    Read the article

  • How can you handle cross-cutting conerns in JAX-WS without Spring or AOP? Handlers?

    - by LES2
    I do have something more specific in mind, however: Each web service method needs to be wrapped with some boiler place code (cross cutting concern, yes, spring AOP would work great here but it either doesn't work or unapproved by gov't architecture group). A simple service call is as follows: @WebMethod... public Foo performFoo(...) { Object result = null; Object something = blah; try { soil(something); result = handlePerformFoo(...); } catch(Exception e) { throw translateException(e); } finally { wash(something); } return result; } protected abstract Foo handlePerformFoo(...); (I hope that's enough context). Basically, I would like a hook (that was in the same thread - like a method invocation interceptor) that could have a before() and after() that could could soil(something) and wash(something) around the method call for every freaking WebMethod. Can't use Spring AOP because my web services are not Spring managed beans :( HELP!!!!! Give advice! Please don't let me copy-paste that boiler plate 1 billion times (as I've been instructed to do). Regards, LES

    Read the article

  • How do I refer to an instance from inside it's own code in Adobe Flash.

    - by matt1024
    In Adobe Flash, I have a movie clip that is added to the stage when the keyboard is pressed. I want it to travel across the screen and disappear once it reaches the edge of the stage. At the moment I use this but the image appears and then stops. Here is my code: addEventListener(Event.ADDED_TO_STAGE,runtime); var c = 0 function runtime(){ while(this.x<800){ this.x += 12; } removeChild(this); } Thanks

    Read the article

  • How do you configure jax-ws to work with Spring using jax-ws commons?

    - by LES2
    In web.xml I have the following: <servlet> <description>JAX-WS endpoint - EARM</description> <display-name>jaxws-servlet</display-name> <servlet-name>jaxws-servlet</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>jaxws-servlet</servlet-name> <url-pattern>/webServices/*</url-pattern> </servlet-mapping> In my application context I have the following definitions: <bean id="helloService" class="com.foo.HelloServiceImpl"> <property name="regularService" ref="regularService" /> </bean> <wss:binding url="/webServices/helloService" service="#helloService" /> I get a NullPointerException when trying to access the WSDL: java.lang.NullPointerException at com.sun.xml.ws.transport.http.HttpAdapter.<init>(HttpAdapter.java:145) at com.sun.xml.ws.transport.http.servlet.ServletAdapter.<init>(ServletAdapter.java:76) at com.sun.xml.ws.transport.http.servlet.ServletAdapterList.createHttpAdapter(ServletAdapterList.java:5 0) at com.sun.xml.ws.transport.http.servlet.ServletAdapterList.createHttpAdapter(ServletAdapterList.java:4 7) at com.sun.xml.ws.transport.http.HttpAdapterList.createAdapter(HttpAdapterList.java:73) at com.sun.xml.ws.transport.http.servlet.SpringBinding.create(SpringBinding.java:24) at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.init(WSSpringServlet.java:46) Strange ... appears to be a configuration error but the darn thing just dies with a NullPointerException!!!!!!!! No logging is provided. Deployed in Resin.

    Read the article

  • How do I create another controller action to create an object in rails?

    - by Angela
    I have a model called Contact_Email. When an Email template is sent through ActionMailer to a specific Contact, as part of the Create action it sends it through upon .save. However, I want to create a "skip" action which also creates a Contact_Email, but does NOT send an ActionMailer and allows me to set the status differently. I want to create a separate action because I want to make this respond to a remote_for_tag so that I can just have an ajax button indicate it has been "skipped": Here's what I tried, but while it creates a Contact_Email, I end up getting an error when I want to go back and view all the Contacts again. def skip @contact_email = ContactEmail.new @contact_email.contact_id = params[:contact_id] @contact_email.email_id = params[:email_id] @contact_email.status = "skipped" if @contact_email.save flash[:notice] = "skipped email" redirect_to contact_emails_url end end

    Read the article

  • What are the hibernate annotations used to persist a value typed Map with an enumerated type as a ke

    - by Jason Novak
    I am having trouble getting the right hibernate annotations to use on a value typed Map with an enumerated class as a key. Here is a simplified (and extremely contrived) example. public class Thing { public String id; public Letter startLetter; public Map<Letter,Double> letterCounts = new HashMap<Letter, Double>(); } public enum Letter { A, B, C, D } Here are my current annotations on Thing @Entity public class Thing { @Id public String id; @Enumerated(EnumType.STRING) public Letter startLetter; @CollectionOfElements @JoinTable(name = "Thing_letterFrequencies", joinColumns = @JoinColumn(name = "thingId")) @MapKey(columns = @Column(name = "letter", nullable = false)) @Column(name = "count") public Map<Letter,Double> letterCounts = new HashMap<Letter, Double>(); } Hibernate generates the following DDL to create the tables for my MySql database create table Thing (id varchar(255) not null, startLetter varchar(255), primary key (id)) type=InnoDB; create table Thing_letterFrequencies (thingId varchar(255) not null, count double precision, letter tinyblob not null, primary key (thingId, letter)) type=InnoDB; Notice that hibernate tries to define letter (my map key) as a tinyblob, however it defines startLetter as a varchar(255) even though both are of the enumerated type Letter. When I try to create the tables I see the following error BLOB/TEXT column 'letter' used in key specification without a key length I googled this error and it appears that MySql has issues when you try to make a tinyblob column part of a primary key, which is what hibernate needs to do with the Thing_letterFrequencies table. So I would rather have letter mapped to a varchar(255) the way startLetter is. Unfortunately, I've been fussing with the MapKey annotation for a while now and haven't been able to make this work. I've also tried @MapKeyManyToMany(targetEntity=Product.class) without success. Can anyone tell me what are the correct annotations for my letterCounts map so that hibernate will treat the letterCounts map key the same way it does startLetter?

    Read the article

  • Opening Word Document from IE

    - by Nalum
    Hello all, I'm opening a word document through IE on a local network, it opens up fine but if a document is password protected then it should prompt for the password which it doesn't. Is there something that I should be doing to get the password prompt? The way I'm opening the document is by a link on a web page e.g. <a href="\\path\to\file.doc">Document</a> Thanks for any help.

    Read the article

  • Regular Expressions

    - by Rocky
    Hello Everyone, I am new to Stackoverflow and I have a quick question. Let's assume we are given a large number of HTML files (large as in theoretically infinite). How can I use Regular Expressions to extract the list of Phone Numbers from all those files? Explanation/expression will be really appreciated. The Phone numbers can be any of the following formats: (123) 456 7899 (123).456.7899 (123)-456-7899 123-456-7899 123 456 7899 1234567899 Thanks a lot for all your help and have a good one!

    Read the article

  • Possible to split one JAX-WS service across multiple source files?

    - by Rob S.
    Hi everyone, Is it possible to split a web service in to multiple classes and still provide a single path to the web service? I know this isn't possible because of the duplicate url-pattern values. It sort of illustrates where we're wanting to go :) <endpoint name="OneBigService" implementation="SmallImpl1" url-pattern="/OneBigService"/> <endpoint name="OneBigService" implementation="SmallImpl2" url-pattern="/OneBigService"/> Basically, how do avoid having one monolithic @WebService class? Thanks! Rob

    Read the article

  • LINQ query checks for null

    - by user300992
    I have a userList, some users don't have a name (null). If I run the first LINQ query, I got an error saying "object reference not set to an instance of an object" error. var temp = (from a in userList where ((a.name == "john") && (a.name != null)) select a).ToList(); However, if I switch the order by putting the checking for null in front, then it works without throwing any error: var temp = (from a in userList where ((a.name != null) && (a.name == "john")) select a).ToList(); Why is that? If that's pure C# code (not LINQ), I think both would be the same. I don't have SQL profiler, I am just curious what will be the difference when they are being translated on SQL level.

    Read the article

  • cxf jaxws with spring on gwt 2.0

    - by Karl
    Hi, I'm trying to use an application which uses cxf-jaxws in bean definition: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> however in combination with the jetty from gwt 2.0 development shell my context doesn't load and I get this exception: org.springframework.web.context.ContextLoader: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws] enter code hereOffending resource: class path resource [bean_definition.xml] My project is maven-based and I got cxf-rt-frontend-jaxws which contains the namespacehandler and spring.handlers on the classpath. I added cxf-transports-http-jetty.jar as well. Has anyone experienced this kind of problem and found a solution? It seems to be a classpath issue, added the cxf-rt-frontend-jaxws.jar by hand and it works... Somehow the maven dependency doesn't get added to the classpath. Thanks in advance, karl

    Read the article

  • Using JQuery to get text of a div that's a child of a header to replace a different header

    - by Stevie Jenowski
    Hello all, I'm trying to get the text contents of a .div('.child#') child of my event.target('h6.class'), and replace my other headers('h1.replacHeader#') using this script below... $('h6.class').click(function(event) { var $target = $(event.target); $('.replaceHeader1').replaceWith("<h1 class='replaceHeader1'>" + $target.children(".child1").text() + "</h1>"); $('.replaceHeader2').replaceWith("<h1 class='replaceHeader2'>" + $target.children(".child2").text() + "</h1>"); }); }); I've noticed that .text() apparently doesn't apply to an event.target... So how could I go about achieving this?

    Read the article

  • Use Maven to trigger a wsgen & wsimport in a row, using wsdlLocation

    - by ben
    I have hard times using maven to generate my client. So Please refer to http://stackoverflow.com/questions/2131001/creating-a-web-service-client-directly-from-the-source for the first part of my question. To keep it simple and short, I want to go from here (a file in src/main/java) : package com.example.maven.jaxws.helloservice; import javax.jws.WebService; @WebService public class Hello { public String sayHello(String param) { ; return "Hello " + param; } } to there : /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.7-b01- * Generated source version: 2.1 * */ @WebServiceClient(name = "HelloService", targetNamespace = "http://helloservice.jaxws.maven.example.com/", wsdlLocation = "http://localhost:8080/test/") public class HelloService extends Service { private final static URL HELLOSERVICE_WSDL_LOCATION; private final static Logger logger = Logger.getLogger(com.example.wsimport.HelloService.class.getName()); ...etc using only 1 pom.xml file. Please note the wsdlLocation set on the end. The pom.xml file will probably use both maven-jaxws-plugin wsgen AND wsimport with some tricky configuration to achieve this.

    Read the article

  • How to change id value when using Html.DropDownListFor helper in asp.net mvc 2.0?

    - by chobo2
    Hi I have a partial view that has something like this <%= Html.DropDownListFor(m => m.SelectedProductName, Model.ProductList, "Select a Product") %> Now you can create a new product and edit a existing product. Both editing and creating use the same form. The create is on the main page on load up. Edit popus up in a jquery u.i model dialog and renders a new partial view. So as far as the page is concerned is that I have 2 dropdown boxes with the same "id" which is bad since they should be unique. So how do I change the id? So when the edit loads it might have a id of "editSelectedProductName"? I tried to do this in the view model public string SelectedProductName{ get; set; } ViewModelConstructor() { SelectedProductName = "EditSelectedProductName"; } But it seems to not care and keeps using "SelectedProductName" as the product name. Thanks

    Read the article

  • JAX-WS: when input soap validation fails

    - by Jakob
    I have created a web service with JAX-WS. When the input SOAP message is not well formed or can not be validated, a soap fault is returned automatically to the caller. I dont want the caller to receive this standard SOAP message but i want to create an own custom SOAP fault. So if the call looks like this (note Envelope1, its not valid): hello a default return message is something like this: S:Client Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://schemas.xmlsoap.org/soap/envelope/}Envelope1 I want the return message to be something like this: S:Client My own custom SOAP message! I have tried to get this to work the whole day, but i cant figure out how to do it. So if someone could help me I would be really glad!

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >