Java Spring Problem

I'm new to the Spring Framework, and was trying out a tutorial to get started. The details of that tutorial is here:
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step-Part-1.html
I've gotten through the first part up till the point where he says to use the 'list' task ("Let's just quickly start Tomcat and make sure that we can access the application. Use the 'list' task from our build file to see if Tomcat has picked up the new application.") At this point, i get the output is the following:
C:\Springapp>ant list
Buildfile: build.xml
list:
BUILD FAILED
C:\Springapp\build.xml:138: java.net.ConnectException: Connection refused: conne
ct
Total time: 2 seconds
C:\Springapp>
When i put the build on debug mode, I get this output:
C:\Springapp>ant list -d
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.4 in: C:\j2sdk1.4.2_01\jre
Detected OS: Windows XP
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.5 compiled on
June 2 2005
Setting ro project property: ant.file -> C:\Springapp\build.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile C:\Springapp\build.xml with URI = file:///C:/Springapp/build.x
ml
Setting ro project property: ant.project.name -> springapp
Adding reference: springapp
Setting ro project property: ant.file.springapp -> C:\Springapp\build.xml
Project base dir set to: C:\Springapp
+Target:
Adding reference: master-classpath
+Target: usage
+Target: build
+Target: deploy
+Target: deploywar
+Target: install
+Target: reload
+Target: start
+Target: stop
+Target: list
[property] Loading C:\Springapp\build.properties
Setting project property: tomcat.manager.url -> http://localhost:8080/manager
Setting project property: tomcat.manager.username -> admin
Setting project property: appserver.home -> C:/jakarta-tomcat-4.1.30
Setting project property: tomcat.manager.password -> tomcat
Setting project property: deploy.path -> C:/jakarta-tomcat-4.1.30/webapps
Setting project property: src.dir -> src
Setting project property: web.dir -> war
Setting project property: build.dir -> war/WEB-INF/classes
Setting project property: name -> springapp
Could not load a dependent class (com/sun/media/jai/codec/FileSeekableStream) fo
r type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Adding reference: master-classpath
Finding class org.apache.catalina.ant.InstallTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/InstallTask.class
Finding class org.apache.catalina.ant.AbstractCatalinaTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/AbstractCatalinaTask.class
Class org.apache.tools.ant.Task loaded from parent loader (parentFirst)
Class org.apache.catalina.ant.AbstractCatalinaTask loaded from ant loader (paren
tFirst)
Class org.apache.catalina.ant.InstallTask loaded from ant loader (parentFirst)
Class java.lang.Object loaded from parent loader (parentFirst)
Class java.lang.Throwable loaded from parent loader (parentFirst)
Class org.apache.tools.ant.BuildException loaded from parent loader (parentFirst
+Datatype install org.apache.catalina.ant.InstallTask
Finding class org.apache.catalina.ant.ReloadTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/ReloadTask.class
Finding class org.apache.catalina.ant.AbstractCatalinaTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/AbstractCatalinaTask.class
Class org.apache.tools.ant.Task loaded from parent loader (parentFirst)
Class org.apache.catalina.ant.AbstractCatalinaTask loaded from ant loader (paren
tFirst)
Class org.apache.catalina.ant.ReloadTask loaded from ant loader (parentFirst)
Class java.lang.Object loaded from parent loader (parentFirst)
Class java.lang.Throwable loaded from parent loader (parentFirst)
Class org.apache.tools.ant.BuildException loaded from parent loader (parentFirst
+Datatype reload org.apache.catalina.ant.ReloadTask
Finding class org.apache.catalina.ant.ListTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/ListTask.class
Finding class org.apache.catalina.ant.AbstractCatalinaTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/AbstractCatalinaTask.class
Class org.apache.tools.ant.Task loaded from parent loader (parentFirst)
Class org.apache.catalina.ant.AbstractCatalinaTask loaded from ant loader (paren
tFirst)
Class org.apache.catalina.ant.ListTask loaded from ant loader (parentFirst)
Class java.lang.Object loaded from parent loader (parentFirst)
Class java.lang.Throwable loaded from parent loader (parentFirst)
Class org.apache.tools.ant.BuildException loaded from parent loader (parentFirst
+Datatype list org.apache.catalina.ant.ListTask
Finding class org.apache.catalina.ant.StartTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/StartTask.class
Finding class org.apache.catalina.ant.AbstractCatalinaTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/AbstractCatalinaTask.class
Class org.apache.tools.ant.Task loaded from parent loader (parentFirst)
Class org.apache.catalina.ant.AbstractCatalinaTask loaded from ant loader (paren
tFirst)
Class org.apache.catalina.ant.StartTask loaded from ant loader (parentFirst)
Class java.lang.Object loaded from parent loader (parentFirst)
Class java.lang.Throwable loaded from parent loader (parentFirst)
Class org.apache.tools.ant.BuildException loaded from parent loader (parentFirst
+Datatype start org.apache.catalina.ant.StartTask
Finding class org.apache.catalina.ant.StopTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/StopTask.class
Finding class org.apache.catalina.ant.AbstractCatalinaTask
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/ant/AbstractCatalinaTask.class
Class org.apache.tools.ant.Task loaded from parent loader (parentFirst)
Class org.apache.catalina.ant.AbstractCatalinaTask loaded from ant loader (paren
tFirst)
Class org.apache.catalina.ant.StopTask loaded from ant loader (parentFirst)
Class java.lang.Object loaded from parent loader (parentFirst)
Class java.lang.Throwable loaded from parent loader (parentFirst)
Class org.apache.tools.ant.BuildException loaded from parent loader (parentFirst
+Datatype stop org.apache.catalina.ant.StopTask
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `list' is [list]
Complete build sequence is [list, reload, start, install, build, deploy, usage,
stop, deploywar, ]
list:
Class java.lang.String loaded from parent loader (parentFirst)
Class java.io.InputStream loaded from parent loader (parentFirst)
Class java.net.URL loaded from parent loader (parentFirst)
Class java.lang.StringBuffer loaded from parent loader (parentFirst)
Class java.net.HttpURLConnection loaded from parent loader (parentFirst)
Finding class org.apache.catalina.util.Base64
Loaded from C:\jakarta-tomcat-4.1.30\server\lib\catalina-ant.jar org/apache/cata
lina/util/Base64.class
Class org.apache.catalina.util.Base64 loaded from ant loader (parentFirst)
BUILD FAILED
C:\Springapp\build.xml:138: java.net.ConnectException: Connection refused: conne
ct
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:278)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:171)
at org.apache.catalina.ant.ListTask.execute(ListTask.java:95)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:510)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:487)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:228)
... 14 more
--- Nested Exception ---
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:510)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:487)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:228)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:171)
at org.apache.catalina.ant.ListTask.execute(ListTask.java:95)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Total time: 2 seconds
C:\Springapp>
Anybody know what the problem is?

Hi,
Start the server before the build is done,Since the server is not started it gives the error.
Thanks

Similar Messages

  • Getting remote messaging to work with Java/Spring and Flex

    I am trying to get remote messaging working on a Flex client with a Java/Spring backend.
    I have the channel is setup on the server as such:

    channel-definition id="long-polling-channel"
    class="mx.messaging.channels.AMFChannel">
    <endpoint
    url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling"
    class="flex.messaging.endpoints.AMFEndpoint" />
    <properties>
    <!-- Values for near-real time messaging -->
    <polling-enabled>true</polling-enabled>
    <polling-interval-millis>0</polling-interval-millis>
    <wait-interval-millis>-1</wait-interval-millis>
    <max-waiting-poll-requests>
    10
    </max-waiting-poll-requests>
    </properties>
    </channel-definition>
    In the Spring context, I am setting up the MessageBroker, MessageTemplate, and some custom wrapper code:
    <? 
    xml version="1.0" encoding="UTF-8"?>< 
    beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:flex="http://www.springframework.org/schema/flex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/flex
    http://www.springframework.org/schema/flex/spring-flex-1.0.xsd" >
    <flex:message-broker id="messageServiceBroker" />
    <flex:message-destination id="event-bus"
    message-broker="messageServiceBroker" channels="long-polling-channel"
    message-time-to-live="1000"
    subscription-timeout-minutes="5"
    throttle-inbound-max-frequency="500" throttle-inbound-policy="ERROR"
    throttle-outbound-max-frequency="500" throttle-outbound-policy="IGNORE" />
    <bean id="defaultMessageTemplate" class="org.springframework.flex.messaging.MessageTemplate">
    <property name="defaultDestination" value="event-bus" />
    <property name="messageBroker" ref="messageServiceBroker" />
    </bean>
    <bean id="MessagingServices" class="com.bofa.esm.utility.messaging.MessagingServices">
    <property name="messageTemplate" ref="defaultMessageTemplate" />
    <property name="destinationName" value="event-bus" />
    <property name="scheduler" ref="PersistentQuartzScheduler" />
    </bean></ 
    beans>
    The custom wrapper code is insignificant, but it basically creates a thread and posts a custom context over and over every minute.  The actual message is posted with this bit of code:
         messageTemplate.send(msgCtx);
    On the Flex side, I create a Channel and ChannelSet like thus:
    public  
    static function getMessageChannelSet():ChannelSet{ 
    if(messageChannelSet == null){messageChannelSet =
    new ChannelSet();
    //e.g. 'http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling';
    var messageURL:String = getBaseUrl() + MESSAGE_URL; 
    var channel:AMFChannel = new AMFChannel(MESSAGE_CHANNEL_NAME,messageURL);messageChannelSet.addChannel(channel);
    return channelSet;}
    And then, latter I create a Consumer and add the channelset to it:
    var  
    _messageConsumer:Consumer = new Consumer(); 
    var msgChannel:ChannelSet = RemotingUtility.getMessageChannelSet();
    var encrypted:Object = this.encrypt(_sessionModel.username, _sessionModel.password); 
    var token:AsyncToken = msgChannel.login(encrypted.userId, encrypted.password); 
    _messageConsumer.channelSet = msgChannel;
    _messageConsumer.destination =
    "event-bus";_messageConsumer.addEventListener(MessageEvent.RESULT,
    this.onMessage);
    The problem is, I dont get the messages from the server.  In fact, from what I can tell by the logs when I post a message from the server, it doesn't appear that anything is listening to the channel:
    09:32:03,106 INFO [MessagingServices] Posting message...
    09:32:08,184 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
    incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
    timestamp = 1278595928184
    timeToLive = 0
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
    09:32:08,200 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
    incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
    timestamp = 1278595928184
    timeToLive = 0
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
    09:32:08,200 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
    timestamp = 1278595928184
    timeToLive = 1000
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
    to subscribed clientIds: []
    09:32:08,200 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
    timestamp = 1278595928184
    timeToLive = 1000
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
    to subscribed clientIds: []
    09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
    09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
    09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service
    reply: null
    09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service
    reply: null
    09:32:12,075 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
    incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
    timestamp = 1278595932075
    timeToLive = 0
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
    09:32:12,075 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
    incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
    timestamp = 1278595932075
    timeToLive = 0
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
    09:32:12,075 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
    timestamp = 1278595932075
    timeToLive = 1000
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
    to subscribed clientIds: []
    09:32:12,075 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
    clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
    correlationId = null
    destination = event-bus
    messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
    timestamp = 1278595932075
    timeToLive = 1000
    body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
    to subscribed clientIds: []
    09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
    09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
    09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service
    reply: null
    09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service
    reply: null
    Shouldn't the "subscribed clientIds: []" have something listed as subscribed?  What am I missing?

    I made some modifications to the code section that registers the Consumer:
      Alert.show(
    "onRegister running","AppShellMediator",Alert.OK); 
      var _messageConsumer:Consumer = new Consumer(); 
      var msgChannel:ChannelSet = RemotingUtility.getMessageChannelSet();  _messageConsumer.channelSet = msgChannel;
      _messageConsumer.destination =
    "event-bus";  _messageConsumer.addEventListener(MessageEvent.RESULT,
    this.onMessage);  _messageConsumer.subscribe(
    "MessagingClient"+Math.random()); 
    if(_messageConsumer.connected)      Alert.show(
    "Message Channel is connected","AppShellMediator",Alert.OK); 
      if(_messageConsumer.authenticated)      Alert.show(
    "Message Channel is authenticated","AppShellMediator",Alert.OK); 
      if(_messageConsumer.subscribed)      Alert.show(
    "Message Channel is subscribed, clientId: "+_messageConsumer.clientId,"AppShellMediator",Alert.OK);
    I am now calling the subscribe method, then testing to see if the consumer is connected, authorized, and subscribed.  The first two return True, the last one does not.  So, despite the call to subscribe(), the Consumer is not subscribed.  Is there a way to figure out why?  Possibly there was an error somewhere?

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

  • Sun Java security problems

    Please any one tel me about Sun Java security problems
    with Desktop application

    Hi.
    If you're using SSGD 4.41, please download the Admin guide from here:
    http://docs.sun.com/app/docs/doc/820-4907
    There, at page #41 you'll find useful info concerning "Client Connections and Security Warnings".
    Hope this helps,
    Rob

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • Announcing the Java Spring Programming IDE Challenge

    Help promote your favorite Java Spring Programming IDE by taking part in the Java Spring Programming IDE Challenge which is taking place on JavaPocket.net.
    The resulting contest entries will be used to help teach Java Spring Programming. See JavaPocket.net for more details.

    In case you don't have time to partake in the programming challenge right now, at least come take a really short - single page - survey on JavaPocket.net to help us figure out which Java Programming IDE best lends itself to learning Java Spring. Thanks!

  • Java spring question

    Hi there,
    I am trying to learn java spring. Do I need to learn java struct before starting spring.
    Thanks

    My guess is that "java struct" means "Struts".
    It would also help the OP to learn how to reproduce letters from a piece of paper or a computer screen instead of just putting down a similar-looking bunch of letters. Makes Google searching much easier if you copy the data correctly into the little search box.

  • Java Spring - Please Suggest

    Please suggest some good book for Java Spring
    I found that Spring in Action tough for a beginner

    You can expect any text on Spring to be relatively advanced, as they're not meant for entry level programmers.
    You're expected to have a decent understanding of OO concepts especially.
    But yes, the book I mentioned more or less eases you into the whole thing instead of plunging right in.
    The book yawmark mentioned is more of a reference. I've not read it (though I've browsed some sections that I needed at times).
    At the moment I'm working my way through Pro Spring MVC and Web Flow, not recommended as an introductory text on Spring (it assumes you already know the basics).

  • Hibernate - Spring - problem with mapping (many-to-many)

    Hello,
    I want to map the following situation. I have a table called EDUCATION and a table called SCHOOLS. Between those tables I have an associative table called EDUCATION_SCHOOLS. The (usefull) fields:
    EDUCATION:
    id (long) - PK
    name (varchar)
    versionNr (long)
    SCHOOLS:
    id (long) - PK
    name (varchar)
    versionNr (long)
    EDUCATION_SCHOOLS:
    id (long) - PK
    education_id (long) (FK to EDUCATION.id)
    school_id (long) (FK to SCHOOLS.id)
    name (varchar)
    versionNr (long)
    Their is a Unique Constraint between EDUCATION_SCHOOLS.education_id and EDUCATION_SCHOOLS.school_id.
    What I want to be able to do:
    EDUCATION: select, update, insert
    SCHOOLS: select, update, insert
    EDUCATION_SCHOOLS: select, update (only the non-FK fields), insert
    I never want to delete anything in those tables. (and it's never ever going to be an option either)
    Hibernate version:
    Hibernate-Version: 3.0.5
    Mapping documents:
    Education:
    <hibernate-mapping>
         <class name="##.Education" table="EDUCATION">
              <id name="id" column="ID" type="java.lang.Long">
                   <generator class="sequence">
                        <param name="sequence">EDUCATION_SEQ</param>
                   </generator>
              </id>
              <version name="versionNr" column="VERSIONNR" type="long"/>
              <property name="name" column="NAME" type="string" />
            <set name="SCHOOLS" table="EDUCATION_SCHOOLS">
                <key column="EDUCATION_ID" />
                <many-to-many class="##.Schools" column="SCHOOL_ID" lazy="false" />
            </set>
    </hibernate-mapping>
    Schools:
    <hibernate-mapping>
         <class name="##.Schools" table="SCHOOLS">
              <id name="id" column="ID" type="java.lang.Long">
                   <generator class="sequence">
                        <param name="sequence">SCHOOLS_SEQ</param>
                   </generator>
              </id>
              <version name="versionNr" column="VERSIONNR" type="long"/>
              <property name="name" column="NAAM_NAME" type="string" />
            <set name="educations" table="EDUCATION_SCHOOLS" inverse="true" cascade="none">
                <key column="SCHOOL_ID" />
                <many-to-many class="##.Schools" column="SCHOOL_ID" lazy="proxy"/>
            </set>
    </hibernate-mapping>
    Education_schools:
    <hibernate-mapping>
    <class name="##.EducationSchools" table="EDUCATION_SCHOOLS">
               <id name="id" column="ID" type="java.lang.Long" unsaved-value="0">
                   <generator class="sequence">
                        <param name="sequence">SEQ_EDUCATION_SCHOOLS</param>
                   </generator>
              </id>
              <version name="versionNr" column="VERSIONNR" type="long" />
              <many-to-one name="education" class="##.Education" cascade="none" lazy="proxy"
                           column="EDUCATION_ID" not-null="true"/>
            <many-to-one name="schools" class="##.Schools" cascade="none" lazy="proxy"
                        column="SCHOOL_ID" not-null="true"/>  
    </hibernate-mapping>   
    Name and version of the database you are using:
    Oracle XE 10g
    I am able to:
    EDUCATION: select, insert, update
    SCHOOLS: select, insert, update
    EDUCATION_SCHOOLS: select
    Problems:
    EDUCATION_SCHOOLS: when I try to insert, I sometimes get unique constraint violations. (when I should get them, thus I'm trying to insert something that already exists .. but how do I stop Hibernate from Inserting?)
    EDUCATION_SCHOOLS: when I try to update, sometimes it works, but often I get:
    23:03:55,484 [http-8081-1] ERROR be.vlaanderen.lne.vea.epb.ui.struts.EpbExceptionHandler - org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [##.EducationSchools] with identifier [null]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [##.EducationSchools#<null>]
    ex.getMessage() Object of class [##.EducationSchools] with identifier [null]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [##.EducationSchools#<null>]
    org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [##.EducationSchools] with identifier [null]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [##.EducationSchools#<null>]
    Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):As you can see from the stacktrace I use Spring for the transactionManager: org.springframework.orm.hibernate3.HibernateTransactionManager in which I use e sessionFactory: org.springframework.orm.hibernate3.LocalSessionFactoryBean
    In my DAO, I try to save with the regular this.getHibernateTemplate().saveOrUpdate that has always worked for me.
    Another problem I have:
    when i update "name" in EDUCATION, the records with that ID are delete from EDUCATION_SCHOOLS ...
    As I am experiencing 3 different problems, I'm pretty sure something is wrong in the mapping files .. however I fail to find out what .. Any input would be greatly appreciated.
    (I translated some class/table-names, that's what the ## cause)
    Edited by: Bart_Blommaerts on Jul 29, 2008 11:53 PM

    Thank you for your input.
    When I try what you suggest, I still get the same error:
    16:39:30,406 [http-8081-1] ERROR ###.EpbExceptionHandler - org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [###.EducationSchools] with identifier [2]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]
    ex.getMessage() Object of class [###.EducationSchools] with identifier [2]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]
    org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [###.EducationSchools] with identifier [2]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]
    Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]If you had to map the database tables, I'm trying to map, how would you do it?

  • Spring Layout compound spring problem, on container

    I don't understand why these labels are getting resized. This test case is concise and shows the problem clearly, just comment out the line indicated for what the correct behavior I desire is.
    package gaillard;
    import java.awt.Color;
    import java.awt.EventQueue;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.Spring;
    import javax.swing.SpringLayout;
    import javax.swing.SpringLayout.Constraints;
    import javax.swing.border.LineBorder;
    * @author gaillard
    public class Test
         final SpringLayout layout = new SpringLayout();
         final JFrame frame = new JFrame("Test");
         final JPanel contentPane = new JPanel();
         final JLabel label1 = new JLabel("HI");
         final JLabel label2 = new JLabel("HI AGAIN");
         public Test()
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setContentPane(contentPane);
              contentPane.setLayout(layout);
              contentPane.add(label1);
              contentPane.add(label2);
              label1.setBorder(new LineBorder(Color.red));
              label2.setBorder(new LineBorder(Color.green));
              final Constraints label1Con = layout.getConstraints(label1);
              final Constraints label2Con = layout.getConstraints(label2);
              final Constraints contentPaneCon = layout.getConstraints(contentPane);
              Spring strut = Spring.constant(5);
              Spring columnOneWidth = Spring.max(label1Con.getWidth(),
                                      label2Con.getWidth());
              label1Con.setX(Spring.sum(columnOneWidth,
                                Spring.minus(label1Con.getWidth())));
              label2Con.setX(Spring.sum(columnOneWidth,
                                Spring.minus(label2Con.getWidth())));
              label2Con.setY(Spring.sum(label1Con.getHeight(), strut));
              //TRY COMMENTING THIS LINE OUT FOR THE DESIRED BEHAVIOR!!!!
              //TRY COMMENTING THIS LINE OUT FOR THE DESIRED BEHAVIOR!!!!
              contentPaneCon.setWidth(columnOneWidth);
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args)
              EventQueue.invokeLater(new Runnable()
                   @Override
                   public void run()
                        new Test();
    }Edited by: gaillard on Jan 7, 2008 8:49 PM

    is this a bug? Because there are some examples floating around on the web that do similiar such things expecting this code to work, yet when you run their code it doesn't match their screenshot, so perhaps a bug with java 6 or 5?

  • Adobe Dreamweaver CS5.5 - Windows 7 - Java Script Problem

    I am having trouble with Anchor.htm.
    When I try to insert an anchor in the text (Insert > Named Anchor> I get this error message:
    "While executing insertObject in Anchor.htm a Java Script error occurred."
    I recently downloaded both the 32- and 64-bit Java Script applications when I received a message that the existing version of Java Script was out-of-date. Anchor.htm worked before I installed the update.
    The files I downloaded and installed are:
    jre-7u9-windows-i586.exe
    jre-7u9-windows-x64.exe
    Please can anyone help me with this problem?

    From Dreamweaver FAQ
    http://forums.adobe.com/thread/429114
    "If Dreamweaver is acting erratically, or if you see a message saying "the following JavaScript error(s) occurred",  it's usually a sign of a corrupt cache file. The first thing to try should always be to delete the file cache. If that doesn't work, delete your personal Configuration folder. Full instructions are in Deleting a corrupted cache file.
    http://forums.adobe.com/thread/494811"
    Nancy O.

  • Java application problem

    I am using JDK1.4 and working on Windows Xp.
    I have written a code for application in java as follows:
    import javax.swing.*;
    public class sample
    JPanel panel;
    static JFrame frame;
    JButton but;
    public sample()
    frame=new JFrame("frame");
    panel=new JPanel();
    frame.getContentPane().add(panel);
    but=new JButton("click");
    panel.add(but);
    public static void main(String args[])
    sample s=new sample();
    frame.setSize(300,300);
    frame.setVisible(true);
    on executing program application window has appeared and it ran properly.
    Then I closed that application window.But after that in command prompt window curser was just blinking and it was not allow to enter also.
    I have tried pressing CTRL+C also.But situation in command prompt was same i.e curser in command prompt was just blinking.
    Then I closed cmd window ;but one error has occured saying that cmd window can not close .
    My friend has told me that she is also having windows xp and JDK1.4 ; ctrl+c is working properly in her command prompt.She has written the above same code in her computer and it executes properly.
    Even though she has not written following statement:
    "frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);"
    when she exits from application window ,her cmd window gave same problem of only blinking curser.But when she press CTRL+C ; her command prompt starts responding by giving root.But my command prompt is not giving
    positive responce to "ctrl+c" when I am exiting java application.
    Is it possible to solve this problem without giving statement
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ?
    Why my command prompt is not responding to CTRL+c?
    How can I tackle this problem ?
    Is there any other key which can be used in command prompt of Windows Xp?

    Is it possible to solve this problem without giving
    statement
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    ?this is because Swing have started some non-daemon helper threads for its internal purposes and the default close operation for frame is just HIDE_ON_CLOSE. So, the system will not exit because those non-daemon thread still not terminated.
    What is the problems setting the default close operation to JFrame.EXIT_ON_CLOSE ?

  • Java threading problem... threads only work on 1 processor

    I've got a iterative deepening problem that i have to parallelize. As far as i know i did everything correctly however everything seems to be running on 1 processor instead of 2 processors. As far as i know i am using threads (-Xprof either defines them as thread-1 thread-2 or pool1-thread1,depending on the method used for issueing)
    the worker thread is:
    public int solutionsT(Board board, int currentDepth) {
            int temp = 0;
            int result = 0;
            if (board.distance() == 0) {
               return 1;
            if (board.distance() > board.bound()) {
                return 0;
            Board[] children = board.makeMoves();
            result = 0;
            for (int i = 0; i < children.length; i++) {
                if (children[i] != null) {
                    temp = solutionsT(children, currentDepth + 1);
    if(temp != 0){
    result += temp;
    return result;
    public void run() {
    int temp =0;
    int i = 0;
    while(true){
    while(bag.size() !=0){
    bag.putSolution(solutionsT(bag.get(),1));
    try{   
    barrier.await();
    }catch(Exception e){}
    it get's it's input from a bag that is filled before the iteration begins. (once the bag is filled it trips a barrier) this worker thread is a implementation of Runnable
    This piece of code is used to make the thread object and to issue it
    public SolutionThread(int numberOfThreads) {
       thread = numberOfThreads;
       bag = new bagOfBoards();
       barrier = new CyclicBarrier(thread+1);
       if(thread > 1){
          ExecutorService threadExecutor = Executors.newFixedThreadPool( thread );
          solution = new ThreadTest[thread];
          bag = new bagOfBoards();
          for(int i = 0;i<thread;i++){
             solution[i] = new ThreadTest(bag, lock, barrier, i);
             threadExecutor.execute(solution);
    finally this is the code which is used to acces the bag and get a board.
    synchronized public Board get() {
                if (size > 0) {
                size--;
                Board result = bag[size];
                return result;
            } else {
             return null;
        }since this method is synchronized and it always returns something (either null or a board) and the worker tests for this. there is no race condition here.
    furter more. the main thread is a loop. It fills te bags with an intial state. then it trips the barrier and waits for the workers to do the work. the workers then process the bag until it hits zero and then trip the barrier so that the main thread can do the next iteration (and fill the bag)
    p.s. i know the code is a bit messy, but i want to get the threading to work. As of now i relaly don't understand why the threads are just running on 1 processor instead of 2 processors. not only that. the excecution time is nearly the same as that of a sequential equivalent.
    p.s.2 the code is parallisable. and it is run on a smp system.
    Message was edited by:
    jstrike

    i'm very sure that the jvm and os support smp. the
    problem really should be in the code.I don't see how this can be the case. There's nothing in the Java language that deals with how threads are assigned to processors (at least not as far as I know) so there isn't anything you can do in your code to affect that.
    Or did you meant that i have to tell the jvm in the class that
    there is support for multiple processorsThat would be the only possibility. I have no idea whether it can be done or not, though.

Maybe you are looking for

  • Count the varieties of transactions in a day for 15mins interval

    Hi All, I have transaction data for the whole day for multiple transactions like saleID1, saleID2 etc. I need to club them separately in 15 minutes interval and put as a file format. e.g, col1 col2 col3 1 count of transaction A between 2.00-2.15 coun

  • 4200/128 video noise

    Hi,  Wonder if anyone can help me with a problem I get with S-Video In. I get a good picture but there is a line of noise at the top of the picture that I can only describe as video noise(?) It may be data within the video stream, but it's annoying.

  • Regarding the input to tables

    Hi experts, i have created a DB table of my own in se11.. i dont have any data in my database table ..i want to fill the data base table for the fields, that is empid,name ,managerid,dept id etc...using screen painter.. ie in the screen painter if i

  • About the statement - "tables Pernr." Please read.

    Hello everyone, We have to use this statement tables Pernr. to create the internal table for the statement Get pernr. to work. Is it not bad ABAP practice to use the tables statement? What would be the workaround for tables pernr. in that case? Thank

  • Re-Import of LSMW

    To All SAP Guru, Can you help me on this? I created an LSMW (Project:  FI_GUP, Subproject:  FI_GUP and Object: FI_UPLOAD) year 2009 and it was working well until August 2011.  But today,  while the user is using the LSMW,  in the "Assign Files",  a m