Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 115/255 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • Connection error in java website. Tnsping shows that the service is running

    - by user1439090
    I have a java website application running in windows 7 which uses oracle database for its functionalities. The database has default SID name orcl. When I use tnsping, I can see that the orcl service is active. Also most of the application is working fine except for one part. I was wondering if someone could help me with the following error:- 1. cause: message:null,java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.olat.course.statistic.StatisticAutoCreator.createController(StatisticAutoCreator.java:73) at org.olat.course.statistic.StatisticActionExtension.createController(StatisticActionExtension.java:40) at org.olat.course.statistic.StatisticMainController.createController(StatisticMainController.java:80) at org.olat.core.gui.control.generic.layout.GenericMainController.getContentCtr(GenericMainController.java:258) at org.olat.core.gui.control.generic.layout.GenericMainController.event(GenericMainController.java:221) at org.olat.core.gui.control.DefaultController.dispatchEvent(DefaultController.java:196) 2. cause: message:Could not get JDBC Connection; nested exception is java.sql.SQLException: The Network Adapter could not establish the connection,org.springframework.jdbc.CannotGetJdbcConnectionException at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:455) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:463) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:471) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:476) at org.springframework.jdbc.core.JdbcTemplate.queryForLong(JdbcTemplate.java:480) at org.olat.course.statistic.SimpleStatisticInfoHelper.doGetFirstLoggingTableCreationDate(SimpleStatisticInfoHelper.java:63) at org.olat.course.statistic.SimpleStatisticInfoHelper.getFirstLoggingTableCreationDate(SimpleStatisticInfoHelper.java:81) at org.olat.course.statistic.StatisticDisplayController.getStatsSinceStr(StatisticDisplayController.java:517) 3. cause: message:The Network Adapter could not establish the connection,java.sql.SQLException at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413) at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:508) at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:203) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510) at java.sql.DriverManager.getConnection(DriverManager.java:582) 4. cause: message:The Network Adapter could not establish the connection,oracle.net.ns.NetException at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:328) at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:421) at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:634) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:208) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:966) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292) at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:508) at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:203) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510) 5. cause: message:Connection timed out: connect,java.net.ConnectException at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at java.net.Socket.connect(Socket.java:475) at java.net.Socket.(Socket.java:372) at java.net.Socket.(Socket.java:186) at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:127)

    Read the article

  • post_save signal on m2m field

    - by Dmitry Shevchenko
    I have a pretty generic Article model, with m2m relation to Tag model. I want to keep count of each tag usage, i think the best way would be to denormalise count field on Tag model and update it each time Article being saved. How can i accomplish this, or maybe there's a better way?

    Read the article

  • Java unchecked method invocation

    - by Sam
    I'm trying to setup a multithreaded application using SQLite4java, and everything is working fine. However, according to the getting started tutorial I am meant to create an object of type "object" and in order to return a value of null (due to use of generic types). Here is the suggested code: queue.execute(new SQLiteJob<Object>() { protected Object job(SQLiteConnection connection) throws SQLiteException { // this method is called from database thread and passed the connection connection.exec(...); return null; } }); Source The following example code I created produces the same error: error: test.java:9: warning: [unchecked] unchecked method invocation: <T,J>execute(J) in com.almworks.sqlite4java.SQLiteQueue is applied to (query<java.lang.Integer>) queue.execute(new query<Integer>()); test.java: import com.almworks.sqlite4java.*; import java.util.ArrayList; import java.io.File; class test{ public static void main(String[] args){ File f = new File("file.db"); SQLiteQueue queue = new SQLiteQueue(f); queue.execute(new query<Integer>()); } } query.java: import com.almworks.sqlite4java.SQLiteException; import com.almworks.sqlite4java.SQLiteJob; import com.almworks.sqlite4java.SQLiteConnection; import com.almworks.sqlite4java.SQLiteStatement; import java.util.ArrayList; class query<T> extends SQLiteJob{ protected ArrayList<Integer> job(SQLiteConnection connection) throws SQLiteException{ ArrayList<Integer> ints = new ArrayList<Integer>(); //DB Stuff return ints; } } I have read a lot about how this particular message appears when people fail to specify a type for an ArrayList. However, I am not attempting to cast the object or do anything with it. It is merely a mechanism implemented by the library developers in order to return a null. I do not believe this to be an issue relating directly to the library, which is why I'm asking this on StackOverflow. I believe it all comes down to my lack of experience with generic types. I've already spent a few hours on this and don't feel like I am getting anywhere. How do I stop the warning?

    Read the article

  • Generics: How to derive from one of two classes?

    - by Yaron Naveh
    I have the following c# classes: class A : Object { foo() {} } class B : Object { foo() {} } I want to write a generic method that applies to both: void bar<T>(T t) { t.foo(); } this does not compile complaining the foo() is not a member of T. I can add a constraint for T to derive from one of the classes: void bar<T>(T t) where T : A but how can I have it for both?

    Read the article

  • Shell script argument parsing

    - by Peter Coulton
    There are a number of questions about this sort of thing but lets imagine we are targeting a generic Linux system with both getopt and getopts installed (not that we'll use either, but they seem popular) How do I parse both long (--example | --example simple-option) and short argruments (-e | -esimple-example | -e simple-example)

    Read the article

  • Up to date, JPA compliant GenericDAOImplementation

    - by HDave
    I read this article: http://www.ibm.com/developerworks/java/library/j-genericdao.html several times and believe I understand what it is saying. However, it is 4 years old and I have a JPA compliant Java application to contend with. In addition, I see that there is a JPATemplate in Spring that has some good functionality, but the Spring documentation says it is already deprecated! Can anybody point me to a solid, modern, JPA compliant, Spring based, working example of a GenericDAOImpl that proxies an Interface to provide generic finder execution?

    Read the article

  • Please explain this python behavior

    - by StackUnderflow
    class SomeClass(object): def __init__(self, key_text_pairs = None): ..... for key, text in key_text_pairs: ...... ...... x = SomeClass([1, 2, 3]) The value of key_text_pairs inside the init is None even if I pass a list as in the above statement. Why is it so?? I want to write a generic init which can take all iterator objects... Thanks

    Read the article

  • app-engine-patch and "object_detail" view didn't work

    - by Hugh
    Hi(Sorry for my ugly english) When I calling the flowing: http://192.168.62.90:8000/blog/entry/?agphdXR1bW4xOTEychALEgpibG9nX2VudHJ5GCYM will use this: urlpatterns = patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^$', list_detail.object_list, entry_info), (r'^entry/(?P<object_id>.*)$', list_detail.object_detail, {'queryset': Entry.all(), 'template_name': 'sample_test_page.html'}), ) and the error is: Generic view must be called with either an object_id or a slug/slug_field. I want to know why this didn't work for me.

    Read the article

  • What is the Fastest Way to Check for a Keyword in a List of Keywords in Delphi?

    - by lkessler
    I have a small list of keywords. What I'd really like to do is akin to: case MyKeyword of 'CHIL': (code for CHIL); 'HUSB': (code for HUSB); 'WIFE': (code for WIFE); 'SEX': (code for SEX); else (code for everything else); end; Unfortunately the CASE statement can't be used like that for strings. I could use the straight IF THEN ELSE IF construct, e.g.: if MyKeyword = 'CHIL' then (code for CHIL) else if MyKeyword = 'HUSB' then (code for HUSB) else if MyKeyword = 'WIFE' then (code for WIFE) else if MyKeyword = 'SEX' then (code for SEX) else (code for everything else); but I've heard this is relatively inefficient. What I had been doing instead is: P := pos(' ' + MyKeyword + ' ', ' CHIL HUSB WIFE SEX '); case P of 1: (code for CHIL); 6: (code for HUSB); 11: (code for WIFE); 17: (code for SEX); else (code for everything else); end; This, of course is not the best programming style, but it works fine for me and up to now didn't make a difference. So what is the best way to rewrite this in Delphi so that it is both simple, understandable but also fast? (For reference, I am using Delphi 2009 with Unicode strings.) Followup: Toby recommended I simply use the If Then Else construct. Looking back at my examples that used a CASE statement, I can see how that is a viable answer. Unfortunately, my inclusion of the CASE inadvertently hid my real question. I actually don't care which keyword it is. That is just a bonus if the particular method can identify it like the POS method can. What I need is to know whether or not the keyword is in the set of keywords. So really I want to know if there is anything better than: if pos(' ' + MyKeyword + ' ', ' CHIL HUSB WIFE SEX ') > 0 then The If Then Else equivalent does not seem better in this case being: if (MyKeyword = 'CHIL') or (MyKeyword = 'HUSB') or (MyKeyword = 'WIFE') or (MyKeyword = 'SEX') then In Barry's comment to Kornel's question, he mentions the TDictionary Generic. I've not yet picked up on the new Generic collections and it looks like I should delve into them. My question here would be whether they are built for efficiency and how would using TDictionary compare in looks and in speed to the above two lines? In later profiling, I have found that the concatenation of strings as in: (' ' + MyKeyword + ' ') is VERY expensive time-wise and should be avoided whenever possible. Almost any other solution is better than doing this.

    Read the article

  • 8GB Compact Flash Corrupted, Boot Sector Lost ?

    - by robert
    I have an 8GB Kingston compact Flash, and when I insert it into my mac it says that card is unredable and ask me for initialization. If i open Utilty Disk it show a card of 2,2 TB Generic Comact Flash, if I try to initialize that it give me error: POSIX reports: impossible to allocate memory. How i can format that ? There's a way with fdisk or smt to get this card work ? Thanks

    Read the article

  • rollover images with Jquery

    - by Matt
    Beginner question here. I'm going to make a Jquery function that is used to change an image when hovering over it. I use the id name as the selector. How do I make it generic so that I don't have to have a copy of the function for every single tag with a rollover image? $("#home img").hover( function(){ blah }, function(){ blah } );

    Read the article

  • WordPress Custom Theme Favicon in Dashboard Menu

    - by Scott B
    When you create a custom theme in WordPress, you can add a link to your theme options on the left menu in the WP dashboard. The default icon that's used next to your menu label is called generic.png and resides in the wp-admin/images directory. Anyone know how to tell WP to use my theme's custom favicon.png instead of the default?

    Read the article

  • Cross Join 'n' times a table

    - by SDReyes
    It is possible to write a generic function/procedure/select/somethingElse to cross-join a table against himself 'n' times? (yes, 'n' is a given parameter : ) How would you do it? Example Having this table: Value ------- 1 2 3 cross join it 2 times, would return: Value | Value ------------------ 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3

    Read the article

  • How to Pass Parameters to Activator.CreateInstance<T>()

    - by DaveDev
    Hi guys I want to create an instance of a type that I specify in a generic method that I have. This type has a number of overloaded constructors. I'd like to be able to pass arguments to the constructors, but Activator.CreateInstance<T>() doesn't see to have this as an option. Is there another way to do it? Thanks Dave

    Read the article

  • C++ template meta-programming, number of member variables?

    - by aaa
    hello Is it possible in C++ to determine number of variables/fields in the generic class? for example // suppose I need metaclass number_members determines number of members struct example { int i, j; }; assert(number_members::value==2); I looked through mpl but could not find implementation thanks.

    Read the article

  • jquery form dialog dissapears if i use effect

    - by vasion
    i am using JqueryUI and everything was fine until i tried to jazz it up and added an effect for showing and closing the dialog. Now the dialog appears and disappears in an instant. I am using CAKEPHP, if that matter and still have cake.generic.css on and the debug option on, but i dont see how this could matter.

    Read the article

  • Java class object from type variable

    - by Alexander Temerev
    Is there a way to get Class object from the type variable in Java generic class? Something like that: public class Bar extends Foo<T> { public Class getParameterClass() { return T.class; // doesn't compile } } This type information is available at compile time and therefore should not be affected by type erasure, so, theoretically, there should be a way to accomplish this. Does it exist?

    Read the article

  • Nested generator functions in python

    - by Yuval A
    Consider a tuple v = (a,b,c) and a generator function generate(x) which receives an item from the tuple and generates several options for each item. What is the pythonic way of generating a set of all the possible combinations of the result of generate(x) on each item in the tuple? I could do this: v = (a,b,c) for d in generate(v[0]): for e in generate(v[1]): for f in generate(v[2]): print d,e,f but that's just ugly, plus I need a generic solution.

    Read the article

  • Python logger dynamic filename

    - by sharjeel
    I want to configure my Python logger in such a way so that each instance of logger should log in a file having the same name as the name of the logger itself. e.g.: log_hm = logging.getLogger('healthmonitor') log_hm.info("Testing Log") # Should log to /some/path/healthmonitor.log log_sc = logging.getLogger('scripts') log_sc.debug("Testing Scripts") # Should log to /some/path/scripts.log log_cr = logging.getLogger('cron') log_cr.info("Testing cron") # Should log to /some/path/cron.log I want to keep it generic and dont want to hardcode all kind of logger names I can have. Is that possible?

    Read the article

  • AD-DirectoryServices: .NET2.0 - Speaking architecture, approach and best practices... Suggestions?

    - by Will Marcouiller
    I've been mandated to write an application to migrate the Active Directory access models to another environment. Here's the context: I'm stuck with VB.NET 2005 and .NET Framework 2.0; The application must use the Windows authenticated user to manage AD; The objects I have to handle are Groups, Users and OrganizationalUnits; I intend to use the Façade design pattern to provider ease of use and a fully reusable code; I plan to write a factory for each of the objects managed (group, ou, user); The use of Attributes should be useful here, I guess; As everything is about the DirectoryEntry class when accessing the AD, it seems a good candidate for generic types. Obligatory features: User creates new OUs manually; User creates new group manually; User creates new user (these users are services accounts) manually; Application reads an XML file which contains the OUs, groups and users to create; Application informs the user about the OUs, groups and users that shall be created; User specifies the domain environment where to migrate the XML input file designated objects; User makes changes if needed, and launches the task operations; Application performs required by the XML input file operations against the underlying AD as specified by the user; Application informs the user upon completion. Linear features: User fetches OUs, groups, users; User changes OUs, groups, users; User deletes OUs, groups, users; The application logs AD entries and operations performed, plus errors and exceptions; Nice-to-have features: Application rollbacks operations on error or exception. I've been working for weeks now to get acquainted with the AD and the System.DirectoryServices assembly. But I don't seem to find a way to be fully satisfied with what I'm doing and always looking for better. I have studied Bret de Smet's Linq to AD on CodePlex, but then again, I can't use it as I'm stuck with .NET 2.0, so no Linq! But I've learned about Attributes, and seen that he's working with generic types as he codes a DirectorySource class to perform the operations for OUs, groups and users. I have been able to add groups to the AD; I have been able to add users to the AD; The created user is automatically disabled? I seem to get confused with the use of a LDAP path to add objects. For instance, one needs two instances of a System.DirectoryServices.DirectoryEntry class to add a group, for instance. Why this? Any suggestions? Thanks for any help, code sample, ideas, architural solution, everything!

    Read the article

  • Need help with auto-scaffolding template in ASP.NET MVC

    - by DanM
    I'm trying to write an auto-scaffolder for Index views. I'd like to be able to pass in a collection of models or view-models (e.g., IQueryable<MyViewModel>) and get back an HTML table that uses the DisplayName attribute for the headings (th elements) and Html.Display(propertyName) for the cells (td elements). Each row should correspond to one item in the collection. Here's what I have so far: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% var items = (IQueryable<TestProj.ViewModels.TestViewModel>)Model; // Should be generic! var properties = items.First().GetMetadata().Properties .Where(pm => pm.ShowForDisplay && !ViewData.TemplateInfo.Visited(pm)); %> <table> <tr> <% foreach(var property in properties) { %> <th> <%= property.DisplayName %> </th> <% } %> </tr> <% foreach(var item in items) { %> <tr> <% foreach(var property in properties) { %> <td> <%= Html.Display(property.DisplayName) %> // This doesn't work! </td> <% } %> </tr> <% } %> </table> Two problems with this: I'd like it to be generic. So, I'd like to replace var items = (IQueryable<TestProj.ViewModels.TestViewModel>)Model; with var items = (IQueryable<T>)Model; or something to that effect. The <td> elements are not working because the Html in <%= Html.Display(property.DisplayName) %> contains the model for the view, which is a collection of items, not the item itself. Somehow, I need to obtain an HtmlHelper object whose Model property is the current item, but I'm not sure how to do that. How do I solve these two problems?

    Read the article

  • WPF ComboBox ControlTemplate Background problem

    - by PaN1C_Showt1Me
    This is an example of a ComboBox's ControlTemplate. CLICK HERE I've tried to set the Background / add a trigger to change the background when the ComboBox is focused (with a tab key for example), both without success. I don't even understand why it isn't included by default ! (compared to the original generic template)

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >