[JBoss Seam] - TestNG/SeamTest NPE in xml parsing
by vijayamaladoss
I am trying to Unit test entities using SeamTest and TestNG. I have a strange problem in running TestNG(SeamTest). When I am connected to internet
running a ant test throws a exception shown below.
test:
| [testng] Exception in thread "main" java.lang.NullPointerException
| [testng] at org.testng.xml.Parser.parse(Parser.java:162)
| [testng] at org.testng.TestNG.setTestSuites(TestNG.java:472)
| [testng] at org.testng.TestNG.configure(TestNG.java:866)
| [testng] at org.testng.TestNG.privateMain(TestNG.java:822)
| [testng] at org.testng.TestNG.main(TestNG.java:802)
|
When I detach from internet it throws an exception(below) but continues to run tests.
test:
| [testng] java.net.UnknownHostException: hibernate.sourceforge.net
| [testng] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
| [testng] at java.net.Socket.connect(Socket.java:520)
| [testng] at java.net.Socket.connect(Socket.java:470)
| [testng] at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
| [testng] at sun.net.www.http.HttpClient.openServer(HttpClient.java:387)
| [testng] at sun.net.www.http.HttpClient.openServer(HttpClient.java:522)
| [testng] at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
| [testng] at sun.net.www.http.HttpClient.New(HttpClient.java:304)
| [testng] at sun.net.www.http.HttpClient.New(HttpClient.java:321)
| [testng] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(
|
|
I understand this is something to do with validating parsers, but both xerces/xml-api is not in my class path as I am using seam-gen based application.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101458#4101458
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101458
18 years, 5 months
[JNDI/Naming/Network] - Re: jndi jboss service problem connecting
by ByDcc
Thanks for your help.
I think I needed to read a lot about this issue.
Now, I've got to lookup a datasource and got a connection. It was only a test.
But, I really want to lookup an entity manager for my persistence unit.
My code is:
Properties ht = new Properties();
| ht.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| ht.put("java.naming.provider.url", "jnp://localhost:1099");
| ht.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
|
| Context ic = new InitialContext(ht);
|
| Object obj=ic.lookup("cartstore");
| EntityManager em = (EntityManager) obj;
|
| CategoryEntity ce = new CategoryEntity();
| ce.setCreationDate(new Timestamp( Calendar.getInstance().getTimeInMillis() ) );
| ...
| em.persist(ce);
But a I get a null reference to my entity manager.
Persistence unit definition:
<persistence>
| <persistence-unit name="cartstore">
| <!--jta-data-source>java:/CartStoreDS</jta-data-source-->
| <jta-data-source>CartStoreDS</jta-data-source>
| <class>com.cartstore.persistence.domain.model.CategoryEntity</class>
| <class>com.cartstore.persistence.domain.model.ItemEntity</class>
|
| <properties>
| <property name="jboss.entity.manager.jndi.name" value="cartstore"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="CartstoreFactory"/>
| </properties>
| </persistence-unit>
| </persistence>
jboss.entity.manager.jndi.name property force to jboss to public my persistence unit in global jndi section,
reference: http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/e...
Info from JNDIView:
Global JNDI Namespace
......
+- persistence.units:unitName=cartstore (class: org.hibernate.impl.SessionFactoryImpl)
.....
+- CartStoreDS (class: javax.sql.DataSource)
....
I know that I could test it with a EJB3StandaloneDeployer (JBoss) but I would like to do a fisrt test as simple as posible.
Any idea of why I am not be able to see my entity manager will be appreciated.
Thank you in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101454#4101454
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101454
18 years, 5 months
[JBoss Tools (users)] - GDI leak in FreeMarker IDE
by kyle30312
I'm seeing Eclipse crashes that I think are caused by a GDI handle leak in the FreeMarker IDE plugin for Eclipse.
Using FreeMarker IDE 1.0.0.beta3 with Eclipse 3.3.1.1 on Windows XP SP2, as I type inside a directive tag (like <@abc name="def" />), the Outline view updates. As it updates, the GDI handle count (visible in Process Explorer) increases; when it reaches 9,999, Eclipse fails to paint and won't shut down cleanly.
The number of handles leaked appears to be N for each character typed, where N is the number of items displayed in the Outline view. Not showing the Outline view at all (i.e. close it and restart Eclipse) appears to work around the problem.
- Is anyone else seeing this problem?
- Can anyone recommend a fix? From a quick look at the code, I'm guessing Image objects may not be getting dispose()'d, but I'm not sure when they should be disposed.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101450#4101450
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101450
18 years, 5 months