w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Grails app fails to load on tomcat
There is a bug in plugin-config grails plugin at 0.1.5 version. It has been already fixed in version 0.1.8. We using quartz2 plugin which enforced 0.1.5 version to our app. So I have excluded plugin-config from quartz2 and added latest version.

Categories : Spring

Error creating bean with name 'transactionManagerPostProcessor' while deploying grails application on tomcat
url = "jdbc:h2:file:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000" refers to a H2 file database. Can you try using in memory prodDb instead if the intention was not to refer to a file database? url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"

Categories : Java

Netbeans fails to deploy to Tomcat 7, works with Tomcat 6
I spent several hours today with this and find a solution minutes after posting here. In Netbeans I had to delete Tomcat from the list of servers then manually add it back with all the same information. Netbeans must save details about the server the first and only time it connects.

Categories : Tomcat

How can I tell if a specific Mongo instance has active connections?
The cursorInfo command should work. If there are no more cursors, then it's ok to shut off the mongos. Any connections that still exist will simply fail over to another mongos through the load balancer when they try to reconnect (assuming they have an appropriate reconnection policy in place). The only thing you need to worry about is cursors, since they have state, which is taken care of by cursorInfo.

Categories : Mongodb

Number of max concurrent connections for nodejs+mongo db for simple insert operations
Your problem is your operating system, you need to tune it for that kind of load. Have you considered linux instead? It's significantly more powerful and stable than Windows, and unlike Windows (which is purposefully "crippled" (low TCP default limits) to encourage upsell), Linux comes out-of-the-box ready for much higher workloads, and can also be tuned for 10x better performance than Microsoft.

Categories : Mongodb

Tomcat PoolExhaustedException - How to count connections?
found a way to count number of db2 connections per DB per IP address db2 list applications for database <databaseName>| grep db2jcc_applica | grep -c <ip_address> This will show all connections to the particular coming from an ip_address. If the DB server is within your local Server, the ip_address would be "127.0.0.1"

Categories : Java

Exception determining maxBSONObjectSize/connection refused because too many open connections using Mule Mongo Connector
There was a connection leaking issue affecting the mongo connector. It has recently being addressed and it will be part of the next release.

Categories : Mongodb

Tomcat blocking when handle huge HTTPS connections
change maxThreads value to hit count on server.xml file and check <Connector port="****" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" />

Categories : Java

SSH Connections one after another, second one fails
According to the documentation, exec doesn't block. Trying using exec! instead. Net::SSH.start(self.to_creds['host'], self.to_creds['user'], :password => self.to_creds['password']) do |ssh1| # Do some other stuff here tmp_path = "#{self.to_creds['filepath']}/tmp/#{Time.now.to_i}" ssh1.exec! "mkdir -p #{tmp_path}" ssh1.exec! "cd #{self.to_creds['filepath']}/#{new_client_id}" end Alternatively, Net::SSH.start(self.to_creds['host'], self.to_creds['user'], :password => self.to_creds['password']) do |ssh1| # Do some other stuff here tmp_path = "#{self.to_creds['filepath']}/tmp/#{Time.now.to_i}" ssh1.exec "mkdir -p #{tmp_path}" ssh1.exec "cd #{self.to_creds['filepath']}/#{new_client_id}" ssh1.loop end

Categories : Ruby

Cannot authenticate into mongo, "auth fails"
It appears the problem is that a user created via the method described in the mongo docs does not have permission to connect to the default database (test), even if that user was created with the "userAdminAnyDatabase" and "dbAdminAnyDatabase" roles.

Categories : Mongodb

Grails performance: XML processing 4x slower in tomcat than run-app?
The service provider mechanism determines which class is used as the implementation of XPathFactory. A JAR file on the class path that contains the file META-INF/services/javax.xml.xpath.XPathFactory can replace the default implementation in the JRE. Most likely, the class path is different for development and production environments in your case. To check which implementation is used you can print XPathFactory.newInstance().newXPath().getClass(). The internal implementation in the JRE is com.sun.org.apache.xpath.internal.jaxp.XPathExpressionImpl.

Categories : Performance

Spring mongo read conversion fails for beans inside a map
Solved with hacks described in http://forum.springsource.org/showthread.php?139797-SOLVED-custom-write-converter-on-updating-entity-that-contains-a-map&p=450945#post450945

Categories : Mongodb

Grails quartz plugin is not working when deployed in Tomcat
I would suggest doing a: grails clean and also deleting the .slcache folder, that you can find under ~/.grails/.slcache regards

Categories : Grails

I want to integrate tomcat and apache using mod_jk for my grails application
ProxyPass is a directive used by mod_proxy not mod_jk. If you want to use mod_jk use: JkMount /appName/* workerApp For this to work you need to configure the module (/etc/apache2/mods-available/jk.load): LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so JkWorkersFile /etc/apache2/workers.properties JkLogFile /var/log/apache2/mod_jk.log JkLogLevel debug JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " then add a worker (/etc/apache2/workers.properties): workers.tomcat_home={PATH_TO_TOMCAT} workers.java_home={PATH_TO_JVM} ps=/ worker.list=workerApp worker.workerApp.port=8009 worker.workerApp.host=localhost worker.workerApp.type=ajp13 worker.workerApp.lbfactor=1 Be sure this line is not commented in Tomcat server.xml: <Connector port="8009" address= "127.0.0.1" enableLookups= "

Categories : Apache

Upgraded Grails app compiles but goes straight to Tomcat 404 Page
Try the following : grails clean grails refresh-dependencies grails run-app --stacktrace If it still fails: Increase the log level to debug Compare core dependencies between your app and a freshly create app, and update dependencies as needed Check the grails version compatibility of your third-party plugins and third-party dependencies, update as needed Repeat the grails clean, refresh-dependencies steps. If it still fails, delete the .grails/projects/YOUR_GRAILS_VERSION/PROJECT_NAME and repeat the initial steps. Hope it helps

Categories : Tomcat

Tomcat connection pool fails, but nothing in log
From what I see it could be: The database server is down Database server was up but there was a network problem causing your application not being able to contact database server (cable disconnected, firewall, etc.)

Categories : Hibernate

Java servlet (tomcat) track multiple jdbc connections to multiple databases
You can instantiate the Tomcat's Connection Pool in your servlet. It should look like this: public class YourServlet extends HttpServlet { private DataSource ds; public void init(ServletConfig config) throws ServletException { org.apache.tomcat.jdbc.pool.PoolProperties prop; prop = new org.apache.tomcat.jdbc.pool.PoolProperties(); prop.setUrl("jdbc:mysql://localhost:3306/foo"); prop.setDriverClassName("com.mysql.jdbc.Driver"); prop.setUsername("user"); prop.setPassword("password"); org.apache.tomcat.jdbc.pool.DataSource dataSource; dataSource = new org.apache.tomcat.jdbc.pool.DataSource(); dataSource.setPoolProperties(prop); ds = dataSource; } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws Ser

Categories : Tomcat

Grails run-app fails with oracle-jdk-bin-1.7.0.25
Perhaps you encounter this bug: http://jira.grails.org/browse/GRAILS-10183 This was fixed in the latest Grails release.

Categories : Hibernate

How to configure Grails to avoid deletion of uploaded images when redeploy in a Tomcat server
In the code, I see that your are saving uploaded files into your WEB-INF folder. Although you can do that, when you restart server/ redeploy application, the content of your web-app folder will be replaced, hence the uploaded file will be removed as well. That's how Tomcat works. I think the better way to do that is saving your uploaded file to a folder which is NOT inside of your web container (Tomcat) folder. By that way, it won't be deleted when you: 1) Redeploy your web application 2) Restart Tomcat for whatever reason A practice my team used to do is that we create a custom folder in the home folder of the current user. By that way we don't have to worry much about the privilege to save files.

Categories : Tomcat

Stop a running application tomcat server
You could implement your job so that it periodically checks if it's allowed to continue. This is best practice for long-running jobs anyway. If that's in place, you can easily provide a UI for the feature - be it on application restart or individual per job.

Categories : Tomcat

PUT a reportUnit through REST fails - Tomcat error
I found out that child ResourceDescriptors are references to themselves, so I had to add: PROP_RU_IS_REFERENCE = true PROP_RU_REFERENCE_URI = uriString for it to work!

Categories : Http

JNDI lookup fails when connecting from Tomcat to an EJB in JBoss 7.1.1
Tomcat as the client has to be considered as a client which does not run in the same application server container. So you have to package all relevant classes/interfaces into the .war file which is deployed on Tomcat. Looking at the stack trace: The JBoss server does respond, it's the JBoss client who reports that a class is missing: at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy The actual error (missing class) is packaged in a NamingException. So you have to put the relevant classes into the .war file for Tomcat: It's probably your remote interface recc.business.login.LoginBeanRemote. I always have EJB classes (implementation) and their interfaces in two separate packages, and the EJB client gets a .jar file which just contains the interfaces (and possibly ex

Categories : Tomcat

Tomcat setup fails on Mac with 'Cannot find jni_md.h in /usr/bin/java/'
If you're merely using tomcat, you needn't build it, just download a version, unzip, set CATALINA_HOME, and hit $CATALINA_HOME/bin/catalina.sh start. The only reason I'd want to build it yourself is if I were a developer, instead of a mere user. Leave a comment if you have further problems.

Categories : Java

Stop Grails from HTML encoding messages?
g:message was changed because of a XSS vulnerability (GRAILS-7170). See http://jira.grails.org/browse/GRAILS-10099 for a workaround for continuing to use HTML arguments in certain cases (such as your use case).

Categories : Grails

Grails database migration fails with LiquibaseException
The problem was that the updateOnStartFileNames property takes an Array, not a String, so the configuration should be grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.groovy'] The plugin iterates over this list executing each in turn, but when given a String it iterates over each character and executes it. Liquibase then throws the exception because it doesn't recognise the suffix of the first letter, in this case, 'c'.

Categories : Grails

Java nio connection is creating multiple socket level connections, Why?
The image is very small but on closer investigation you have two Java processes the first process has a connection to itself. There is a connection for each end, port 52209 and 52210. it also has a connection from the second process on port 1001. the second process is the client you are running with one connection to port 1001

Categories : Java

Are there performance/other downsides in creating a new RJDBC connections to MS SQL database for each request?
Many Questions: 1) Reusing a connection is faster then establishing a new connection for every use. Depending on your code, this will speedup your application a little bit. But reusing connections is more complex. Thats the reason why many people use connection pools. 2) If your program has a short runtime you can work with one connection, e.g. in a global variable. If your application is a server application (long running), than you need to maintain your connection because the server can close the connection, if he thing that nobody use it because there runs no traffic over the connection. This could happen in the night times on server applications. The connection maintenance function is part of connection pools. Summary. If your application a simple, not multi threaded, not server app

Categories : SQL

Tomcat 7/Maven deploy fails, context path not found
The tomcat maven plugin has been moved to the Apache umbrella and been significantly updated since v1.1. I tried reverting to the mojo you're using, above, and could not get it to deploy either. There's a Tomcat7-specific mojo that works just fine. Try using <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> ... </configuration> </plugin> instead. You can find all the documentation at https://tomcat.apache.org/maven-plugin-2.1/index.html

Categories : Eclipse

Grails create-controller fails (inside Eclipse)
I don't think your package name is valid. I've never officially looked it up for Groovy, but I believe Groovy follows Java naming conventions for packages, which states you can't have package names start with a digit.

Categories : Eclipse

Tomcat with unpackWARs="false" fails to deploy CDI Weld based application
ich chume nöd drus. z vill Infos. Rüef mich mal, wänns Problem nöchst mal vorchunnt. ok, jetzt chumi drus. schräg... In short: when deploying packed as war (unpackWar=FALSE), the application cannot acces some beans. I'll have a look at your settings next time it occurs.

Categories : Java

How to analyze which processes are creating (short-lived) local network connections to my service?
You could always have a look at a very handy tool called Process Monitor. It was developed by Mark Russinovich, and is now part of a Microsoft toolset. It allows you to monitor lots of events, including thread creation, registry access, file access, and network activity. All of these events are on a per-process basis, so you should be able to use the filters to see what process is connecting to a specific port local port. I'm not sure if this would include UDP (which is generally connectionless), but certainly a quick test shows TCP Connect, Disconnect, Send and Receive events. It's a very handy tool to add to your programming toolbox anyway.

Categories : C#

session storage on mongo DB is creating one line on DB for each http request and not one per login/sign up
I can't help you debug that issue, but I can suggest using connect-redis instead. The Redistogo nano instance on Heroku is free, and should support automatically expiring unused sessions so that you won't need a pricier option.

Categories : Node Js

To stop finding running average once the condition fails?
sub = [767220, 769287, 770167, 770276, 770791, 770835, 771926, 1196500, 1199789, 1201485, 1206331, 1206467, 1210929, 1213184, 1213204, 1213221, 1361867, 1361921, 1361949, 1364886, 1367224, 1368005, 1368456, 1368982, 1369000, 1370365, 1370434, 1370551, 1371492, 1471407, 1709408, 1710264, 1710308, 1710322, 1710350, 1710365, 1710375] def runningMean(seq, n=0, total=0): #function called recursively if not seq: return [] total = total + int(seq[-1]) if int(seq[-1]) < total/float(n+1) * 0.9: # Check your condition to see if it's time to stop averaging. return [] return runningMean(seq[:-1], n=n+1, total=total) + [total/float(n+1)] avg = runningMean(sub, n = 0, total = 0) print avg print sub[-len(avg):]

Categories : Python

Looping over attributes in validation fails to stop set of attribute
You are not returning any value from the validate method, you were returning 'error' from the each() callback method, not from validate //My default strings from another place MyApp.strings.defaults = { firstName : 'first name' } //Model Validate function validate : function(attr){ var error; jQuery.each(attr, function(key, value){ var defaultValue = MyApp.strings.defaults[key]; if(defaultValue){ defaultValue = jQuery.trim(defaultValue.toLowerCase()); if(value.toLowerCase() == defaultValue){ console.log(value, defaultValue); //fires, and outputs both as being the same error = 'error'; return false; } } }); return error; }

Categories : Javascript

Tomcat container fails to use configuration if exception occurs after the response object's OutputStream is opened
I think you need to add custom controller to render pages defined in web.xml. @see description here: Custom error pages in Tomcat with Spring

Categories : Java

Grails Commons DBCP Pool vs. Tomcat JDBC Pool
The Commons DBCP pool is very good, but the Tomcat pool is more flexible and has higher performance. The initial blog posts from tomcatexpert.com are a bit dated, but should still be very relevant and if anything the numbers should be better now: http://www.tomcatexpert.com/tags/connection-pool Note that in 2.3 we've replaced Commons DBCP with Tomcat JDBC, so it makes sense to start using it now.

Categories : Grails

How to configure tomcat web.xml and tomcat-users.xml to secure a tomcat page
As far as access to the tomcat manager GUI is considered, there is no role as "manager" to set in tomcat-users.xml. you have to specify one of these roles. You can find the role names in the web.xml file of the Manager web application. The available roles are: •manager-gui — Access to the HTML interface. •manager-status — Access to the "Server Status" page only. •manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page. •manager-jmx — Access to JMX proxy interface and to the "Server Status" page. have a look into this link for further info, http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html I hope it helps, thanks.

Categories : Xml

IIS SQL Server: Connection Pool: Why are new connections made instead of reusing existing connections?
If the connections are coming from a different machine, the connections can't be pooled. A connection required both endpoints to be a connection. If you are using connection pooling correctly, applications instantiate a connection (from the pool), use the connection, then drop it as soon as exchange is complete. If you a writing a single-threaded desktop app, another common and simple strategy is to open a connection, and just leave that connection open as long as the application is running. You can control how many connections are created, etc. see MS article for more details related to connection pooling. IIRC, connection pools are not shared unless the connection string is identical either.

Categories : Sql Server

New Grails domain class is not creating a table in the database
The easiest thing would be to add dbCreate = "update" to your DataSource.groovy. A better thing would be to use the database-migrations plugin for your app. Regarding manually creating tables, the convention grails following by default is to underscore camelcase. For example, given the following domains: class User { String firstName String lastName static hasMany = [addresses: Address] } class Address { static belongsTo = [user: User] } You would end up with the following tables: user --------- id version first_name last_name --------- address --------- id version user_id ---------

Categories : Oracle

Is it possible to create different connections per client in SignalR? Persistent Connections
You could use my lib for this called SignalR.EventAggregatorProxy Install using nuget Install-Package SignalR.EventAggregatorProxy It takes care of the Hub and connection details for you under the hood, so that you only need to subscribe and publish events Check wiki for how to set it up https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/wiki Once set up all you need todo to get it to listen to a back end event from javascript is ViewModel = function() { signalR.eventAggregator.subscribe(MyApp.Events.TestEvent, this.onTestEvent, this); }; You can listen to how many events you want on only one connection and one hub

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.